[HELP] skin question - 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)
+--- Thread: [HELP] skin question (
/showthread.php?tid=552410)
[HELP] skin question -
Luca12 - 24.12.2014
Hello everyone I have job pizza deliver boy and for that job I have command /pizzaduty where player get skin 155 which is pizza boy skin if you know what I mean. Know how can I make when player type pizzaoffduty that he get previous skin before he types /pizzaduty if you know what I want to say.
Example I have skin 23 and I type pizzaduty I get pizza skin which is id 155 wright, know I type pizzaofduty and know here how can I get back skin id 23 ? Thanks
Re: [HELP] skin question -
Cookland - 24.12.2014
I'm struggling to understand the situation here..
So you want it to set the playerskin BACK to 23, after doing the command /pizzaoffduty?
Re: [HELP] skin question -
Threshold - 24.12.2014
pawn Code:
new PreviousSkin[MAX_PLAYERS]; //At the top of your script. Used to save the Skin ID.
CMD:pizzaduty(playerid, params[]) //When a player types "/pizzaduty"
{
if(/*PlayerOnPizzaDuty*/) return SendClientMessage(playerid, -1, "You are already on duty");
//Make sure you check to see whether the person is on duty or not. 'if(GetPlayerSkin(playerid) == 155)' perhaps?
PreviousSkin[playerid] = GetPlayerSkin(playerid); //Saves the player's skin ID to the variable 'PreviousSkin'.
//Something here...
SetPlayerSkin(playerid, 155); //They are now on duty.
return 1;
}
CMD:pizzaoffduty(playerid, params[]) //When a player types "/pizzaoffduty"
{
if(/*PlayerIsNotOnDuty*/) return SendClientMessage(playerid, -1, "You are not on duty");
//'if(GetPlayerSkin(playerid) != 155)' would also work.
SetPlayerSkin(playerid, PreviousSkin[playerid]); //Set the player's skin to the ID saved in 'PreviousSkin'.
return 1;
}
Re: [HELP] skin question -
Luca12 - 24.12.2014
Thanks Threshold in my server works so I get on duty skin 155 and when I type offduty I get back previous skin but the problem is when I go relog I again get pizza skin instead of skin 23? Thanks
Re: [HELP] skin question -
Threshold - 24.12.2014
That would probably be a fault on your end under OnPlayerSpawn or something. That doesn't have anything to do with this code.
Re: [HELP] skin question -
Luca12 - 24.12.2014
Like you said it was not problem with code the code is ok thanks again I fix it know it's works fine. Thanks again.