[HELP] skin question
#1

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
Reply
#2

I'm struggling to understand the situation here..

So you want it to set the playerskin BACK to 23, after doing the command /pizzaoffduty?
Reply
#3

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;
}
Reply
#4

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
Reply
#5

That would probably be a fault on your end under OnPlayerSpawn or something. That doesn't have anything to do with this code.
Reply
#6

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)