How to make this work properly
#6

Make a new variable at the top:
pawn Код:
new LastSkin[MAX_PLAYERS];
And copy this code to your command:
pawn Код:
CMD:aduty(playerid, params[]) {
    new string[128];
    if((PlayerInfo[playerid][pAdmin] >= 2) && GetPVarInt(playerid, "IsInArena") < 0 && !GetPVarInt(playerid, "EventToken")) {
        if(PlayerInfo[playerid][pAdminDuty]) {
            PlayerInfo[playerid][pAdminDuty] = 0;
            PlayerInfo[playerid][pTogReports] = 1;
            //SetPlayerToTeamColor(playerid);
            SendClientMessageEx(playerid, COLOR_WHITE, "You have clocked out from Admin Duty, you are now in Role Play Mode.");
            format(string, sizeof(string), "{AA3333}Admin Duty{FFFF00}: %s has clocked off and is now off duty.", GetPlayerNameEx(playerid));
            LastSkin[playerid] = GetPlayerSkin(playerid);
            SetPlayerSkin(playerid, 294);
            ABroadCast(COLOR_YELLOW,string, 2);
            SetPlayerHealth(playerid, 100);
            SetPlayerArmour(playerid, 100);
            SetPlayerColor(playerid, COLOR_WHITE);
            new string[128];
            format(string, sizeof(string), "{FFFFFF}Administrator %s is {FF0000}[OFF] {FFFFFF}admin duty, Do not report for this admin allow him/her to role-play", GetPlayerNameEx(playerid));
            SendClientMessageToAllEx(COLOR_WHITE, string);
        }
        else {
            PlayerInfo[playerid][pAdminDuty] = 1;
            PlayerInfo[playerid][pTogReports] = 0;
            //SetPlayerToTeamColor(playerid);
            SendClientMessageEx(playerid, COLOR_WHITE, "You have clocked in to Admin Duty, you are no longer in Role play Mode.");
            format(string, sizeof(string), "{AA3333}Admin Duty{FFFF00}: %s has clocked in and is now on duty.", GetPlayerNameEx(playerid));
            ABroadCast(COLOR_YELLOW,string, 2);
            SetPlayerHealth(playerid, 100000);
            SetPlayerArmour(playerid, 100000);
            SetPlayerColor(playerid, COLOR_BLACK);
            SetPlayerSkin(playerid, LastSkin[playerid]);
            new string[128];
            format(string, sizeof(string), "{FFFFFF}Administrator %s is {25FF00}[ON] {FFFFFF}admin duty, he/she is now accepting /reports.", GetPlayerNameEx(playerid));
            SendClientMessageToAllEx(COLOR_WHITE, string);
        }
    }
    return 1;
}
Reply


Messages In This Thread
How to make this work properly - by NinjaChicken - 17.12.2012, 09:33
Re: How to make this work properly - by Devilxz97 - 17.12.2012, 09:40
Re: How to make this work properly - by Djole1337 - 17.12.2012, 09:45
Re: How to make this work properly - by NinjaChicken - 17.12.2012, 09:49
Re: How to make this work properly - by Devilxz97 - 17.12.2012, 09:53
Re: How to make this work properly - by YoYo123 - 17.12.2012, 10:40

Forum Jump:


Users browsing this thread: 1 Guest(s)