[00:36:23] [debug] Run time error 4: "Array index out of bounds" [00:36:23] [debug] Accessing element at index 500 past array upper bound 499 [00:36:23] [debug] AMX backtrace: [00:36:23] [debug] #0 00006970 in public Streamer_OnPlayerDisconnect () from CDuel.amx [00:36:23] [debug] #1 native CallLocalFunction () [00472260] from samp-server.exe [00:36:23] [debug] #2 000006a4 in public OnPlayerDisconnect () from CDuel.amx
public OnPlayerDisconnect(playerid, reason) { if (EnDuelo[playerid]==1) { for (new i=1; i<=ARENAS; i++) { if ((Duelos[i][DesaId] == playerid || Duelos[i][DesafiadoId] == playerid) && (Duelos[i][Libre]==1)) { Duelos[i][Libre] = 0; EnDuelo[Duelos[i][DesaId]] = 0; EnDuelo[Duelos[i][DesafiadoId]] = 0; if (playerid == Duelos[i][DesaId]) { new string2[128]; format(string2,sizeof(string2),"Duelo Info: %s A Abandonado El Servidor En Medio De Un duelo, %s Es El Ganador Por Default.",PlayerName2(playerid),PlayerName2(Duelos[i][DesafiadoId])); SendClientMessageToAll(COLOR_DUELO,string2); PlayerInfo[playerid][Dlose] ++; PlayerInfo[Duelos[i][DesafiadoId]][Dwin] ++; switch (i) { case 1: {SetPlayerPos(Duelos[i][DesafiadoId],2626.5664,1206.4237,28.0004); SetPlayerFacingAngle(Duelos[i][DesafiadoId],274.9405); SetPlayerVirtualWorld(Duelos[i][DesafiadoId], 0);} case 2: {SetPlayerPos(Duelos[i][DesafiadoId],-1562.8058,310.9799,53.4609); SetPlayerFacingAngle(Duelos[i][DesafiadoId],278.5559); SetPlayerVirtualWorld(Duelos[i][DesafiadoId], 0);} case 3: {SetPlayerPos(Duelos[i][DesafiadoId],-2030.9362,-425.7924,71.554); SetPlayerFacingAngle(Duelos[i][DesafiadoId],145.0746); SetPlayerVirtualWorld(Duelos[i][DesafiadoId], 0); GivePlayerWeapon(Duelos[i][DesafiadoId],46,1);} case 4: {SetPlayerPos(Duelos[i][DesafiadoId],2792.4976,-1455.7574,40.048); SetPlayerFacingAngle(Duelos[i][DesafiadoId],353.4433); SetPlayerVirtualWorld(Duelos[i][DesafiadoId], 0);} } for (new j=0; j<= MAX_PLAYERS; j++) { if (ViendoDuelo[j] == i) { new str2[256]; format(str2,sizeof(str2),"~r~%s ~w~Es El Ganador Del Duelo",PlayerName2(Duelos[i][DesafiadoId])); GameTextForPlayer(j,str2,5000,0); ViendoDuelo[j] =-1; } } } if (playerid == Duelos[i][DesafiadoId]) { new string2[128]; format(string2,sizeof(string2),"Duelo Info: %s A Abandonado El Servidor En Medio De Un Duelo, %s Es El Ganador Por Default.",PlayerName2(playerid),PlayerName2(Duelos[i][DesaId])); SendClientMessageToAll(COLOR_DUELO,string2); PlayerInfo[playerid][Dlose] ++; PlayerInfo[Duelos[i][DesaId]][Dwin] ++; switch (i) { case 1: {SetPlayerPos(Duelos[i][DesaId],2626.5664,1206.4237,28.0004); SetPlayerFacingAngle(Duelos[i][DesaId],274.9405); SetPlayerVirtualWorld(Duelos[i][DesaId], 0);} case 2: {SetPlayerPos(Duelos[i][DesaId],-1562.8058,310.9799,53.4609); SetPlayerFacingAngle(Duelos[i][DesaId],278.5559); SetPlayerVirtualWorld(Duelos[i][DesaId], 0);} case 3: {SetPlayerPos(Duelos[i][DesaId],-2030.9362,-425.7924,71.554); SetPlayerFacingAngle(Duelos[i][DesaId],145.0746); SetPlayerVirtualWorld(Duelos[i][DesaId], 0); GivePlayerWeapon(Duelos[i][DesaId],46,1);} case 4: {SetPlayerPos(Duelos[i][DesaId],2792.4976,-1455.7574,40.048); SetPlayerFacingAngle(Duelos[i][DesaId],353.4433); SetPlayerVirtualWorld(Duelos[i][DesaId], 0);} } for (new j=0; j<= MAX_PLAYERS; j++) { if (ViendoDuelo[j] == i) { new str2[256]; format(str2,sizeof(str2),"~r~%s ~w~Es El Ganador Del Duelo",PlayerName2(Duelos[i][DesaId])); GameTextForPlayer(j,str2,5000,0); ViendoDuelo[j] =-1; SetPlayerVirtualWorld(j, 0); } } } Duelos[i][DesaId] = -1; Duelos[i][DesafiadoId] = -1; Duelos[i][ArmasId] = -1; return 1; } } } PlayerInfo[playerid][Noduelo] = false; return 1; }
public OnPlayerDisconnect(playerid) { NoMinijuegos [playerid] = 0; NoAutoMinigun [playerid] = 0; DentroCS [playerid] = 0; gActivePlayers[playerid]--; if(AccInfo[playerid][pCar] != -1) EraseVeh(AccInfo[playerid][pCar]); SendDeathMessage( INVALID_PLAYER_ID, playerid, 201 ); return 1; }
for (new j=0; j<= MAX_PLAYERS; j++)
for (new j=0; j< MAX_PLAYERS; j++)
tienes dos lineas iguales a esta.
pawn Код:
pawn Код:
|