SA-MP Forums

SA-MP Forums (https://forum.sa-mp.com/index.php)
-   Help Archive (https://forum.sa-mp.com/forumdisplay.php?f=89)
-   -   Issue with y_ini skin loading (https://forum.sa-mp.com/showthread.php?t=227452)

OldDirtyBastard 17/02/2011 03:26 PM

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.

Criss_Angel 17/02/2011 03:56 PM

Re: Issue with y_ini skin loading
 
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 ) );

OldDirtyBastard 17/02/2011 04:05 PM

Re: Issue with y_ini skin loading
 
Skins are set during the class selection.

OldDirtyBastard 17/02/2011 04:43 PM

Re: Issue with y_ini skin loading
 
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..


All times are GMT. The time now is 08:58 PM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.