SA-MP Forums Archive
Cash & Score not saving - 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: Cash & Score not saving (/showthread.php?tid=285454)



[FIXED]Cash & Score not saving - MadSkillz - 24.09.2011

AdminLevel saves fine. Rest doesn't

Код:
new
		Query[ 200 ],
		name[ MAX_PLAYER_NAME ]
	;
	GetPlayerName(playerid, name, sizeof(name));
	if(Bit1_Get(g_PlayerLogged, playerid) == 1)
	{
  		format(Query,sizeof(Query),"UPDATE `USERS` SET ADMINLEVEL = '%d', SCORE = '%d', CASH = '%d', ARMYPERM = '%d' WHERE `NAME` = '%s'", PlayerInfo[playerid][AdminLevel],PlayerInfo[playerid][Score],PlayerInfo[playerid][Cash],PlayerInfo[playerid][ArmyPerm], name);
  		GetPlayerScore(playerid),
		GetPlayerMoney(playerid),
  		Bit16_Get(g_AdminLevel, playerid),
		DB_Escape(name);
		db_query(Database, Query);
 		Bit1_Set(g_PlayerLogged, playerid, false);
    }



Re: Cash & Score not saving - uprp - 24.09.2011

onplayerdisconnect?


Re: Cash & Score not saving - MadSkillz - 24.09.2011

Yeah it is, sorry for not saying.


Re: Cash & Score not saving - uprp - 24.09.2011

Hmm.. No idea.. Do you have all the enums, etc? any errors or warnings?


Re: Cash & Score not saving - MadSkillz - 24.09.2011

No Errors.. The only enum i've got is PlayerInfo


Re: Cash & Score not saving - uprp - 24.09.2011

why not just copy from a working GM? idk..

To me, it looks like I would change those enums to pCash, etc.


Re: Cash & Score not saving - Jafet_Macario - 24.09.2011

Quote:
Originally Posted by uprp
Посмотреть сообщение
To me, it looks like I would change those enums to pCash, etc.
It makes no difference.


Re: Cash & Score not saving - Xyrex - 24.09.2011

Why do you use GetPlayerScore[...] if you don't use it?

pawn Код:
new
        Query[ 200 ],
        name[ MAX_PLAYER_NAME ]
    ;
    GetPlayerName(playerid, name, sizeof(name));
    if(Bit1_Get(g_PlayerLogged, playerid) == 1)
    {
        PlayerInfo[playerid][AdminLevel]=Bit16_Get(g_AdminLevel, playerid);
        PlayerInfo[playerid][Score]=GetPlayerScore(playerid);
        PlayerInfo[playerid][Cash]=GetPlayerMoney(playerid);
        DB_Escape(name);
        format(Query,sizeof(Query),"UPDATE `USERS` SET ADMINLEVEL = '%d', SCORE = '%d', CASH = '%d', ARMYPERM = '%d' WHERE `NAME` = '%s'", PlayerInfo[playerid][AdminLevel],PlayerInfo[playerid][Score],PlayerInfo[playerid][Cash],PlayerInfo[playerid][ArmyPerm], name);
        db_query(Database, Query);
        Bit1_Set(g_PlayerLogged, playerid, false);
    }



Re: Cash & Score not saving - MadSkillz - 24.09.2011

Thankyou sooo much!