22.03.2016, 09:26
PHP код:
UserFromID(ID, UserID[MAX_PLAYER_NAME])
{
new query[200];
mysql_format(MySQL, query, sizeof(query), "SELECT `Username` FROM `Users` WHERE `ID` = %d LIMIT 0,1", ID);
new Cache:Result = mysql_query(MySQL, query);
if(cache_num_rows()) cache_get_field_content(0, "Username", UserID, MySQL, sizeof(UserID));
else UserID = "NULL";
cache_delete(Result);
return 1;
}
PHP код:
new name[MAX_PLAYER_NAME];
UserFromID(ID,name);
// THe Name will be player name you wanna get you can print it to see
printf("%s",name);