17.02.2011, 15:26
(
Last edited by OldDirtyBastard; 17/02/2011 at 04:09 PM.
)
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:
Please, if you can, give me some advices how to solve this issue..
Thanks, regards.
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;
}
Thanks, regards.