09.12.2014, 17:15
Quote:
I don't understand why I need use loop :/
I just need load files of logged player, if u understand me |
pawn Код:
mysql_tquery(handle, "SELECT ....", "OnLoadData", "i", playerid);
forward OnLoadData(playerid);
public OnLoadData(playerid)
{
if(cache_get_row_count())
{
// string
cache_get_field_content(0, "Name", PlayerInfo[playerid][name]); /* OR */ cache_get_row(0, 0, PlayerInfo[playerid][name]);
// integer
PlayerInfo[playerid][money] = cache_get_field_content_int(0, "Money"); /* OR */ PlayerInfo[playerid][money] = cache_get_row_int(0, 1);
// float
PlayerInfo[playerid][health] = cache_get_field_content_float(0, "HP"); /* OR */ PlayerInfo[playerid][health] = cache_get_row_float(0, 2);
// continue...
}
else
{
// no data found.. registration stuff here maybe?
}
return true;
}