16.09.2009, 18:23
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:
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;
}