[Tutorial] How to make [Jail/unjail] admin commands with ZCMD+SSCANF
#2

That's nice man. and only for rcon admins ? so how about this ?
pawn Код:
if(IsPlayerAdmin(playerid)) == 2)
new isplayeradmin [MAX_PLAYERS] // you'll need this too
And in your last FULL CODE you missed " (playerid) " on isplayeradmin and this will be the write one
pawn Код:
CMD:unjail(playerid,params[]) {
    new id;
     if(IsPlayerAdmin(playerid)) // some fixed :
        if(sscanf(params,"d",id)) return SendClientMessage(playerid, lb, "USAGE: /unjail <playerid>");//sscanf routine
        if (!IsPlayerConnected(id)) return SendClientMessage(playerid, red, "ERROR: Player is not connected.");//checks if the targetid is connected
        if(Jailed[id] == 0) return SendClientMessage(playerid, red, "ERROR: Player is not jailed.");//checks if the id is jailed and if he isnt it will send an error.
                Jailed[id] = 0);// you had missed ) here .
        SetPlayerInterior(id, 0);//normal int
        SetPlayerVirtualWorld(id, 0);//normal vw
        SpawnPlayer(id);//respawns player
        SetPlayerHealth(id, 100);//sets his health back as 100
        KillTimer(JailTimer[id]);//kills the timer
    }
    else {
        return 0;// sends: Server:Unknown Command.
    }
    return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)