SetSpawnInfo - Spawn at 0,0,0
#4

I went directly off this tutorial: https://sampforum.blast.hk/showthread.php?tid=273088

I think I'm missing something that wasn't covered in it, also, why do I need to parse the file on connect AND on successful login?

EDIT: This tutorial is a near exact copy: https://sampforum.blast.hk/showthread.php?tid=376424

EDIT2: Password is parsing correctly, that only leads me to believe that there's an issue with reading floats.

EDIT3: Cash and skin appear to be working too. Pasting the rest of my player file code here because Im still stuck on positions. They SAVE CORRECTLY, but load as 0,0,0.

pawn Код:
//New Variables: Enum, load, save, register
enum PlayerInfo
{
    pPassword,
    pCash,
    pSkin,
    pAdmin,
    pVip,
    pKills,
    pDeaths,
    pBan,
    pBanReason[128],
    Float:pX,
    Float:pY,
    Float:pZ,
    Float:pA,
    Float:pHealth,
    Float:pArmor
}

new pInfo[MAX_PLAYERS][PlayerInfo];

//snip

forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
    INI_Int("Password",pInfo[playerid][pPassword]);
    INI_Int("Cash",pInfo[playerid][pCash]);
    INI_Int("Skin",pInfo[playerid][pSkin]);
    INI_Int("Admin",pInfo[playerid][pAdmin]);
    INI_Int("Vip",pInfo[playerid][pVip]);
    INI_Int("Kills",pInfo[playerid][pKills]);
    INI_Int("Deaths",pInfo[playerid][pDeaths]);
    INI_Int("Ban",pInfo[playerid][pBan]);
    INI_String("BanReason",pInfo[playerid][pBanReason]);
    INI_Float("X",pInfo[playerid][pX]);
    INI_Float("Y",pInfo[playerid][pY]);
    INI_Float("Z",pInfo[playerid][pZ]);
    INI_Float("A",pInfo[playerid][pA]);
    INI_Float("Health",pInfo[playerid][pHealth]);
    INI_Float("Armor",pInfo[playerid][pArmor]);
    INI_Int("Inventory0",Inventory[playerid][0]);
    INI_Int("InventoryCount0",InventoryCount[playerid][0]);
    INI_Int("Inventory1",Inventory[playerid][1]);
    INI_Int("InventoryCount1",InventoryCount[playerid][1]);
    INI_Int("Inventory2",Inventory[playerid][2]);
    INI_Int("InventoryCount2",InventoryCount[playerid][2]);
    INI_Int("Inventory3",Inventory[playerid][3]);
    INI_Int("InventoryCount3",InventoryCount[playerid][3]);
    INI_Int("Inventory4",Inventory[playerid][4]);
    INI_Int("InventoryCount4",InventoryCount[playerid][4]);
    INI_Int("Inventory5",Inventory[playerid][5]);
    INI_Int("InventoryCount5",InventoryCount[playerid][5]);
    INI_Int("Inventory6",Inventory[playerid][6]);
    INI_Int("InventoryCount6",InventoryCount[playerid][6]);
    INI_Int("Inventory7",Inventory[playerid][7]);
    INI_Int("InventoryCount7",InventoryCount[playerid][7]);
    INI_Int("Inventory8",Inventory[playerid][8]);
    INI_Int("InventoryCount8",InventoryCount[playerid][8]);
    INI_Int("Inventory9",Inventory[playerid][9]);
    INI_Int("InventoryCount9",InventoryCount[playerid][9]);
    INI_Int("Inventory10",Inventory[playerid][10]);
    INI_Int("InventoryCount10",InventoryCount[playerid][10]);
    INI_Int("Inventory11",Inventory[playerid][11]);
    INI_Int("InventoryCount11",InventoryCount[playerid][11]);
    INI_Int("Inventory12",Inventory[playerid][12]);
    INI_Int("InventoryCount12",InventoryCount[playerid][12]);
    INI_Int("Inventory13",Inventory[playerid][13]);
    INI_Int("InventoryCount13",InventoryCount[playerid][13]);
    INI_Int("Inventory14",Inventory[playerid][14]);
    INI_Int("InventoryCount14",InventoryCount[playerid][14]);
    INI_Int("Inventory15",Inventory[playerid][15]);
    INI_Int("InventoryCount15",InventoryCount[playerid][15]);
    INI_Int("Inventory16",Inventory[playerid][16]);
    INI_Int("InventoryCount16",InventoryCount[playerid][16]);
    INI_Int("Inventory17",Inventory[playerid][17]);
    INI_Int("InventoryCount17",InventoryCount[playerid][17]);
    INI_Int("Inventory18",Inventory[playerid][18]);
    INI_Int("InventoryCount18",InventoryCount[playerid][18]);
    INI_Int("Inventory19",Inventory[playerid][19]);
    INI_Int("InventoryCount19",InventoryCount[playerid][19]);
    INI_Int("Inventory20",Inventory[playerid][20]);
    INI_Int("InventoryCount20",InventoryCount[playerid][20]);
    INI_Int("Inventory21",Inventory[playerid][21]);
    INI_Int("InventoryCount21",InventoryCount[playerid][21]);
    INI_Int("Inventory22",Inventory[playerid][22]);
    INI_Int("InventoryCount22",InventoryCount[playerid][22]);
    INI_Int("Inventory23",Inventory[playerid][23]);
    INI_Int("InventoryCount23",InventoryCount[playerid][23]);
    INI_Int("Inventory24",Inventory[playerid][24]);
    INI_Int("InventoryCount24",InventoryCount[playerid][24]);
    INI_Int("Inventory25",Inventory[playerid][25]);
    INI_Int("InventoryCount25",InventoryCount[playerid][25]);
    INI_Int("Inventory26",Inventory[playerid][26]);
    INI_Int("InventoryCount26",InventoryCount[playerid][26]);
    INI_Int("Inventory27",Inventory[playerid][27]);
    INI_Int("InventoryCount27",InventoryCount[playerid][27]);
    INI_Int("Inventory28",Inventory[playerid][28]);
    INI_Int("InventoryCount28",InventoryCount[playerid][28]);
    INI_Int("Inventory29",Inventory[playerid][29]);
    INI_Int("InventoryCount29",InventoryCount[playerid][29]);
    return 1;
}

