SA-MP Forums Archive
Duplicate stats. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Duplicate stats. (/showthread.php?tid=562197)



Duplicate stats. - Nezinuu - 07.02.2015

Hello. Does anyone have any ideas why stats is duplicate? When i go in server create my account everything is Okay. But when i quit game. And go in server from same Pc with new nick. I register. And my stats its same like first profile. But when i restart server and create new profile, stats is like it be on defualt register player. Do any have suggestions why it is?

If need script: http://pastebin.com/ijKGRiiL
Yea i kno. Script is shity.


Re: Duplicate stats. - Tamy - 07.02.2015

You have to clear the variables, make something like this.

Код:
OnPlayerDisconnect(playerid, reason)
{
     PlayerInfo[playerid][VARIABLE] = 0;
     AND SET ALL THE ENUM VALUES TO 0 LIKE THIS.
}
problem fixed.


Re: Duplicate stats. - ATGOggy - 07.02.2015

Reset all stats when players disconnect. Like:
PHP код:
PlayerInfo[playerid][pAdmin]=0;
PlayerInfo[playerid][pKills]=0;
Wantedlevel[playerid]=0;
//etc.... 



Re: Duplicate stats. - Nezinuu - 07.02.2015

Oh thanks.