05.09.2013, 08:57
Alright guys, so I found another way to do this, and I tested it several times and it works, BUT I somewhat think that for some reason the way I found that works is inefficient and requires too much data saving, strings, etc..
So even though what I have now works, I'd like to get more comments, maybe there's a way to optimize the function.
My current function:
So even though what I have now works, I'd like to get more comments, maybe there's a way to optimize the function.
My current function:
PHP код:
GetStats(playerid)
{
new string[128],
pName[MAX_PLAYER_NAME+1],
savingstring[20];
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "SELECT * FROM users WHERE username = '%s'", pName);
mysql_query(string);
mysql_store_result();
while(mysql_fetch_row_format(string))
{
mysql_fetch_field_row(savingstring, "admin"); gPlayerInfo[playerid][pAdmin] = strval(savingstring);
}
mysql_free_result();
return 1;
}