Reset Skin
#1

is there a way to reset a players skin?? i need it for this admin cmd

pawn Код:
dcmd_duty(playerid,params[]) {
    #pragma unused params
    if(PlayerInfo[playerid][Level] >= 2 || IsPlayerAdmin(playerid)) {
        if(PlayerInfo[playerid][Duty] == 0) {
            PlayerInfo[playerid][Duty] = 1;
            SetPlayerHealth(playerid,1000000000);
            GivePlayerWeapon(playerid,38,50000);
            GivePlayerWeapon(playerid,35,5000);
            SetPlayerSkin(playerid,269);
            SendClientMessage(playerid,green,"On Admin Duty");
            return CMDMessageToAdmins(playerid,"DUTY");
        } else {
            PlayerInfo[playerid][Duty] = 0;
            SendClientMessage(playerid,red,"Off Admin Duty");
            SetPlayerHealth(playerid, 100);
                //Here is where i want it to "resetplayerskin"
        } return ResetPlayerWeapons(playerid), GivePlayerWeapon(playerid,32,5000), GivePlayerWeapon(playerid,31,5000);
    } else return SendClientMessage(playerid,red,"ERROR: You need to be level 2 to use this command");
}
i want skin to reset back to the regular skin that is chosen OnPlayerClassSelection
Reply
#2

Save the chosen skin to a file and when you want it changing back, set the skin from the file.
Reply
#3

EDIT: I tested that and failed how to save it into file?
Reply
#4

Use dini, it's not hard. GetPlayerSkin(); when they spawn and save it.

Or this could be easier, skin saving would be more helpful if you wanted to load the same skin every time you play.
pawn Код:
new Skin;

public OnPlayerRequestSpawn(playerid)
{
     GetPlayerSkin(Skin);
     return 1;
}
Then in you DCMD command
pawn Код:
SetPlayerSkin(Skin);
Reply
#5

teheh tanks^^
Reply
#6

Sorry change it to OnPlayerRequestSpawn instead of OnPlayerSpawn, because if they die with the new skin it would think the old skin is the new one. Get what I mean?
Reply
#7

lol oh that helped xD && i realized that SpawnPlayer(playerid); could work to lol
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)