31.07.2010, 18:46
pawn Код:
CMD:w(playerid, cmdtext[])
{
new string[128];
if(strlen(cmdtext) <= 3)
{
SendClientMessage(playerid, RED,"USAGE: /w (msg)");
return 1;
}
new output[150];
new pname[24];
GetPlayerName(playerid, pname, 24);
strmid(output,cmdtext,2,strlen(cmdtext));
format(string, sizeof(string), "(WHISPER): %s [%d] %s",pname,playerid,output);
printf("%s", string);
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i) && GetDistanceBetweenPlayers(playerid,i) < 20)
{
format(string, sizeof(string), "(WHISPER): %s [%d] %s",pname,playerid,output);
SendClientMessage(i, YELLOW,string);
}
}
return 1;
}