Quote:
Originally Posted by DustyPorViva
You need to pass the player data serverside. On the serverside your player is not the only player object, thus you need to give the script scope.
PHP Code:
function onActionServerSide(){
for(temp.p:allplayers){
temp.pl = findplayer(p);
temp.mypl = findplayer(params[0]);
if (pl.x in | mypl.x -5, mypl.x + 5 | && pl.y in | mypl.y-5,mypl.y +5 | ) {
pl.chat = pl.account;
}
}
}
//#CLIENTSIDE
function onKeyPressed(){
if(keydown(6)){
triggerserver("gui", name,player.account);
}
}
|
Using the player object has mostly worked for me serverside when using
triggerserver, since I think it still keeps the player who triggered serverside in scope. Could be completely wrong though and it's probably a good idea to get into the habit of not assuming the player obect is always in scope.