Results 1 to 10 of 69

Thread: Saving a variable client-side (persistently)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Private
    Join Date
    Apr 2020
    Posts
    66
    Thanks
    28
    Thanked 14 Times in 13 Posts
    After some trial and error i came up with this:
    Code:
    updatestats()
    {
        async_id = maps\mp\gametypes\_mysql::asyncQuery("SELECT * FROM player_information WHERE login = '" + self.izno["login"] + "'",::actualupdate );
    	//mysql_async_getresult_and_free(async_id);
    	
    }
    
    actualupdate(rows,args)
    {
    	if(isDefined(rows))
    	{	
    		for(i=0;i<level.stats.size;i++)
    				{
    					async_id = maps\mp\gametypes\_mysql::asyncQuery("UPDATE player_information set " + level.stats[i] +" = "+self.stats[level.stats[i]]+"  WHERE login = '" + self.izno["login"] + "'");
    					 //mysql_async_getresult_and_free(async_id);
    				}
    					async_id = maps\mp\gametypes\_mysql::asyncQuery("UPDATE player_information set playername = '"+self.name+"'  WHERE login = '" + self.izno["login"] + "'");
    					// mysql_async_getresult_and_free(async_id);
    	}
    		self notify("update_playerhud_score");
    	self maps\mp\gametypes\_myhud::updatePlayerScoreHUD();
    If i try to use mysql_async_getresult_and_free(async_id); I get this error. If i don't use it it stores the data and does not give any error. Is it ok like this? Does it need anything else? I plan to make it more efficient by specifing the stat i need to update. But for now i first want to get it to work properly.
    Code:
    ******* script runtime error *******
    gsc_mysql_async_getresult_and_free() argument is undefined or has a wrong type: (file 'maps/mp/gametypes/_stattracking.gsc', line 209)
     mysql_async_getresult_and_free(async_id);

  2. The Following User Says Thank You to agribilos For This Useful Post:

    kung foo man (31st May 2020)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •