12.07.2013, 21:55
Hi. Having a problem with storing results of cache_get_row into my array. Here is what I'm doing.
The print is showing the correct user ID. If I change
to
and print it then it is correct.. So it has something to do with storing in my array. What gives?
Would appreciate any help. It's gotta be something dumb I'm doing. Thanks guys!
Код:
enum example { logUserid, logText[8] }; new Example[MAX_PLAYERS][example]; public OnPlayerConnect(playerid) { new name[24]; GetPlayerName(playerid, name, sizeof(name)); format(query, sizeof(query), "SELECT userID, bypass FROM users WHERE username = '%s'", name); mysql_function_query(mysql, query, true, "LoginUserCheck", "i", playerid); } forward LoginUserCheck(playerid); public LoginUserCheck(playerid) { new rows, fields, query[128]; cache_get_data(rows, fields); if(!rows) return KickPlayer(playerid, "No account. You suck, go away!"); Example[playerid][logUserid] = cache_get_row_int(0, 0); cache_get_row(0, 1, Example[playerid][logBypass], mysql); printf("%i %s", Example[playerid][logUserid], Example[playerid][logBypass]); return 1; }
Код:
cache_get_row(0, 1, Example[playerid][logBypass], mysql);
Код:
cache_get_row(0, 1, tmp, mysql);
Would appreciate any help. It's gotta be something dumb I'm doing. Thanks guys!