/aduty command
#1

Guys i am using the PRP GM, and i'v added a new /aduty command
it works. But the only problem is that, when i go on duty it changes to the skin i told it to change.
when i go off duty, it keeps the skin that on duty admin has, but i want it to return to the skin
that the player had BEFORE going on duty. here's the code
PHP код:
if(strcmp(cmd"/aduty"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            new 
msgstring[150];
            if(
PlayerInfo[playerid][pAdmin] > && PlayerInfo[playerid][pAdminDuty] == 0)
            {
                
format(PlayerInfo[playerid][pNormalName], 255"%s"GetName(playerid));
                
//SetPlayerName(playerid, PlayerInfo[playerid][pAdminName]);
                
format(msgstringsizeof(string), "{01A601}** Administrator %s is now on admin duty. (/askq for assistance) **",sendername);
                
SendClientMessageToAll(COLOR_WHITEmsgstring);
                
SetPlayerSkin(playerid240);
                
PlayerInfo[playerid][pAdminDuty] = 1;
                
SetPlayerHealth(playerid9999);
                
SetPlayerArmour(playerid9999);
                
            }
            else if(
PlayerInfo[playerid][pAdmin] > && PlayerInfo[playerid][pAdminDuty] != 0)
            {
                
format(msgstringsizeof(string), "{FF0000}** Administrator %s is now off admin duty. **",sendername);
                
SendClientMessageToAll(COLOR_WHITEmsgstring);
                
//SetPlayerName(playerid, PlayerInfo[playerid][pNormalName]);
                
SetPlayerHealth(playerid100);
                
SetPlayerArmour(playerid0);
                
PlayerInfo[playerid][pAdminDuty] = 0;
            }
        }
        return 
1;
    } 
Reply
#2

pawn Код:
if(strcmp(cmd, "/aduty", true) == 0)
    {
        if(PlayerInfo[playerid][pAdmin] > 0)
        {
            new msgstring[150];
            if(PlayerInfo[playerid][pAdminDuty] == 0)
            {
                format(PlayerInfo[playerid][pNormalName], 255, "%s", GetName(playerid));
                //SetPlayerName(playerid, PlayerInfo[playerid][pAdminName]);
                format(msgstring, sizeof(string), "{01A601}** Administrator %s is now on admin duty. (/askq for assistance) **",sendername);
                SendClientMessageToAll(COLOR_WHITE, msgstring);
                SetPVarInt(playerid, "LastSkin", GetPlayerSkin(playerid));
                SetPlayerSkin(playerid, 240);
                PlayerInfo[playerid][pAdminDuty] = 1;
                SetPlayerHealth(playerid, 9999);
                SetPlayerArmour(playerid, 9999);
               
            }
            else
            {
                format(msgstring, sizeof(string), "{FF0000}** Administrator %s is now off admin duty. **",sendername);
                SendClientMessageToAll(COLOR_WHITE, msgstring);
                //SetPlayerName(playerid, PlayerInfo[playerid][pNormalName]);
                SetPlayerSkin(playerid, GetPVarInt(playerid, "LastSkin"));
                SetPlayerHealth(playerid, 100);
                SetPlayerArmour(playerid, 0);
                PlayerInfo[playerid][pAdminDuty] = 0;
            }
        }
        return 1;
    }
Reply
#3

Thanks a lot dude!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)