Really confused how to do this..... REP
#1

I have made it so when you do /adminduty your skin changes and what im trying to do is when you do /adminduty again to go off duty i want my skin to go back to what it was before i went on duty


I have tried but this is not working


Код:
CMD:skin(playerid, params[])
{
	PlayerInfo[playerid][pSkin] = 1;
    SetPlayerSkin(playerid, 3);
	SendClientMessage(playerid, COLOR_GOLD, "Skin changed");
	return 1;
}
Код:
CMD:adminduty(playerid, params[])
{
    if(PlayerData[ID][AdminLevel] >= 1)
    {
        if(AdminDuty[playerid]) //if they are already in admin duty
        {
            AdminDuty[playerid] = false; //Set the AdminDuty variable to false
            SetPlayerHealth(playerid,100);
        	SetPlayerArmour(playerid,0);
            SetPlayerColor(playerid, 0xFFFFFFFF); //Set their color to white
            GetPlayerSkin(playerid);
            SendClientMessage(playerid, -1, "Admin duty set {FF0000}OFF!"); //Inform them about the duty change
        }
        else //If they are not on admin duty
        {
            AdminDuty[playerid] = true; //Set the AdminDuty variable to true
            SetPlayerHealth(playerid,99999);
        	SetPlayerArmour(playerid,99999);
        	SetPlayerSkin(playerid,82);
            SetPlayerColor(playerid, 0xFF0000FF); //Set their color to red
            SendClientMessage(playerid, -1, "Admin duty set {00FF00}ON!"); //Inform them about the duty change
        }
    }
    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;
}
Please Help Please
Reply
#2

put this when player is on duty code
remove that GetPlayerSkin and replace with this

pawn Код:
new OldSkin = GetPlayerSkin(playerid);
then on player off duty put this

pawn Код:
SetPlayerSkin(playerid, OldSkin);
Reply
#3

Quote:
Originally Posted by Reklez
Посмотреть сообщение
put this when player is on duty code
remove that GetPlayerSkin and replace with this

pawn Код:
new OldSkin = GetPlayerSkin(playerid);
then on player off duty put this

pawn Код:
SetPlayerSkin(playerid, OldSkin);
I put that in and it still dont work


May you please try and put it in please


Please Help Please
Reply
#4

first off all i'm getting crazy on your code so i make it simple

pawn Код:
CMD:adminduty(playerid, params[])
{
    if(PlayerData[ID][AdminLevel] >= 1)
    {
        if(AdminDuty[playerid] == 0) //if admin is off duty
        {
            AdminDuty[playerid] = 1;
            SetPlayerHealth(playerid,99999);
            SetPlayerArmour(playerid,99999);
            new OldSkin = GetPlayerSkin(playerid);
            SetPlayerSkin(playerid,82);
            SetPlayerColor(playerid, 0xFF0000FF);
            SendClientMessage(playerid, -1, "Admin duty set {00FF00}ON!");
        }
        else if(AdminDuty[playerid] == 1) //if admin is on duty
        {
            AdminDuty[playerid] = 0;
            SetPlayerHealth(playerid,100);
            SetPlayerArmour(playerid,0);
            SetPlayerColor(playerid, 0xFFFFFFFF);
            SetPlayerSkin(playerid, OldSkin);
            SendClientMessage(playerid, -1, "Admin duty set {FF0000}OFF!");
        }
    }
    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;
}
Reply
#5

Quote:
Originally Posted by Reklez
Посмотреть сообщение
first off all i'm getting crazy on your code so i make it simple

pawn Код:
CMD:adminduty(playerid, params[])
{
    if(PlayerData[ID][AdminLevel] >= 1)
    {
        if(AdminDuty[playerid] == 0) //if admin is off duty
        {
            AdminDuty[playerid] = 1;
            SetPlayerHealth(playerid,99999);
            SetPlayerArmour(playerid,99999);
            new OldSkin = GetPlayerSkin(playerid);
            SetPlayerSkin(playerid,82);
            SetPlayerColor(playerid, 0xFF0000FF);
            SendClientMessage(playerid, -1, "Admin duty set {00FF00}ON!");
        }
        else if(AdminDuty[playerid] == 1) //if admin is on duty
        {
            AdminDuty[playerid] = 0;
            SetPlayerHealth(playerid,100);
            SetPlayerArmour(playerid,0);
            SetPlayerColor(playerid, 0xFFFFFFFF);
            SetPlayerSkin(playerid, OldSkin);
            SendClientMessage(playerid, -1, "Admin duty set {FF0000}OFF!");
        }
    }
    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;
}
Now im getting this error


Код:
error 017: undefined symbol "OldSkin"
On this line


Код:
SetPlayerSkin(playerid, OldSkin);
Please Help Please
Reply
#6

pawn Код:
SetPVarInt(playerid, "OldSkin", GetPlayerSkin(playerid)); //replace new OldSkin with this
then put on the code where admin duty sets off

pawn Код:
SetPlayerSkin(playerid, GetPVarInt(playerid, "OldSkin"));
Reply
#7

pawn Код:
CMD:adminduty(playerid, params[])
{
    if(PlayerData[ID][AdminLevel] == 0) 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
    if(AdminDuty[playerid]) //if they are already in admin duty
    {
        AdminDuty[playerid] = false; //Set the AdminDuty variable to false
        SetPlayerHealth(playerid, 100.0);
        SetPlayerArmour(playerid, 0.0);
        SetPlayerColor(playerid, 0xFFFFFFFF); //Set their color to white
        SetPVarInt(playerid, "AD_Skin", GetPlayerSkin(playerid));
        SendClientMessage(playerid, -1, "Admin duty set {FF0000}OFF!"); //Inform them about the duty change
    }
    else //If they are not on admin duty
    {
        AdminDuty[playerid] = true; //Set the AdminDuty variable to true
        SetPlayerHealth(playerid, 99999.0);
        SetPlayerArmour(playerid, 99999.0);
        SetPlayerSkin(playerid, GetPVarInt(playerid, "AD_Skin"));
        DeletePVar(playerid, "AD_Skin");
        SetPlayerColor(playerid, 0xFF0000FF); //Set their color to red
        SendClientMessage(playerid, -1, "Admin duty set {00FF00}ON!"); //Inform them about the duty change
    }
    return 1;
}
Reply
#8

It still does not work is there any other bit of code you need to see ?
Reply
#9

DUDE, seriously. I gave you the code for this and the topic got deleted i think?

And now these guys are giving you correctly working code, and your still getting errors. Time to quit copying and pasting and learning how to script/fix errors.
Reply
#10

Quote:
Originally Posted by Steven82
Посмотреть сообщение
DUDE, seriously. I gave you the code for this and the topic got deleted i think?

And now these guys are giving you correctly working code, and your still getting errors. Time to quit copying and pasting and learning how to script/fix errors.
Or maybe im learning scripting and im asking for help and maybe you need to stop flaming.


Im learning now get off.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)