[Tutorial] Saving position and skin. [using Y_INI] [For newbies]
#9

So... it's strange. I can't say where or what is the problem so here are pictures of the console.
http://s15.postimg.org/u4z83fv1n/console1.png
http://s13.postimg.org/rpgh180x3/console2.png

Here is the Spawning part with printing "Stage X":
PHP Code:
public OnPlayerSpawn(playerid)
{
    if(
PlayerInfo[playerid][NewReg] == 0)
    {
        
SetPlayerSkin(playeridPlayerInfo[playerid][pSkin]); print("Stage 40");
        
SetPlayerPos(playeridPlayerInfo[playerid][Xpos], PlayerInfo[playerid][Ypos], PlayerInfo[playerid][Zpos]+0.3);    print("Stage 41");
    }
    print(
"Stage 42");
    return 
1;

Loading User Data (NOTICE, that the Stage 10 wasn't at the console at all):
PHP Code:
forward LoadUser_data(playerid,name[],value[]);
public 
LoadUser_data(playerid,name[],value[])
{
    
INI_Int("Password",PlayerInfo[playerid][pPass]); print("Stage 1");
    
INI_Int("Cash",PlayerInfo[playerid][pCash]); print("Stage 2");
    
INI_Int("Bank",PlayerInfo[playerid][pBank]); print("Stage 3");
    
INI_Int("Kills",PlayerInfo[playerid][pKills]); print("Stage 4");
    
INI_Int("Deaths",PlayerInfo[playerid][pDeaths]); print("Stage 5");
    
INI_Int("Skin",PlayerInfo[playerid][pSkin]); print("Stage 6");
    
INI_Int("NewReg",PlayerInfo[playerid][NewReg]); print("Stage 7");
    
INI_Float("Xpos",PlayerInfo[playerid][Xpos]); print("Stage 8");
    
INI_Float("Ypos",PlayerInfo[playerid][Ypos]); print("Stage 9");
    
INI_Float("Zpos",PlayerInfo[playerid][Zpos]); print("Stage 10");
    return 
1;

And here is the disconnecting:
PHP Code:
public OnPlayerDisconnect(playeridreason)
{
    new 
Float:XlogFloat:YlogFloat:Zlog; print("Stage 19");
    
GetPlayerPos(playeridXlogYlogZlog); print("Stage 20");
    
PlayerInfo[playerid][Xpos] = Xlog; print("Stage 21");
    
PlayerInfo[playerid][Ypos] = Ylog; print("Stage 22");
    
PlayerInfo[playerid][Zpos] = Zlog; print("Stage 23");
    new 
playerskin GetPlayerSkin(playerid);  print("Stage 24");
    new 
INI:File INI_Open(UserPath(playerid)); print("Stage 25");
    
INI_SetTag(File,"data"); print("Stage 26");
    
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid)); print("Stage 27");
    
INI_WriteInt(File,"Bank",PlayerInfo[playerid][pBank]); print("Stage 28");
    
INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]); print("Stage 29");
    
INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]); print("Stage 30");
    
INI_WriteInt(File,"Skin",playerskin); print("Stage 31");
    
INI_WriteFloat(File,"Xpos",PlayerInfo[playerid][Xpos]);  print("Stage 32");
    
INI_WriteFloat(File,"Ypos",PlayerInfo[playerid][Ypos]); print("Stage 33");
    
INI_WriteFloat(File,"Zpos",PlayerInfo[playerid][Zpos]); print("Stage 34");
    
INI_WriteInt(File,"NewReg",0); print("Stage 35");
    
INI_Close(File); print("Stage 36");
    return 
1;

Thanks for your help.

Any Ideas?
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)