Scores
#1

I was wondering I am having issues with my scores not always saving for some reason so I am wondering in script when a player does something good i give them plus 1 score so in the script would I put both:
dUserSetINT(PlayerName(playerid)).("Score",GetPlay erScore(playerid)+1);
SetPlayerScore(playerid, GetPlayerScore(playerid)+1);

Or is this the reason the score does not always save? I am using them both such as:

* notec100 slaps around a bit with a large trout.
dUserSetINT(PlayerName(playerid)).("Score",GetPlay erScore(playerid)+1);
SetPlayerScore(playerid, GetPlayerScore(playerid)+1);

Thanks in advance.

Reply
#2

I know what's wrong. It's saving the player's current ingame score and adding 1. For example, let's say your player had 5 points last night and he has 5 points now in his profile. He comes on again today and only gets 2 points. His profile will go back to 2 because you're using the current in-game score to save.

Change:
pawn Код:
dUserINT(PlayerName(playerid)).("Score",GetPlayerScore(playerid)+1);
to this:
pawn Код:
dUserSetINT(PlayerName(playerid)).("Score",dUserINT(PlayerName(playerid)).("Score")+1);
Reply
#3

Quote:
Originally Posted by [Fackin'
Pyro ]
I know what's wrong. It's saving the player's current ingame score and adding 1. For example, let's say your player had 5 points last night and he has 5 points now in his profile. He comes on again today and only gets 2 points. His profile will go back to 2 because you're using the current in-game score to save.

Change:
pawn Код:
dUserINT(PlayerName(playerid)).("Score",GetPlayerScore(playerid)+1);
to this:
pawn Код:
dUserSetINT(PlayerName(playerid)).("Score",dUserINT(PlayerName(playerid)).("Score")+1);
Wow man thanks a lot! I didn't even think of it in that perspective nor did I think I ever would Thanks again you have given me some more knowledge!
Reply
#4

Any time. Glad I could be of service.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)