16.01.2012, 20:26
When i'm away from anybody it gives me 2 msg's, 1 with the params and one with You are to ..etc?
Any ideas why?
Any ideas why?
PHP код:
CMD:w(playerid, params[])
{
new Float:x, Float:y, Float:z, Float: x1, Float: y1, Float: z1, Float: dist, i, ok = 0;
if(sscanf(params,"u",mystring)) return SendClientMessage(playerid,COLOR_LIGHTBLUE,"USAGE: {FFFFFF}/w [message]");
GetPlayerPos(playerid, x, y, z);
for( i = 0; i < MAX_PLAYERS; i++)
{
GetPlayerPos(i, x1, y1, z1);
dist = floatsqroot((x-x1)*(x-x1) + (y-y1)*(y-y1) + (z-z1)*(z-z1));
if(dist <= 10.0)
{
GetPlayerName(playerid, pname, sizeof(pname));
format(mystring, sizeof(mystring),"%s whispred: %s", pname, params);
SetPlayerChatBubble(playerid, params, COLOR_ORANGE, 10.0, 10000);
SendClientMessage(i ,COLOR_ORANGE, mystring);
if(i != playerid)
{
ok = 1;
}
}
}
if(ok == 0)
{
SendClientMessage(playerid ,COLOR_ORANGE, "You are to for from anybody");
}
return 1;
}