30.03.2009, 12:30
pawn Код:
if(!strcmp(cmdtext, "/b", true))
{
for(new i=0; i<MAX_PLAYERS; i++) //Gettting all players in the variable i
{
if(GetDistanceBetweenPlayers(playerid, i) <= 20) //Correct me if there are more arguments in Getdistance...
{
if(cmdtext[2] == 32 || cmdtext[3] != EOS) //if there is a space and end of string isn't right after the space
{
new str[128];
format(str, 128, "%s: %s", Name(playerid), cmdtext[3]);
SendClientMessage(i, COLOR_WHITE, str); //Send message to all players nearby
}
}
}
return true;
}
pawn Код:
//place this on bottom of script
Name(i)
{
new n[24];
GetPlayerName(i, n, 24);
return n;
}