Issue with y_ini skin loading
#1

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

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 ) );
Reply
#3

Skins are set during the class selection.
Reply
#4

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


Forum Jump:


Users browsing this thread: