View Single Post
  #18  
Old 02-07-2010, 12:04 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to 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.-5mypl.| && pl.y in mypl.y-5,mypl.+| ) {     
      
pl.chat pl.account;
    }
  }
}
//#CLIENTSIDE
function onKeyPressed(){
  if(
keydown(6)){
    
triggerserver("gui"name,player.account);
  }

Also, you can instead on the clientside use findnearestplayers(x,y), loop through, find the players you wish to send the chat and send the array to the serverside, instead of letting the server handle the loop.
Reply With Quote