Skin help
#1

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

Код:
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.
Reply
#3

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

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

Go here
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)