MySQL problem
#5

Here is a better view:
Код:
	"UPDATE accounts SET 
	pName = '%s', 
	pPassword = '%s', 
	pAdminLevel = %d, 
	pPlayerPos = '%f %f %f', 
	pMoney = %d, 
	pVip = %d, 
	pMuted = %d, 
	pWarnings = %d, 
	pWarningReasons = '%s|%s|%s' 
	WHERE pid = %d", 
	GetName(playerid), 
	Player[playerid][pPassword], 
	Player[playerid][pAdminLevel], 
	Player[playerid][pPosition][0], 
	Player[playerid][pPosition][1], 
	Player[playerid][pPosition][0], 
	Player[playerid][pSkin], 
	Player[playerid][pMoney], 
	Player[playerid][pvStatus],
	Player[playerid][pMuted], 
	Player[playerid][pWarnings], 
	Player[playerid][pWarningReason1], 
	Player[playerid][pWarningReason2], 
	Player[playerid][pWarningReason3],
	Player[playerid][pID]
1- pPlayerPos is saving in a weird order, the array is saving as: [0] [1] [0]. I assume the z position should be [2].
2- Player[playerid][pSkin] is setting the 'pMoney' field, and there is no Skin field in the query itself.
3- Player[playerid][pvStatus] has no field too.

TIP: Let me ask you, why do you need to save the VIP stats, Admin stats or even the warnings and the reasons every single time you save the player? These variables never change unless in specific conditions which are not to common to be saved everytime you update the player.
Only save these when you change the variable ingame, its way better.
Reply


Messages In This Thread
MySQL problem - by AnoTek - 16.08.2015, 18:14
Re: MySQL problem - by LetsOWN[PL] - 16.08.2015, 18:41
Re: MySQL problem - by AnoTek - 16.08.2015, 18:58
Re: MySQL problem - by AnoTek - 16.08.2015, 19:12
Re: MySQL problem - by Evocator - 16.08.2015, 19:19

Forum Jump:


Users browsing this thread: 1 Guest(s)