How can i make my server remember the skin REP
#2

pawn Код:
new gAdminSkin[MAX_PLAYERS]; // add at top of script, and remember when the player disconnects set this to 0.

CMD:adminduty(playerid, params[])
{
    if(PlayerData[ID][AdminLevel] >= 1)
    {
        if(AdminDuty[playerid])
        {
            AdminDuty[playerid] = false;
            SetPlayerHealth(playerid,100);
            SetPlayerArmour(playerid,0);
            SetPlayerColor(playerid, 0xFFFFFFFF);
            SetPlayerSkin(playerid, gAdminSkin[playerid]); // sets the old skin back
            gAdminSkin[playerid] = 0; // clears the old skin variable(need to have this)
            SendClientMessage(playerid, -1, "Admin duty set {FF0000}OFF!");
        }
        else
        {
            AdminDuty[playerid] = true;
            SetPlayerHealth(playerid,99999);
            SetPlayerArmour(playerid,99999);
            SetPlayerSkin(playerid,82);
            SetPlayerColor(playerid, 0xFF0000FF);
            gAdminSkin[playerid] = GetPlayerSkin(playerid); // stores the skin id in the variable so you can use it later on.
            SendClientMessage(playerid, -1, "Admin duty set {00FF00}ON!");
        }
    }
    else 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
    return 1;
}
Note: This will not save the players old skin if they disconnect while under admin duty.
Reply


Messages In This Thread
How can i make my server remember the skin REP - by Scripter12345 - 04.04.2012, 00:45
Re: How can i make my server remember the skin REP - by Steven82 - 04.04.2012, 00:53
Re: How can i make my server remember the skin REP - by Scripter12345 - 04.04.2012, 00:59
Re: How can i make my server remember the skin REP - by Steven82 - 04.04.2012, 01:20

Forum Jump:


Users browsing this thread: 1 Guest(s)