01.12.2012, 08:38
pawn Код:
new plname[MAX_PLAYER_NAME];
GetPlayerName(playerid, plname, sizeof(plname));
new qstr[100];
format(qstr,100,"SELECT * FROM `players` WHERE `username`='%s';",plname);
mysql_function_query(g_Handle, qstr, true, "OnPlayerCheckAccount", "s", playerid);
return 1;
forward OnPlayerCheckAccount(playerid);
public OnPlayerCheckAccount(playerid)
{
new rows, fields;
cache_get_data(rows, fields);
if(rows)
{
SendClientMessage(playerid, COLOR_WHITE, "You're registered!");
printf("Este inregistrat!");
gPlayerAccount[playerid] = 1;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You're not registered!");
gPlayerAccount[playerid] = 0;
}
}
pawn Код:
[11:52:17]: Script[gamemodes/redzmaxr7.amx]: During execution of OnPlayerCheckAccount():
[11:52:17]: Script[gamemodes/redzmaxr7.amx]: Run time error 4: "Array index out of bounds"
[11:52:17]: Additional information:
[11:52:17]: Array max index is 250 but accessing an element at 35441308
[11:52:17]: Call stack (most recent call first):
[11:52:17]: public OnPlayerCheckAccount()