SA-MP Forums Archive
Skin help - 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: Skin help (/showthread.php?tid=238055)



Skin help - tanush - 11.03.2011

im trying to make an /oskin so if u use it, first time your skin will be 114 then 115, 116 after 114.
but when i do /oskin it changes to skin 116 please help JAtoch. i wanna add 3skins on /oskin
pawn Код:
COMMAND:oskin(playerid, params[])
{
    if(gTeam[playerid] == 1)
    if(!GetPVarInt(playerid,"pSkinned"))
    {
        SetPlayerSkin(playerid, 114);
        SetPVarInt(playerid,"pSkinned",2);
        SendClientMessage(playerid,green,"You had changed your SKIN!");
    }
    else
    {
        SetPlayerSkin(playerid,115);
        SetPVarInt(playerid,"pSkinned",1);
        SendClientMessage(playerid,green,"You had changed your SKIN!");
    }
    else
    {
        SetPlayerSkin(playerid,116);
        SetPVarInt(playerid,"pSkinned",0);
        SendClientMessage(playerid,green,"You had changed your SKIN!");
    }
    return 1;
}



AW: Skin help - Nero_3D - 11.03.2011

Quote:
Originally Posted by tanush
Посмотреть сообщение
im trying to make an /oskin so if u use it, first time your skin will be 114 then 115, 116 after 114.
but when i do /oskin it changes to skin 116 please help JAtoch. i wanna add 3skins on /oskin
pawn Код:
COMMAND:oskin(playerid, params[])
{
    if(gTeam[playerid] == 1)
    if(!GetPVarInt(playerid,"pSkinned"))
    {
        SetPlayerSkin(playerid, 114);
        SetPVarInt(playerid,"pSkinned",2);
        SendClientMessage(playerid,green,"You had changed your SKIN!");
    }
    else
    {
        SetPlayerSkin(playerid,115);
        SetPVarInt(playerid,"pSkinned",1);
        SendClientMessage(playerid,green,"You had changed your SKIN!");
    }
    else
    {
        SetPlayerSkin(playerid,116);
        SetPVarInt(playerid,"pSkinned",0);
        SendClientMessage(playerid,green,"You had changed your SKIN!");
    }
    return 1;
}
Than you werent in team 1, I think the compiler interpreted it so
pawn Код:
if(gTeam[playerid] == 1)
{
    if(!GetPVarInt(playerid,"pSkinned"))
    {
    }
    else
    {
    }
}
else
{
}
just use brackets to avoid such mistakes

pawn Код:
COMMAND:oskin(playerid, params[])
{
    #pragma unused params
    if(gTeam[playerid] == 1)
    {
        switch(GetPlayerSkin(playerid))
        {
            case 114:   SetPlayerSkin(playerid, 115);
            case 115:   SetPlayerSkin(playerid, 116);
            default:    SetPlayerSkin(playerid, 114);
        }
        SendClientMessage(playerid, green, "You had changed your SKIN!");
    }
    return true;
}



Re: Skin help - tanush - 11.03.2011

nothing happens when i do /oskin...
EDIT:its alright cause i used GetPlayerSkin and fixed it
pawn Код:
if(GetPlayerSkin(playerid) == 114)
    {
        SetPlayerSkin(playerid,115);
        SendClientMessage(playerid,green,"You had changed your skin!");
    }
    else
    if(GetPlayerSkin(playerid) == 115)
    {
        SetPlayerSkin(playerid,116);
        SendClientMessage(playerid,green,"You had changed your skin!");
    }
    else
    if(GetPlayerSkin(playerid) == 116)
    {
        SetPlayerSkin(playerid,114);
        SendClientMessage(playerid,green,"You had changed your skin!");
    }



Re: AW: Skin help - Unknown123 - 11.03.2011

nvm, Didnt read the thread, Sorry *Deleted*