Only ID 1 + can use ban..
#9

Now I know why !
You have a bad order of code, the "playerid == TargetID" check is actually done before sscanf, so it is always 0, as newly created variables will always be set to 0 by default.
Therefore the check is like "if playerid (which is 0, because only you are in the test server) is equal to 0"
Bottom line, use this order:
pawn Код:
if (sscanf(params, "uz", TargetID, reason) != 0)
    {
        SendClientMessage(playerid, COLOR_WHITE, "Usage: /ban (id/name) [reason]");
        return 1;
    }
    if(playerid == TargetID)
    {
        SendClientMessage(playerid, COLOR_RED, "ERROR: You cannot ban yourself.");
        return 1;
    }
Reply


Messages In This Thread
Only ID 1 + can use ban.. - by _Vortex - 16.09.2009, 02:21
Re: Only ID 1 + can use ban.. - by Clavius - 16.09.2009, 13:15
Re: Only ID 1 + can use ban.. - by _Vortex - 16.09.2009, 16:39
Re: Only ID 1 + can use ban.. - by Clavius - 16.09.2009, 16:50
Re: Only ID 1 + can use ban.. - by _Vortex - 16.09.2009, 17:11
Re: Only ID 1 + can use ban.. - by Clavius - 16.09.2009, 17:17
Re: Only ID 1 + can use ban.. - by _Vortex - 16.09.2009, 17:20
Re: Only ID 1 + can use ban.. - by _Vortex - 16.09.2009, 17:49
Re: Only ID 1 + can use ban.. - by Clavius - 16.09.2009, 18:23
Re: Only ID 1 + can use ban.. - by _Vortex - 16.09.2009, 20:42

Forum Jump:


Users browsing this thread: 1 Guest(s)