17.01.2012, 01:17
As I do not have your color codes, I cannot compile; but other than that, every thing seems to be in working order. Oh, and I made your command faster by destroying the need for a whole different function..
pawn Код:
CMD:whisper(playerid, params[])
{
new
TextSent[128],
Float:P[3],
p_Name[MAX_PLAYER_NAME]
;
if(sscanf(params, "s[128]", TextSent)) //Did they type the correct syntax? If not, this is called.
return SendClientMessage(playerid,COLOR_LIGHTBLUE,"USAGE: {FFFFFF}/w [message]");
//Correct syntax below.
GetPlayerPos(playerid, P[0], P[1], P[2]);
GetPlayerName(playerid, p_Name, 24);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(i, 10, P[0], P[1], P[2]))
{
new
whisstring[128]
;
SetPlayerChatBubble(playerid, params, COLOR_ORANGE, 10.0, 10000);
format(whisstring, sizeof(whisstring), "%s whispered: %s", p_Name, TextSent);
SendClientMessage(i, COLOR_ORANGE, whisstring);
return 1;
}
else return SendClientMessage(playerid, COLOR_SILVER, "You are to far from that person.");
}
return 1;
}