21.01.2010, 21:59
Hi,
I was given this code for Megaphone,
And well, Its not working right :P
It just spams this on my chatbox,
Officer [Torran]: !
On every line of my chatbox,
How to fix,
I was given this code for Megaphone,
And well, Its not working right :P
pawn Код:
dcmd_megaphone(playerid, params[])
{
new
string[128],
message[104];
if(sscanf(params, "s", message))
{
SendClientMessage(playerid, COLOR_RED, "Usage: /megaphone [message]");
}
else if(GetPlayerTeam(playerid) == TEAM_POLICESF) return SendClientMessage(playerid, COLOR_RED, "You are not a Cop");
{
format(string, sizeof(string), "Officer [%s]: %s!", GetPlayerNameEx(playerid), message);
SendClientMessage(playerid, COLOR_YELLOW, string);
for(new i = 0; i < MAX_PLAYERS; i++)
{
while(GetDistanceBetweenPlayers(playerid, i) < 7.0)
{
SendClientMessage(i, COLOR_YELLOW, string);
}
}
}
return 1;
}
Officer [Torran]: !
On every line of my chatbox,
How to fix,