PDA

View Full Version : Score is not saving help me pls (y_ini)


ReD_HunTeR
05/12/2013, 06:38 PM
my question is why script is not saving the scores as you can see topic, so why cant?

Codes:

enum pInfo
{
pScores
}
new PlayerInfo[MAX_PLAYERS][pInfo];

public LoadUser_data(playerid,name[],value[])
{
INI_Int("Scores",PlayerInfo[playerid][pScores]);
return 1;
}

Dialog Response (Register)
INI_WriteInt(File,"Scores",0);

Dialog Respone (Login)
SetPlayerScore(playerid,PlayerInfo[playerid][pScores]);

Konstantinos
05/12/2013, 06:42 PM
And the saving part? INI_WriteInt

You should also use GetPlayerScore(playerid) as value to save the score.

ReD_HunTeR
05/12/2013, 06:55 PM
i cant understand what do you mean lol,

INI_WriteInt at LoadUser_data?
and?
GetPlayerScore(playerid)? at Disconnect?

oh btw i have one more thing it in the script here:

OnPlayerDisconnect
INI_WriteInt(File,"Scores",PlayerInfo[playerid][pScores]);

Konstantinos
05/12/2013, 07:00 PM
No, I meant the last line you posted!


// In OnPlayerDisconnect:
INI_WriteInt(File,"Scores",GetPlayerScore(playerid));

ReD_HunTeR
05/12/2013, 07:04 PM
i setted

INI_WriteInt(File,"Scores",PlayerInfo[playerid][pScores]);

to this

INI_WriteInt(File,"Scores",GetPlayerScore(playerid));

but still not working

Konstantinos
05/12/2013, 07:10 PM
Do the rest of the player's data get saved to the file?

ReD_HunTeR
05/12/2013, 07:19 PM
yes they do..


[data]
Password = 68944173
Cash = 1000000
Admin = 8
Kills = 0(not someone to kill in my server so 0 lol)
Deaths = 1
Vip = 4
Scores = 0

ReD_HunTeR
05/12/2013, 07:24 PM
oh its fixed but thaanks anyway, you help me alot in this scipt as well ill rep you soon.