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)
+--- Thread: Skin help (/showthread.php?tid=349622)



Skin help - MarinacMrcina - 09.06.2012

Hi,i made a registering system and when you get a randomed skin depending what gender you select.

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case DIALOG_REGISTER:
        {
            if(response)
            {
                new rand = random(sizeof(MaleSkins));
                SetPlayerSkin(playerid, MaleSkins[rand]);
            }
            else
            {
                new rand = random(sizeof(FemaleSkins));
                SetPlayerSkin(playerid, FemaleSkins[rand]);
            }
        }
    }
    return 1;
}
Now i have this problem when a player spaws he always has the CJ skin.Maybe it is because of this public
pawn Код:
OnPlayerRequestClass(playerid, classid)
{
    TogglePlayerSpectating(playerid, 0);
    SetSpawnInfo( playerid, 0, 0, 1649.8920,-2286.4458,-1.2098,180.2326, 26, 36, 28, 150, 0, 0 );
    SpawnPlayer(playerid);
    return 1;
}
Can someone help me with this or give me and example how to save or load player skins?


Re: Skin help - Vince - 09.06.2012

Код:
native SetSpawnInfo(playerid, team, skin, Float:x, Float:y, Float:z, Float:Angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
SetSpawnInfo effectively overrides SetPlayerSkin.


Re: Skin help - Niko_boy - 09.06.2012

SetSpawnInfo( playerid, 0, 0, 1649.8920,-2286.4458,-1.2098,180.2326, 26, 36, 28, 150, 0, 0 );
since it Set his spawninfo as CJ skin
so,
SetSkin at onplayerspawn too
by setting then checking variable
like pSex[playerid] = MALE // or female


Re: Skin help - MarinacMrcina - 09.06.2012

Quote:
Originally Posted by Niko_boy
Посмотреть сообщение
SetSpawnInfo( playerid, 0, 0, 1649.8920,-2286.4458,-1.2098,180.2326, 26, 36, 28, 150, 0, 0 );
since it Set his spawninfo as CJ skin
so,
SetSkin at onplayerspawn too
by setting then checking variable
like pSex[playerid] = MALE // or female
Then i would use this on OnPlayerRequestClass

pawn Код:
if(PlayerInfo[playerid][Gender]==0)
        {
            new rand = random(sizeof(MaleSkin));
            SetPlayerSkin(playerid, MaleSkin[rand]);

        }
        else
        {
            new rand = random(sizeof(FemaleSkin));
            SetPlayerSkin(playerid, FemaleSkin[rand]);
        }
BUT that would only random a skin when a player connects and thats not what i need. I need to save the skin that player randomed when he selected his gender and then load it when he connects.


Re: Skin help - Faisal_khan - 09.06.2012

Go here