Really confused how to do this..... REP
#7

pawn Код:
CMD:adminduty(playerid, params[])
{
    if(PlayerData[ID][AdminLevel] == 0) return SendClientMessage(playerid, COLOR_RED, "You have to be level 1 to use this command!"); //if he isn't allowed to use this command, send him this message
    if(AdminDuty[playerid]) //if they are already in admin duty
    {
        AdminDuty[playerid] = false; //Set the AdminDuty variable to false
        SetPlayerHealth(playerid, 100.0);
        SetPlayerArmour(playerid, 0.0);
        SetPlayerColor(playerid, 0xFFFFFFFF); //Set their color to white
        SetPVarInt(playerid, "AD_Skin", GetPlayerSkin(playerid));
        SendClientMessage(playerid, -1, "Admin duty set {FF0000}OFF!"); //Inform them about the duty change
    }
    else //If they are not on admin duty
    {
        AdminDuty[playerid] = true; //Set the AdminDuty variable to true
        SetPlayerHealth(playerid, 99999.0);
        SetPlayerArmour(playerid, 99999.0);
        SetPlayerSkin(playerid, GetPVarInt(playerid, "AD_Skin"));
        DeletePVar(playerid, "AD_Skin");
        SetPlayerColor(playerid, 0xFF0000FF); //Set their color to red
        SendClientMessage(playerid, -1, "Admin duty set {00FF00}ON!"); //Inform them about the duty change
    }
    return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)