28.02.2015, 21:26
I do this in my script to have directly the name.
My method could work for everything but take more ressources than yours. Just for your case, you script seems me much better than mine.
Your script there can't work for disconnect player unless you load all the sql database when GameMode Start
Quote:
public MySQLGetName(result[], sqlid) { new query[128]; format(query, sizeof(query), "SELECT `Name` FROM `players_stats` WHERE ID=%d", sqlid); mysql_query(query); mysql_store_result(); if(mysql_num_rows()==0) {return format(result, 32, "None");} else { new strid[32]; if(mysql_fetch_row(strid)==1) { return format(result, 32, "%s", strid); } } return 1; } |
Your script there can't work for disconnect player unless you load all the sql database when GameMode Start