13.07.2016, 19:42
Hey,
I've got this error in my console, but I can't find any soulution for it. Maybe you can help me.
OnPlayerConnect:
OnAccountCheck:
Somebody have any idea?
Thanks!
I've got this error in my console, but I can't find any soulution for it. Maybe you can help me.
Код:
[debug] Run time error 4: "Array index out of bounds" [debug] Accessing element at index 4 past array upper bound 3 [debug] AMX backtrace: [debug] #0 00018294 in ?? (0) from hagakure_script.amx [debug] #1 0000f0c8 in public inc_Ven_OnPlayerConnect (0) from hagakure_script.amx [debug] #2 0000bfa8 in public SSCANF_OnPlayerConnect (0) from hagakure_script.amx [debug] #3 0000509c in public Iter_OnPlayerConnect (0) from hagakure_script.amx [debug] #4 native CallLocalFunction () from samp-server.exe [debug] #5 00002f18 in public f3_KBROnPlayerConnect (0) from hagakure_script.amx [debug] #6 000023fc in public AB_OnPlayerConnect (0) from hagakure_script.amx [debug] #7 00000684 in public OnPlayerConnect (0) from hagakure_script.amx
Код:
public OnPlayerConnect(playerid) { new query[128]; SetPlayerColor(playerid, 0xFFFFFFFF); TogglePlayerControllable(playerid, false); AddPlayerTextdraws(playerid); mysql_format(mysql, query, sizeof(query), "SELECT `pPass`, `pID` FROM `accs` WHERE `pName` = '%e' LIMIT 1", PlayerName(playerid)); mysql_tquery(mysql, query, "OnAccountCheck", "d", playerid); ResetPlayerVariables(playerid); return 1; }
Код:
forward OnAccountCheck(playerid); public OnAccountCheck(playerid) { SetPlayerColor(playerid, 0xFFFFFFFF); new rows, fields; cache_get_data(rows, fields, mysql); if(rows) { cache_get_field_content(0, "pPass", pData[playerid][pPass], mysql, 129); pData[playerid][pID] = cache_get_field_content_int(0, "pID"); ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "{69FFA2}HAGAKURE's Reallife Server Login", "We could find your Account in our database, please type in your password:", "{69FFA2}Login", "{FF6347}Exit"); } else { ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "HAGAKURE's Reallife Server Register", "We couldn't find your Account in our database. Please register", "{69FFA2}Register", "{FF6347}Exit"); } return 1; }
Thanks!