View Single Post
  #19  
Old 02-07-2010, 12:07 AM
Immolate Immolate is offline
Indigo
Join Date: Dec 2009
Posts: 322
Immolate is on a distinguished road
Quote:
Originally Posted by DustyPorViva View Post
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.-5mypl.| && pl.y in mypl.y-5,mypl.+| ) {     
      
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.
Reply With Quote