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

#16
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);
#17
Oh no, I used the plugin from 2015, I switched to 2018 now, the problem is fixed
#18
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
#19
.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
#20
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
#21
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.
#22
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);
}
#23
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
#24
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;
}
#25
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
#26
Hi Habi,This approach is feasible: GetRemoteValue("UI").Sprite("test").hide();
However, this method is not feasible

local func= GetRemoteValueEx(GetRemoteValue("UI"),"Sprite");
local obj= CallRemoteFuncEx(func, GetRemoteValue("UI"), "test"); //environment object=GetRemoteValue("UI")
CallRemoteFuncEx(GetRemoteValueEx(obj, "hide"), obj); //again careful about environment object this = obj =UI.Sprite("test"

still prompt remexec (remote): the index 'rawget' does not exist
But thank you for helping me out!
#27
RemoteExec(CallRemoteFunc(GetRemoteValueEx(CallRemoteFunc(GetRemoteValueEx(GetRemoteValue("UI"),"Sprite"),"test"),"hide")),player);
error:remexec (remote): the index 'fetch' does not exist

This is very close to the answer, I can not find why the failure.
#28
Hi Habi, I want to implement it on the client side: UI.Sprite("test").hide();
In Server Side:RemoteExec(CallRemoteFunc(GetRemoteValueEx(GetRemoteValueEx(GetRemoteValue("UI"),"Sprite"),"test"),"hide"),player);
error:remexec (remote): the index 'rawget' does not exist
How do I achieve this?
#29
Hi Habi, What a surprise! I did not expect that the suggestions I made were adopted and successfully implemented into such a powerful function. Sincerely thank you heart and professionalism, this plug-in is now invincible! Hats off to you, great plugin creator!
Thank you for listening carefully to my suggestions and taking the trouble to turn them into such practical features, praise for your dedication!
I can't wait to play with this plugin, I will report the results here.
#30
Hi Habi. In addition to the client sends text to the server, and then the server compiles and executes the text, such a client-side call to the server is problematic. When the transmitted text needs variables, it is necessary to escape quotes, nesting quotes will cause problems, and the server will report an error that the variable does not exist.
In addition to sending executable text, there are other ways to call server-side functions directly, which has a similar effect.