SA-MP Forums Archive
SendClientMessage - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: SendClientMessage (/showthread.php?tid=145149)



SendClientMessage - Sascha - 01.05.2010

Hi...
how can I make this message only show once?
it always sends as many messages as there are players on the server

Код:
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
for(new i=0; i < MAX_PLAYERS; i++)
if(IsPlayerConnected(i)){
new Float:px, Float:py, Float:pz;
if(IsPlayerInRangeOfPoint(i, 3.0, x, y, z);
SendClientMessage(playerid, grey, "blablabla");
SendClientMessage(i, grey, "blablabla2");
}
}



Re: SendClientMessage - maij - 01.05.2010

Код:
new Float:x, Float:y, Float:z;
new Float:px, Float:py, Float:pz;
GetPlayerPos(playerid, x, y, z);
for(new i=0; i < MAX_PLAYERS; i++)
{
   if(IsPlayerConnected(i)&&i!=playerid){
    if(IsPlayerInRangeOfPoint(i, 3.0, x, y, z))
    {
       SendClientMessage(playerid, grey, "blablabla");
       SendClientMessage(i, grey, "blablabla2");
    }
}
}
//note, this code doesn't use px, py and pz. Don't know why you created them, but there you go.


Re: SendClientMessage - Sascha - 01.05.2010

ty..I created it because I got some more steps in it and i also need the pos of the player in the range later