Issue with y_ini skin loading - 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: Issue with y_ini skin loading (
/showthread.php?tid=227452)
Issue with y_ini skin loading -
OldDirtyBastard - 17.02.2011
I wrote this already yesterday because i thoud i solved this issue, so i edited my post
to [Solved] but the problem isnt solved.
Basicly after
OnPlayerRequestSpawn the skin is saved and at
OnPlayerSpawn the skin is loaded,
the problem is that when i wanna change my skin with F4 & /kill it loads the previous skin,
not the one that is saved at OnPlayerRequestSpawn..
Heres my code:
pawn Code:
public OnPlayerRequestSpawn(playerid)
{
if ( GetPVarInt( playerid, "Logged" ) == 1 && INI_Exist( pName( playerid ) ) )
{
new PlayerFile[ 13 + MAX_PLAYER_NAME ];
format( PlayerFile , sizeof PlayerFile, "Accounts/%s.ini", Encode( pName( playerid ) ) );
new INI:PlayerAcc = INI_Open( PlayerFile );
INI_WriteInt( PlayerAcc, "MY_SKIN", GetPlayerSkin( playerid ) );
INI_Close( PlayerAcc );
}
else
{
//nothing happens here
}
return 1;
}
pawn Code:
public OnPlayerSpawn(playerid)
{
if ( GetPVarInt( playerid, "Logged" ) == 1 && INI_Exist( pName( playerid ) ) )
{
SetPlayerSkin ( playerid, GetPVarInt( playerid, "Skin" ) );
}
else
{
//nothing happens here
}
return 1;
}
Please, if you can, give me some advices how to solve this issue..
Thanks, regards.
Re: Issue with y_ini skin loading -
Criss_Angel - 17.02.2011
Maybe I'm Mistaken but How are you getting the Players Skin before he has spawned?
pawn Code:
INI_WriteInt( PlayerAcc, "MY_SKIN", GetPlayerSkin( playerid ) );
Re: Issue with y_ini skin loading -
OldDirtyBastard - 17.02.2011
Skins are set during the class selection.
Re: Issue with y_ini skin loading -
OldDirtyBastard - 17.02.2011
Anyone please? I was thinking about when the player logs in at the class selection will be his skin displayed,
but i cant do it easly with SetPlayerSkin because then the player wont be able to change skins anymore..