Clientside is doesn't sucks, it's just clientside, and it's not broken.
Think of it as a separated server that only the cliente can access the data.
So just take a look at this example:
Code: Select all
int i=0;
script 1 open{
i = 30;
print(d:i);
}
script 2 open clientside{
delay(35);
print(d:i);
}
the print inside script 1 will show 30, and the print inside script 2 will show zero, why? because when you set the value 30 to i, you're changing the server i value, so, the clientside i is not going to be changed, the only way the server can change it is calling a clientside script, like this one
Code: Select all
int i=0;
script 1 open{
i = 30;
acs_execute(3,0,30);
print(d:i);
}
script 2 open clientside{
delay(35);
print(d:i);
}
script 3 (int a) clientside{
i = a;
}
that way, both prints will show 30...
Clientside is only used for scripts that MUST not change the gameplay, just the graphics.
EDIT:
there's also a way to make a clientside script call a serverside script, so the cliente can pass a value to the serve (like the cliente pass 30 to server store in i, and then server prints 30), but, idk the specific acs call for this case
EDIT2: also, when you call an clientside script, all players will start the script, so you must check if the activator has the same tid as the consoleplayernumber, if not, call terminate(); (this way, only the player who called the script will execute it till the end)