//snip

forward SaveUser(playerid);
public SaveUser(playerid)
{
    new Float:x, Float:y, Float:z, Float:a, Float:health, Float:armor;
    GetPlayerPos(playerid, x, y, z);
    GetPlayerFacingAngle(playerid, a);

    new skin = GetPlayerSkin(playerid);
   
    new INI:File = INI_Open(UserPath(playerid));
    INI_SetTag(File, "data");
    INI_WriteInt(File, "Cash",pInfo[playerid][pCash]);
    INI_WriteInt(File, "Skin",skin);
    INI_WriteInt(File, "Admin",pInfo[playerid][pAdmin]);
    INI_WriteInt(File, "Vip",pInfo[playerid][pVip]);
    INI_WriteInt(File, "Kills",pInfo[playerid][pKills]);
    INI_WriteInt(File, "Deaths",pInfo[playerid][pDeaths]);
    INI_WriteInt(File, "Ban",pInfo[playerid][pBan]);
    INI_WriteString(File, "BanReason",pInfo[playerid][pBanReason]);
    INI_WriteFloat(File, "X",x);
    INI_WriteFloat(File, "Y",y);
    INI_WriteFloat(File, "Z",z);
    INI_WriteFloat(File, "A",a);
    INI_WriteFloat(File, "Health",health);
    INI_WriteFloat(File, "Armor",armor);
    INI_WriteInt(File, "Inventory0",Inventory[playerid][0]);
    INI_WriteInt(File, "InventoryCount0",InventoryCount[playerid][0]);
    INI_WriteInt(File, "Inventory1",Inventory[playerid][1]);
    INI_WriteInt(File, "InventoryCount1",InventoryCount[playerid][1]);
    INI_WriteInt(File, "Inventory2",Inventory[playerid][2]);
    INI_WriteInt(File, "InventoryCount2",InventoryCount[playerid][2]);
    INI_WriteInt(File, "Inventory3",Inventory[playerid][3]);
    INI_WriteInt(File, "InventoryCount3",InventoryCount[playerid][3]);
    INI_WriteInt(File, "Inventory4",Inventory[playerid][4]);
    INI_WriteInt(File, "InventoryCount4",InventoryCount[playerid][4]);
    INI_WriteInt(File, "Inventory5",Inventory[playerid][5]);
    INI_WriteInt(File, "InventoryCount5",InventoryCount[playerid][5]);
    INI_WriteInt(File, "Inventory6",Inventory[playerid][6]);
    INI_WriteInt(File, "InventoryCount6",InventoryCount[playerid][6]);
    INI_WriteInt(File, "Inventory7",Inventory[playerid][7]);
    INI_WriteInt(File, "InventoryCount7",InventoryCount[playerid][7]);
    INI_WriteInt(File, "Inventory8",Inventory[playerid][8]);
    INI_WriteInt(File, "InventoryCount8",InventoryCount[playerid][8]);
    INI_WriteInt(File, "Inventory9",Inventory[playerid][9]);
    INI_WriteInt(File, "InventoryCount9",InventoryCount[playerid][9]);
    INI_WriteInt(File, "Inventory10",Inventory[playerid][10]);
    INI_WriteInt(File, "InventoryCount10",InventoryCount[playerid][10]);
    INI_WriteInt(File, "Inventory11",Inventory[playerid][11]);
    INI_WriteInt(File, "InventoryCount11",InventoryCount[playerid][11]);
    INI_WriteInt(File, "Inventory12",Inventory[playerid][12]);
    INI_WriteInt(File, "InventoryCount12",InventoryCount[playerid][12]);
    INI_WriteInt(File, "Inventory13",Inventory[playerid][13]);
    INI_WriteInt(File, "InventoryCount13",InventoryCount[playerid][13]);
    INI_WriteInt(File, "Inventory14",Inventory[playerid][14]);
    INI_WriteInt(File, "InventoryCount14",InventoryCount[playerid][14]);
    INI_WriteInt(File, "Inventory15",Inventory[playerid][15]);
    INI_WriteInt(File, "InventoryCount15",InventoryCount[playerid][15]);
    INI_WriteInt(File, "Inventory16",Inventory[playerid][16]);
    INI_WriteInt(File, "InventoryCount16",InventoryCount[playerid][16]);
    INI_WriteInt(File, "Inventory17",Inventory[playerid][17]);
    INI_WriteInt(File, "InventoryCount17",InventoryCount[playerid][17]);
    INI_WriteInt(File, "Inventory18",Inventory[playerid][18]);
    INI_WriteInt(File, "InventoryCount18",InventoryCount[playerid][18]);
    INI_WriteInt(File, "Inventory19",Inventory[playerid][19]);
    INI_WriteInt(File, "InventoryCount19",InventoryCount[playerid][19]);
    INI_WriteInt(File, "Inventory20",Inventory[playerid][20]);
    INI_WriteInt(File, "InventoryCount20",InventoryCount[playerid][20]);
    INI_WriteInt(File, "Inventory21",Inventory[playerid][21]);
    INI_WriteInt(File, "InventoryCount21",InventoryCount[playerid][21]);
    INI_WriteInt(File, "Inventory22",Inventory[playerid][22]);
    INI_WriteInt(File, "InventoryCount22",InventoryCount[playerid][22]);
    INI_WriteInt(File, "Inventory23",Inventory[playerid][23]);
    INI_WriteInt(File, "InventoryCount23",InventoryCount[playerid][23]);
    INI_WriteInt(File, "Inventory24",Inventory[playerid][24]);
    INI_WriteInt(File, "InventoryCount24",InventoryCount[playerid][24]);
    INI_WriteInt(File, "Inventory25",Inventory[playerid][25]);
    INI_WriteInt(File, "InventoryCount25",InventoryCount[playerid][25]);
    INI_WriteInt(File, "Inventory26",Inventory[playerid][26]);
    INI_WriteInt(File, "InventoryCount26",InventoryCount[playerid][26]);
    INI_WriteInt(File, "Inventory27",Inventory[playerid][27]);
    INI_WriteInt(File, "InventoryCount27",InventoryCount[playerid][27]);
    INI_WriteInt(File, "Inventory28",Inventory[playerid][28]);
    INI_WriteInt(File, "InventoryCount28",InventoryCount[playerid][28]);
    INI_WriteInt(File, "Inventory29",Inventory[playerid][29]);
    INI_WriteInt(File, "InventoryCount29",InventoryCount[playerid][29]);
    INI_Close(File);
    return 1;
}
And a current file:

