SA-MP Forums Archive
Skin beeing set to 0? - 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 beeing set to 0? (/showthread.php?tid=558768)



Skin beeing set to 0? - vassilis - 18.01.2015

NEVER SOLVED


Re: Skin beeing set to 0? - vassilis - 20.01.2015

bump i wonder if anyone could help since it still unsolved


Re: Skin beeing set to 0? - Lordzy - 20.01.2015

If your "OnAccountLoad" callback gets called under OnPlayerRequestClass, you should use SetSpawnInfo to set the player's spawn skin. Other than that, it'll be using default skins (either class skins or CJ skin if no classes are found).


Re: Skin beeing set to 0? - vassilis - 20.01.2015

Could you give me an example please?
Also why team turns from 5 to -1


Re: Skin beeing set to 0? - Lordzy - 20.01.2015

pawn Код:
public OnAccountLoad(playerid)
{
    //Your stuffs
    g_PlayerLoggedIn[playerid] = true; //You may already have something similar to this.
    return 1;
}

public OnPlayerRequestSpawn(playerid) //The callback called before player getting spawned
{
    if(g_PlayerLoggedIn[playerid])
        SetSpawnInfo(playerid, g_SavedTeam[playerid], g_SavedSkin[playerid], ...); //Set the spawn info, make sure you store the class information to use them in this function.
    return 1;
}
So when the player spawns, they'll be using the saved skin.


Re: Skin beeing set to 0? - vassilis - 20.01.2015

So I use it on playerrequestspawn or to the accountload function the setspawninfo?? I want the player to spawn automatically after the login dialog


Re: Skin beeing set to 0? - Lordzy - 20.01.2015

Well then use SetSpawnInfo before using SpawnPlayer function under your OnAccountLoad callback. Also, you don't have to use SetPlayerSkin function there.


Re: Skin beeing set to 0? - vassilis - 20.01.2015

So I put setspawninfo and spawnplayer and I'm ok?


Re: Skin beeing set to 0? - Lordzy - 20.01.2015

Yes, that's what my post said..


Re: Skin beeing set to 0? - vassilis - 20.01.2015

So i did some changes and used what you told me but now it saves team and skin is set to police skin :/