player positions not loading
#3

Quote:
Originally Posted by GRiMMREAPER
Посмотреть сообщение
You should also free the query results with mysql_free_result().
mysql_free_result() its deleted for so long time, thats from old times, also seems he use mysql_tquery which no need to free the result, result will be freed automatic

PHP код:
 stock LoadPlayerStats(playerid

        new 
query[200], name[24], Cacheresult
        
GetPlayerName(playeridname24); 
        
format(querysizeof(query), "SELECT * FROM `accounts` WHERE `playerName` = '%e' LIMIT 1"name); 
        
result mysql_query(Databasequery); 
        if(
cache_num_rows())
        {
            
cache_get_value_int(0"playerAdmin"playerInfo[playerid][playerAdmin]); 
            
cache_get_value_int(0"playerMod"playerInfo[playerid][playerMod]); 
            
cache_get_value_int(0"playerHelper"playerInfo[playerid][playerHelper]); 
            
cache_get_value_int(0"playerLevel"playerInfo[playerid][playerLevel]); 
            
cache_get_value_int(0"playerCash"playerInfo[playerid][playerCash]); 
            
cache_get_value_name_float(0"playerX"playerInfo[playerid][playerX]); 
            
cache_get_value_name_float(0"playerY"playerInfo[playerid][playerY]); 
            
cache_get_value_name_float(0"playerZ"playerInfo[playerid][playerZ]); 
        }
           
        
SetPlayerScore(playeridplayerInfo[playerid][playerLevel]); 
        
GivePlayerMoney(playeridplayerInfo[playerid][playerCash]); 
        
SetSpawnInfo(playerid0,0,playerInfo[playerid][playerX],playerInfo[playerid][playerY], playerInfo[playerid][playerZ], 00000,0,0); 
        
cache_delete(result);
        
printf("player loaded."); 

This is if you want the result from the select query in same function(unless you gonna use mysql_tquery_inline). mysql_tquery send a threaded query so the mysql_tquery require a callback in which you gonna load the data recived from the select query
Reply


Messages In This Thread
player positions not loading - by yllo - 09.08.2018, 12:02
Re: player positions not loading - by yllo - 10.08.2018, 11:38
Re: player positions not loading - by Banditul18 - 10.08.2018, 11:40

Forum Jump:


Users browsing this thread: 1 Guest(s)