Raised This Month: $ Target: $400
 0% 

[Help] MySQL & PHP


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 01-30-2016 , 11:17   Re: [Help] MySQL & PHP
Reply With Quote #10

Because the plugin does not know that you made a change on the website.

Here's what is happening:
In the game, player gets gGolds[ id ] = 100
php site changes this player golds to 200
On map change, player disconnects and it saves whatever is held in gGolds[] (100). It does not know that you changed the golds to 200 on the php.

Maybe you should create 2 variables to store golds. One stores all golds, other stores golds for just the connection. Then in the SQL save query, do:
formatex(szTemp,charsmax(szTemp),"UPDATE save_golds SET Golds = Golds + %i WHERE `SteamID` = '%s';", gCurrentGolds[ id ] , g_szAuthID[ id ] )

gCurrentGolds[id] is set to 0 on connect and it does not get loaded from database.

Does this make sense?
__________________

Last edited by Bugsy; 01-30-2016 at 11:18.
Bugsy is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:25.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode