Loop ends up with Spamming.
#1

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;
}
Reply


Messages In This Thread
Loop ends up with Spamming. - by shitbird - 13.05.2009, 16:55
Re: Loop ends up with Spamming. - by dice7 - 13.05.2009, 18:18
Re: Loop ends up with Spamming. - by Donny_k - 13.05.2009, 18:19
Re: Loop ends up with Spamming. - by Think - 13.05.2009, 18:27
Re: Loop ends up with Spamming. - by Weirdosport - 13.05.2009, 18:31

Forum Jump:


Users browsing this thread: 1 Guest(s)