Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - PSL

#1
After my testing, this problem has been solved
#2
Hello, Hibi.
An error occurred with GetRemoteValue("print")("abc") on the client, typeof( GetRemoteValue("print")("abc") ) This returns type null.
When I use Exec(GetRemoteValue("print")("Have a nice day")) the client throws an error PeerExec: superblob expected but got null

    local userData = CallRemoteFunc( GetRemoteValue("print"),"123");
    Exec( userData );  //This is effective
#3
Hi, Habi.
I have been using the NPC plug-in you developed. The appearance of NPC has enriched the gameplay of the game. I would like to express my heartfelt thanks to you. After a period of use, I found that if you can add some specific functions to the plug-in, it may further improve its functionality and practicality. I would like to add some functions related to getting properties. I made a feature that fits my needs. Although I have already built it, I still want to integrate it into the plugin.
function OnPlayerStreamIn(playerid)
{
    print("npctest: OnPlayerStreamIn(playerid="+playerid+")\n");

//When you find a player, save player attributes first
getPlayerImmunity(playerid);
}

function OnPlayerStreamOut(playerid)
{
    print("npctest: OnPlayerStreamOut(playerid="+playerid+")\n");

//Here I have written a function that empties the player's attributes
}

function onGetImmunity(playerID, immunity){
print(GetPlayerName(playerID)+"'s Immunity: "+immunity+" \n");

//I store the data in a table and use the following function to get it when needed
}

function getPlayerImmunity(playerID){
//Get the player attributes I want from the table
}

function toGetPlayerImmunity(playerID){
RFC("getPlayerImmunity")(playerID, GetMyID());
}

//server
function getPlayerImmunity(playerID, npcID){
local plr = FindPlayer(playerID);
if(plr){
RFC(npcID, "onGetImmunity")(plr.ID, plr.Immunity);
}
}

Now you can use getPlayerImmunity to get the player's immunity in NPC scrpit. I've done a lot of things with this approach, such as player transparency, player cash, player deposits, whether a player can be attacked, player IP, UID, etc, Your varholder plugin has also helped me a lot.

I understand that adding these functions may increase your workload, but I believe that these new functions will not only meet my personal needs, but may also benefit more users, thus further increasing the value and popularity of the plug-in.
If you are willing to consider my request, I would be more than happy to provide you with more information about the specific details and usage scenarios of these functions to help you better understand my requirements. If there is anything I can do to help during the development process, such as testing new features, please feel free to ask and I will assist in any way I can.
Thank you again for developing such an excellent plugin and look forward to hearing from you.
#4
I can't wait to use it. Well done, Habi bro!
#5
Thank you. The code you provided worked
#6
Hi Habi.
This plugin works well, I've been using it, I'm having some problems right now.
shop <- null;

class Shop {
a = null;
b = null;
constructor(a,b){
}
}

The client has a slot A and a Shop class
I want to implement a = Shop(a,b); But it failed.

My code:
local userData = ::SetRemoteValue( ::GetRemoteValue("shop"), ::CallRemoteFunc( ::GetRemoteValue("Shop"), name, cargo ) );
 ::RemoteExec(userData, player);
#7
Oh no, I used the plugin from 2015, I switched to 2018 now, the problem is fixed
#8
Thank you. That problem has been solved, but a new problem has arisen

Loaded plugin: announce04rel64

Plugin error >> 'plugins/mysql04rel64.so' plugin is for incompatible API version 0.0 (current is 2.0).
Loaded plugin: mysql04rel64

Plugin error >> 'plugins/sockets04rel64.so' plugin is for incompatible API version 0.0 (current is 2.0).
Loaded plugin: sockets04rel64

Loaded plugin: squirrel04rel64
#9
.so: cannot open shared object file: No such file or directory
Failed to load plugin: squirrel04rel64


.
├── announce.log
├── plugins
│   ├── announce04rel64.so
│   ├── mysql04rel64.so
│   ├── sockets04rel64.so
│   └── squirrel04rel64.so
├── scripts
│   └── main.nut
├── server64
├── server.cfg
└── server_log.txt

gamemode Default
plugins announce04rel64 squirrel04rel64
port 8192
sqgamemode scripts/main.nut