PHP код:
[data]
InventoryCount29 0
Inventory29 
0
InventoryCount28 
0
Inventory28 
0
InventoryCount27 
0
Inventory27 
0
InventoryCount26 
0
Inventory26 
0
InventoryCount25 
0
Inventory25 
0
InventoryCount24 
0
Inventory24 
0
InventoryCount23 
0
Inventory23 
0
InventoryCount22 
0
Inventory22 
0
InventoryCount21 
0
Inventory21 
0
InventoryCount20 
0
Inventory20 
0
InventoryCount19 
0
Inventory19 
0
InventoryCount18 
0
Inventory18 
0
InventoryCount17 
0
Inventory17 
0
InventoryCount16 
0
Inventory16 
0
InventoryCount15 
0
Inventory15 
0
InventoryCount14 
0
Inventory14 
0
InventoryCount13 
0
Inventory13 
0
InventoryCount12 
0
Inventory12 
0
InventoryCount11 
0
Inventory11 
0
InventoryCount10 
0
Inventory10 
0
InventoryCount9 
0
Inventory9 
0
InventoryCount8 
0
Inventory8 
0
InventoryCount7 
0
Inventory7 
0
InventoryCount6 
0
Inventory6 
0
InventoryCount5 
0
Inventory5 
0
InventoryCount4 
0
Inventory4 
0
InventoryCount3 
0
Inventory3 
0
InventoryCount2 
0
Inventory2 
0
InventoryCount1 
0
Inventory1 
0
InventoryCount0 
0
Inventory0 
0
Armor 
0.000000
Health 
0.000000
16.280002
10.401393
1944.359008
2154.173583
BanReason 

Ban 0
Deaths 
0
Kills 
0
Vip 
0
Admin 
0
Skin 
72
Cash 
0
//snipped password 
Disregard health, it is not implemented yet.
Reply


Messages In This Thread
SetSpawnInfo - Spawn at 0,0,0 - by Aerotactics - 10.02.2017, 23:40
Re: SetSpawnInfo - Spawn at 0,0,0 - by Threshold - 10.02.2017, 23:50
Re: SetSpawnInfo - Spawn at 0,0,0 - by Aerotactics - 11.02.2017, 02:55
Re: SetSpawnInfo - Spawn at 0,0,0 - by Aerotactics - 11.02.2017, 03:23
Re: SetSpawnInfo - Spawn at 0,0,0 - by BroZeus - 11.02.2017, 03:39
Re: SetSpawnInfo - Spawn at 0,0,0 - by Aerotactics - 11.02.2017, 03:44
Re: SetSpawnInfo - Spawn at 0,0,0 - by Threshold - 11.02.2017, 03:52
Re: SetSpawnInfo - Spawn at 0,0,0 - by Aerotactics - 11.02.2017, 04:07

Forum Jump:


Users browsing this thread: 1 Guest(s)