Posts: 1,029
Threads: 96
Joined: May 2010
Reputation:
0
Hello guys. Please help me making a Whisper command like /w [Message]
The command should make like when you write /w and a message , the message to be showed only to near players.
Just too lazy to /pm...
Posts: 2,938
Threads: 162
Joined: May 2010
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;
}
Posts: 1,478
Threads: 17
Joined: Oct 2007
Reputation:
0
Nice copy&paste, too bad it will only work for you, Kar.
Posts: 2,938
Threads: 162
Joined: May 2010