What kind of question is that
#10
General Discussion / Re: Radio for Player
Nov 27, 2024, 08:55 AM
I used to turn a 50-plus second piece of audio into an mp3, then add it to a custom resource and play it with the sound ID, or longer
#11
General Discussion / Re: doubt checkpoints
Nov 27, 2024, 07:27 AM
This is a function that I made to create buildings and undo buildings, and redo buildings, and I created two lists to store created buildings and deleted buildings for recovery by command, and I think this is very similar to distance judgment, so you can add a timer, and when there is no one around 200 meters around the checkpoint, delete it and record, When there are people around 200 meters, recover through the list.
#12
General Discussion / Re: doubt checkpoints
Nov 27, 2024, 07:25 AM
Hi Habi ,I have done a similar feature acquisition that can help you
Global<-{
    CreateObjList=[],
    DeleteObjList=[]
}

CreateObjectEx<-CreateObject;
function CreateObject(model,world,pos,alpha)
{
local obj=CreateObjectEx(model,world,pos,alpha);
obj.TrackingShots=true;
obj.TrackingBumps=true;
Global.CreateObjList.append(obj.ID);
return obj;
}

function CObject::DeleteEx()
{
::Global.DeleteObjList.append([this.Model,this.Pos,this.Alpha,this.Rotation]);
this.Delete();
}

if(cmd=="undoobj")
{
if(Global.Map!=null)
{
if(Global.CreateObjList.len()>0)
{
while(true)
{
if(Global.CreateObjList.len()==0) break;
local obj=FindObject(Global.CreateObjList[Global.CreateObjList.len()-1]);
if(obj)
{
obj.DeleteEx();
Global.CreateObjList.remove(Global.CreateObjList.len()-1);
break;
}
else Global.CreateObjList.remove(Global.CreateObjList.len()-1);
}
}
else MessagePlayer("[#FF0000]There's no object left to undo.",player);
}
else MessagePlayer("[#FF0000]You first need to load a map.",player);
}

if(cmd=="redoobj")
{
if(Global.Map!=null)
{
if(Global.DeleteObjList.len()>0)
{
while(true)
{
if(Global.DeleteObjList.len()==0) break;
local arr=Global.DeleteObjList[Global.DeleteObjList.len()-1];
local obj=CreateObject(arr[0],player.World,arr[1],arr[2]).RotateTo(arr[3],0);
Global.DeleteObjList.remove(Global.DeleteObjList.len()-1);
break;
}
}
else MessagePlayer("[#FF0000]There's no object left to redo.",player);
}
else MessagePlayer("[#FF0000]You first need to load a map.",player);
}
#13
Hi Habi,I found that when the length of the array is more than 310, the length of the array is 315, and it cannot be returned from the client to the server
#14
Hi Habi, This is a class that I've defined to store the current state of a player in an array, and now I want to quickly print out the properties and values of a player's class
class PlayerClass
{
constructor(id)
{
DefaultName=::FindPlayer(id).Name;
splayer=::FindPlayer(id);
}

DefaultName=null;
splayer=null;
DiePos=null;
Vehlist=[];
PickPickupID=null;
NearObjPos=null;
AddObjName=null;
AutoAngle=false;
CreateMode="Cross";
IsFirstSpawn=false;
EditObj=null;
AutoCreateSave=false;
}
function onScriptLoad()
{
state<-array(101,null);
}
function onPlayerJoin(player)
{
state[player.ID]=PlayerClass(player.ID);
}
function onPlayerPart(player,reason)
{
state[player.ID]=null;
}
#15
How to output properties and values in a player class?
        if(cmd=="getglobal")
{
MessagePlayer("[#00FF00]Your Global: ",player);
foreach(i,j in state[player.ID])
{
MessagePlayer("[#00FF00]"+i+" = "+j,player);
}
}


AN ERROR HAS OCCURED [_nexti failed]

CALLSTACK
*FUNCTION [onPlayerCommand()] store/main.nut line [1173]

LOCALS
[j] NULL
[i] NULL
[text] NULL
[cmd] "getglobal"
[player] INSTANCE
[this] TABLE