Score won't load
#1

Can somene tell me why whole score won't load. If i had 70 score when i left game it will load 10.
This is my OnPlayerDisconnect
Код:
new INI:File = INI_Open(UserPath(playerid));
	INI_SetTag(File,"data");
	INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
	INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
	INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
	INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
	INI_WriteInt(File,"Score",PlayerInfo[playerid][pScore]);
	INI_WriteInt(File,"VIP",PlayerInfo[playerid][pVIP]);
	INI_Close(File);
And thisis OnPlayerConnect
Код:
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
And this is OnPlayerSpawn
Код:
GivePlayerScore(playerid, PlayerInfo[playerid][pScore]);
This is enum
Код:
enum pInfo
{
    pPass,
    pCash,
    pAdmin,
    pKills,
    pDeaths,
	pScore,
	pVIP
}
Reply
#2

Код:
new INI:File = INI_Open(UserPath(playerid));
	INI_SetTag(File,"data");
	INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
	INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
	INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
	INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
	INI_WriteInt(File,"Score",GetPlayerScore(playerid)); //change to GetPlayerScore(playerid)
	INI_WriteInt(File,"VIP",PlayerInfo[playerid][pVIP]);
	INI_Close(File);
Reply
#3

No errors there. Now i am going to check is it working
Reply
#4

Nope. Still loading only 10
Reply
#5

use SetPlayerScore
instead of GivePlayerScore
Reply
#6

Use SetPlayerScore.
Reply
#7

Nope. Still won't work. Now it wont load score at all
Reply
#8

PHP код:
    INI_Int("Score",PlayerInfo[playerid][pScore]);
    
SetPlayerScore(playeridPlayerInfo[playerid][pScore]); 
That's not working ? Show us your LoadUser_data please.
Reply
#9

Now it wont save it at all. WTF!
Reply
#10

Here you go
Код:
forward LoadUser_Data(playerid,name[],value[]);
public LoadUser_Data(playerid,name[],value[])
{
	INI_Int("Password",PlayerInfo[playerid][pPass]);
	INI_Int("Cash",PlayerInfo[playerid][pCash]);
	INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
	INI_Int("Kills",PlayerInfo[playerid][pKills]);
        INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
        INI_Int("Score",PlayerInfo[playerid][pScore]);
        INI_Int("VIP",PlayerInfo[playerid][pVIP]);
 	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)