20.01.2016, 13:57
I get a proble when I connect to the server, after the login, i get stuck on the class selection (this didnt happen until i made a function)
So what this does is set the values to default when then player connects
But when I put this on OnPlayerConnect i get
PHP код:
stock setUpFriendVars(playerid){
for(new i = 0; i < MAX_FRIENDS; i ++){
Friends[playerid][i][dbid] = 0;
Friends[playerid][i][serverid] = -1;
Friends[playerid][i][online] = false;
}
return true;
}
But when I put this on OnPlayerConnect i get
Код:
[15:51:35] [debug] Run time error 4: "Array index out of bounds" [15:51:35] [debug] Accessing element at negative index -1 [15:51:35] [debug] AMX backtrace: [15:51:35] [debug] #0 000258f4 in ?? (-1, 0, 9411992, 9411996, 0) from main.amx [15:51:35] [debug] #1 0002b9f0 in ?? (0) from main.amx [15:51:35] [debug] #2 0001fda0 in public OnAccountLoad (0) from main.amx [15:51:43] [debug] Run time error 4: "Array index out of bounds" [15:51:43] [debug] Accessing element at negative index -1 [15:51:43] [debug] AMX backtrace: [15:51:43] [debug] #0 000258f4 in ?? (-1, 1, 9412000, 9412004, 0) from main.amx [15:51:43] [debug] #1 0002bbf0 in ?? (0) from main.amx [15:51:43] [debug] #2 00026b58 in ?? (0, 1) from main.amx [15:51:43] [debug] #3 00011474 in public SSCANF_OnPlayerDisconnect (0, 1) from main.amx [15:51:43] [debug] #4 0000265c in public Itter_OnPlayerDisconnect (0, 1) from main.amx [15:51:43] [debug] #5 00001740 in public OnPlayerDisconnect (0, 1) from main.amx [15:51:43] [part] Champa has left the server (0:1)