SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 17/02/2011, 04:26 PM   #1
OldDirtyBastard
Huge Clucker
 
OldDirtyBastard's Avatar
 
Join Date: Jan 2010
Posts: 306
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  
Old 17/02/2011, 04:56 PM   #2
Criss_Angel
Huge Clucker
 
Join Date: Jun 2009
Posts: 384
Reputation: 0
Default 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 ) );
Criss_Angel is offline  
Old 17/02/2011, 05:05 PM   #3
OldDirtyBastard
Huge Clucker
 
OldDirtyBastard's Avatar
 
Join Date: Jan 2010
Posts: 306
Reputation: 0
Default Re: Issue with y_ini skin loading

Skins are set during the class selection.
OldDirtyBastard is offline  
Old 17/02/2011, 05:43 PM   #4
OldDirtyBastard
Huge Clucker
 
OldDirtyBastard's Avatar
 
Join Date: Jan 2010
Posts: 306
Reputation: 0
Default 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..

Last edited by OldDirtyBastard; 17/02/2011 at 06:49 PM.
OldDirtyBastard is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED]Strange y_ini skin loading problem OldDirtyBastard Help Archive 0 16/02/2011 08:09 PM
Y_INI reading (INI_LOAD) issue. blackwave Help Archive 5 14/01/2011 01:14 AM
Y_INI annoyin' issue blackwave Help Archive 3 12/01/2011 04:26 PM
Saving/loading skin with DUDB? Anarkien Help Archive 4 07/01/2010 10:55 AM
[MySQL] Loading data from a row - issue woot Help Archive 2 22/09/2009 05:50 PM


All times are GMT. The time now is 12:14 AM.


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