Is this command right ?
#6

Quote:
Originally Posted by antonio112
Посмотреть сообщение
pawn Код:
CMD:cpw(playerid, params[])
{
    if(pInfo[playerid][Adminlevel] <= 2)
    {
        new count = 0, str[128];
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            new Weapon = GetPlayerWeapon(i);
            new pName[MAX_PLAYER_NAME];
            if(Weapon == 16 || Weapon > 34 || Weapon < 40)
            {
                GetPlayerName(i, pName, sizeof(pName));
                format(Str, sizeof(Str), "{FF8000}>>{FFFFFF} Player {FF0000}(%s[%d]){FFFFFF} Possible Weapon Hacking", pName, playerid);
                SendClientMessage(playerid, -1, Str);
                count ++;
            }
        }
        if(count == 0) SendClientMessage(playerid, -1, "{FF8000}>>{FFFFFF} No Weapon Hackers Detected");
    }
    else return 0;
    return 1;
}
Of course your version spammed that there are no weapon hackers, since you used SendClientMessage inside the loop and for every i (500 in this case) it loops, you get no weapon hackers.
I tried it your way and it spams my screen with
Reply


Messages In This Thread
Is this command right ? - by Glint - 22.09.2012, 07:48
Re: Is this command right ? - by InfinityCOD - 22.09.2012, 07:49
Re: Is this command right ? - by antonio112 - 22.09.2012, 07:52
Re: Is this command right ? - by mobiliz - 22.09.2012, 07:53
Re: Is this command right ? - by antonio112 - 22.09.2012, 07:55
Re: Is this command right ? - by Glint - 22.09.2012, 07:59
Re: Is this command right ? - by antonio112 - 22.09.2012, 08:03
Re: Is this command right ? - by mobiliz - 22.09.2012, 08:06
Re: Is this command right ? - by Glint - 22.09.2012, 08:06

Forum Jump:


Users browsing this thread: 1 Guest(s)