28.01.2017, 14:34
Hi everyone,
I've already read a few topic about it, but I wish to know what it happens when I execute, for example, this code:
Here OnPlayerDataLoaded:
When i call SetPlayerHealth function, has PlayerData[playerid][pHealth] been updated with the new value?
Or what is the proper way to use tquery?
Thanks and regards.
I've already read a few topic about it, but I wish to know what it happens when I execute, for example, this code:
Code:
mysql_format(MySQL, query, sizeof(query), "SELECT * FROM `players` WHERE `Name` = '%s' LIMIT 1", pname); mysql_tquery(MySQL, query, "OnPlayerDataLoaded", "d", playerid); SetPlayerHealth(playerid,PlayerData[playerid][pHealth]);
Code:
forward OnPlayerDataLoaded(playerid); public OnPlayerDataLoaded(playerid) { PlayerData[playerid][pHealth] = cache_get_field_content_float(0,"Health"); return 1; }
Or what is the proper way to use tquery?
Thanks and regards.