Reset Skin - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Reset Skin (
/showthread.php?tid=164442)
Reset Skin -
willsuckformoney - 31.07.2010
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
Re: Reset Skin -
V1ceC1ty - 31.07.2010
Save the chosen skin to a file and when you want it changing back, set the skin from the file.
Re: Reset Skin -
willsuckformoney - 31.07.2010
EDIT: I tested that and failed how to save it into file?
Re: Reset Skin -
V1ceC1ty - 31.07.2010
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
Re: Reset Skin -
willsuckformoney - 31.07.2010
teheh tanks^^
Re: Reset Skin -
V1ceC1ty - 31.07.2010
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?
Re: Reset Skin -
willsuckformoney - 31.07.2010
lol oh that helped xD && i realized that SpawnPlayer(playerid); could work to lol