Can't save player's score and money when he quit the game
#1

Can't save player's score and money when he quit the game


Код:
    pCash,
    pScore,
Код:
	dini_IntSet(file, "Score", PlayerInfo[playerid][pScore]); 
	dini_IntSet(file, "Money", GetPlayerMoney(playerid));
onplayerregister

Код:
	dini_IntSet(file, "Money",PlayerInfo[playerid][pCash] = 3000);
	dini_IntSet(file, "Score",PlayerInfo[playerid][pScore] = 0);
Код:
PlayerInfo[playerid][pScore] = dini_Int(file, "Score");
PlayerInfo[playerid][pCash] = dini_Int(file, "Money");
What is here problem

on registration new player don't get 3000$ and on login if he had some money, on login his money stay 0 ....

sory for bad english
Reply
#2

Have you used GivePlayerMoney in any part of that? If yes does the files really save?
Reply
#3

GetPlayerScore(playerid); and GivePlayerMoney
Reply
#4

Does the file save? Or does it save the right values?

Also show the full code where you use dini_IntSet and dini_Int without it we can't help you.
Reply
#5

Код:
public OnPlayerDisconnect(playerid, reason)
{
	dini_IntSet(file, "Score", PlayerInfo[playerid][pScore]);
	dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel]); 
	dini_IntSet(file, "RobLevel",PlayerInfo[playerid][pRobRank]);
	dini_IntSet(file, "Money", GetPlayerMoney(playerid));
return 1;
}
admin and rob pinfo work good

and for playerrigester

Код:
dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel] = 0); 
dini_IntSet(file, "RobLevel",PlayerInfo[playerid][pRobRank] = 0);
dini_IntSet(file, "Money",PlayerInfo[playerid][pCash] = 3000);
dini_IntSet(file, "Score",PlayerInfo[playerid][pScore] = 0);
and on login

Код:
	PlayerInfo[playerid][pAdminLevel] = dini_Int(file, "AdminLevel"); 
PlayerInfo[playerid][pScore] = dini_Int(file, "Score");
PlayerInfo[playerid][pCash] = dini_Int(file, "Money");
did you mean this? And where is problem...
Reply
#6

on login are you sure you use the GivePlayerMoney? show the full code of the login
Reply
#7

gPlayerLogged[playerid] = 1;
PlayerInfo[playerid][pAdminLevel] = dini_Int(file, "AdminLevel");
PlayerInfo[playerid][pScore] = dini_Int(file, "Score");
PlayerInfo[playerid][pCash] = dini_Int(file, "Money");
Reply
#8

bump!!!
Reply
#9

dini_IntSet(file, "Money", Playerinfo[playerid][pCash]);

instead of

dini_IntSet(file, "Money", GetPlayerMoney(playerid));

under

Код:
public OnPlayerDisconnect(playerid, reason)
{
	dini_IntSet(file, "Score", PlayerInfo[playerid][pScore]);
	dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel]); 
	dini_IntSet(file, "RobLevel",PlayerInfo[playerid][pRobRank]);
	dini_IntSet(file, "Money", GetPlayerMoney(playerid));
return 1;
}
Reply
#10

the same problem....
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)