23.03.2014, 03:54
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(w,1,cmdtext)
return 0;
}
dcmd_w(playerid,params[])
{
new Pname[28];
GetPlayerName(playerid,Pname,sizeof(Pname));
new string[128];
if(!strlen(params))
{
SendClientMessage(playerid,COLOR_ERROR,"USAGE: /w (msg)");
return 1;
}
format(string, sizeof(string), "[WHISPER] %s(%d): %s",Pname(playerid),playerid,params);
printf("%s", string);
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i) && GetDistanceBetweenPlayers(playerid,i) < 10)
{
format(string, sizeof(string), "[WHISPER] %s(%d): %s",Pname(playerid),playerid,params);
SendClientMessage(i,COLOR_YELLOW,string);
}
}
return 1;
}