View Single Post
Old 17/02/2011, 04:26 PM   #1
OldDirtyBastard
Huge Clucker
 
OldDirtyBastard's Avatar
 
Join Date: Jan 2010
Posts: 296
Reputation: 0
Unhappy Issue with y_ini skin loading

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.

Last edited by OldDirtyBastard; 17/02/2011 at 05:09 PM.
OldDirtyBastard is offline