13.05.2009, 16:55
Allright, so i'm trying to do a decent /report command using DCMD + sscanf... apparently it is working, however it doesnt stop looping, and if it doesnt stop looping, it spams the IRC channel we are using to ECHO in, can someone try to explain to me, why it is bugging...
pawn Код:
dcmd_report(playerid, params[])
{
new id, pName[MAX_PLAYER_NAME], iName[MAX_PLAYER_NAME], string[128], reason[128];
if (sscanf(params, "us", id,reason)) SendClientMessage(playerid, COLOR_RED, "Usage: \"/report <playerid> <reason>\"");
else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_RED, "Player not found");
else
{
GetPlayerName(playerid, pName,sizeof(pName));
GetPlayerName(id, iName,sizeof(iName));
format(string,sizeof(string),"%s[%d] Reported %s[%d] For: '%s'",pName,playerid,iName,id,reason);
for(new i; i <MAX_PLAYERS; i++)
if(AdminLevel[i] >= 0)
{
SendClientMessage(i,COLOR_PURPLE,string);
ircSay(EchoConnection, EchoChan,string);
}
return 1;
}
return 1;
}