/kick problem
#2

Here's your actual issue, my friend:
pawn Код:
error 003: declaration of a local variable must appear in a compound block
To declare a local variable, the previous if statement has to form a compound block: that means, the following code should be put between brackets: { and }.

Change your code so that it looks like this:
pawn Код:
CMD:kick(playerid, params[])
{
    if (GetPVarInt(playerid, "Level") < 2 )
    {
        new PlayerID[MAX_PLAYER_NAME], reason[64], str[128];
        new PlayerName[MAX_PLAYER_NAME], AdminName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, AdminName, sizeof(AdminName));
        GetPlayerName(PlayerID, PlayerName, sizeof(PlayerName));
        if(sscanf(params, "us[64]", PID,reason)) return SendClientMessage(playerid, COLOR_IRAQ, "USAGE: {FFFFFF}/kick [PlayerID] [Reason]");
        if(!IsPlayerConnected(PID)) return SendClientMessage(playerid, COLOR_RED, "ERROR: {ffffff}Invalid player ID.");
        format(str, sizeof(str), "%s has been kicked by %s for %s", PlayerName, AdminName, reason);
        SendClientMessageToAll(COLOR_RED, str);
        Kick(playerid);
    }
    return 1;
}
Reply


Messages In This Thread
/kick problem - by MrBorsh - 14.09.2012, 20:16
Re: /kick problem - by Silvarray - 14.09.2012, 20:24
Re: /kick problem - by RLGaming - 14.09.2012, 20:25
Re: /kick problem - by MrBorsh - 14.09.2012, 20:56

Forum Jump:


Users browsing this thread: 2 Guest(s)