11.02.2012, 12:01
(
Последний раз редактировалось s0cket; 11.02.2012 в 12:32.
)
I really can't figure out what's wrong with this code, I've done a similar script before and it worked fine.
gangid[playerid] is this global variable array:
and username variable is this:
when I run this code debug string comes empty, or with text if I add it and an empty space in place of the gangid[playerid] variable.
This is the output I get if I run a similar sql query in phpmyadmin:
I also tried replacing gangid array with a single variable and a different array, result was the same.
gangid[playerid] is this global variable array:
pawn Код:
new gangid[MAX_PLAYERS];
pawn Код:
new username[MAX_PLAYER_NAME];
GetPlayerName(playerid, username, sizeof(username));
pawn Код:
new checkgangQuery[250];
format (checkgangQuery, sizeof(checkgangQuery), "SELECT `gangid` FROM `users` WHERE `username` = '%s'", username);
mysql_query(checkgangQuery);
mysql_store_result();
gangid[playerid] = mysql_fetch_int();
mysql_free_result();
new debugstring[50];
format(debugstring, sizeof(debugstring), "%s", gangid[playerid]);
SendClientMessage(playerid, 0xFFFFFFAA, debugstring);
This is the output I get if I run a similar sql query in phpmyadmin:
I also tried replacing gangid array with a single variable and a different array, result was the same.