03.01.2014, 12:13
Well, i got a warnings from crashdetect i tried to fix that, i know the reason from ondialogresponse and its appear when i click on a teleport place , but that what i got:
Here is the teleport's which causing this problem:
Код:
]+ [debug] Run time error 4: "Array index out of bounds" [15:19:34]+ [debug] Accessing element at index 4 past array upper bound 2 [15:19:34]+ [debug] AMX backtrace: [15:19:34]+ [debug] #0 0004f8a4 in public OnDialogResponse (0x00000000, 0x00000bb1, 0x00000001, 0x00000002, 0x001edc9c) from SPA.amx
Код:
if(dialogid == DMAREAS) // { if(response) { if(listitem == 0) // { new pName[MAX_PLAYER_NAME]; new string [128]; if(DMZone[playerid] == 1) return ShowPlayerDialog(playerid,TELEWARN,DIALOG_STYLE_MSGBOX,"Error:","Teleporting Error!\n\n- {F3FF02}Sorry, But you can't Teleport to another area while in a Dm Zone","OK","Leave Dm"); new rand = random(sizeof(RandomPlayerSpawns)); MapLoading(playerid); SetPlayerArmour(playerid,50); SetPlayerHealth(playerid,100); DMZone[playerid] = 5; GetPlayerName(playerid, pName, sizeof(pName)); format(string, sizeof(string), "[DM] %s has joined DeathMatch Mode [ /BF ] ", pName, playerid); SendClientMessageToAll(COLOR_TELEPORT, string); SendClientMessage(playerid, RED,"* Server: For leave dm type /LeaveDm"); SetPlayerFacingAngle(playerid,176.60); SetPlayerPos(playerid, RandomPlayerSpawnsbf[rand][0], RandomPlayerSpawnsbf[rand][1], RandomPlayerSpawnsbf[rand][2]); ResetPlayerWeapons(playerid); GivePlayerWeapon(playerid,36,5000000); GivePlayerWeapon(playerid,39,5000000); GivePlayerWeapon(playerid,28,5000000); GivePlayerWeapon(playerid,30,5000000); if(udb_Exists(pName)) { dUserSetINT(pName).("InDm",1); } SetPlayerVirtualWorld(playerid,111);//BF } if(listitem == 1) { new pName[MAX_PLAYER_NAME]; new string [128]; if(DMZone[playerid] == 1) return ShowPlayerDialog(playerid,TELEWARN,DIALOG_STYLE_MSGBOX,"Error:","Teleporting Error!\n\n- {F3FF02}Sorry, But you can't Teleport to another area while in a Dm Zone","OK","Leave Dm"); new rand = random(sizeof(RandomPlayerSpawns)); SetPlayerHealth(playerid,100); GetPlayerName(playerid, pName, sizeof(pName)); format(string, sizeof(string), "[DM] %s has joined DeathMatch Mode [ /AREA69 ] ", pName, playerid); SendClientMessageToAll(COLOR_TELEPORT, string); SendClientMessage(playerid, RED,"* Server: For leave dm type /LeaveDm"); DMZone[playerid] = 2; SetPlayerInterior(playerid, 0); SetPlayerPos(playerid, RandomPlayerSpawnsarea69[rand][0], RandomPlayerSpawnsarea69[rand][1], RandomPlayerSpawnsarea69[rand][2]); ResetPlayerWeapons(playerid); GivePlayerWeapon(playerid, 24, 500000); GivePlayerWeapon(playerid, 32, 500000); GivePlayerWeapon(playerid, 28, 500000); GivePlayerWeapon(playerid, 27, 500000); GivePlayerWeapon(playerid, 34, 500000); SetPlayerVirtualWorld(playerid,110);//Area69 if(udb_Exists(pName)) { dUserSetINT(pName).("InDm",1); } } if(listitem == 2) { new pName[MAX_PLAYER_NAME]; new string [128]; if(DMZone[playerid] == 1) return ShowPlayerDialog(playerid,TELEWARN,DIALOG_STYLE_MSGBOX,"Error:","Teleporting Error!\n\n- {F3FF02}Sorry, But you can't Teleport to another area while in a Dm Zone","OK","Leave Dm"); SetPlayerHealth(playerid,100); GetPlayerName(playerid, pName, sizeof(pName)); format(string, sizeof(string), "[DM] %s has joined DeathMatch Mode [ /MINIGUN ] ", pName, playerid); SendClientMessageToAll(COLOR_TELEPORT, string); DMZone[playerid] = 3; new rand = random(sizeof(RandomPlayerSpawns)); SetPlayerPos(playerid, RandomPlayerSpawnsMinigun[rand][0], RandomPlayerSpawnsMinigun[rand][1], RandomPlayerSpawnsMinigun[rand][2]); SetPlayerInterior(playerid, 0); SendClientMessage(playerid, RED,"* Server: For leave dm type /LeaveDm"); ResetPlayerWeapons(playerid); GivePlayerWeapon(playerid, 38, 100000); if(udb_Exists(pName)) { dUserSetINT(pName).("InDm",1); } SetPlayerVirtualWorld(playerid,103);//Minigun } if(listitem == 3) { if(DMZone[playerid] == 1) return ShowPlayerDialog(playerid,TELEWARN,DIALOG_STYLE_MSGBOX,"Error:","Teleporting Error!\n\n- {F3FF02}Sorry, But you can't Teleport to another area while in a Dm Zone","OK","Leave Dm"); new rand = random(sizeof(RandomPlayerSpawns)); MapLoading(playerid); SetPlayerArmour(playerid,50); SetPlayerHealth(playerid,100); DMZone[playerid] = 6; new pName[MAX_PLAYER_NAME]; new string [128]; GetPlayerName(playerid, pName, sizeof(pName)); format(string, sizeof(string), "[DM] %s has joined DeathMatch Mode [ /WAR ] ", pName, playerid); SendClientMessageToAll(COLOR_TELEPORT, string); SendClientMessage(playerid, RED,"* Server: {FFFFFF}For leave dm type {F3FF02}/LeaveDm"); SetPlayerFacingAngle(playerid,176.60); SetPlayerPos(playerid, RandomPlayerSpawnsWar[rand][0], RandomPlayerSpawnsWar[rand][1], RandomPlayerSpawnsWar[rand][2]); ResetPlayerWeapons(playerid); GivePlayerWeapon(playerid, 31, 800000); GivePlayerWeapon(playerid, 25, 800000); GivePlayerWeapon(playerid, 23, 800000); GivePlayerWeapon(playerid, 34, 800000); GivePlayerWeapon(playerid, 16, 1); if(udb_Exists(pName)) { dUserSetINT(pName).("InDm",1); } SetPlayerVirtualWorld(playerid,100);//War } if(listitem == 4) { DMZone[playerid] = 7; new pName[MAX_PLAYER_NAME]; new string [128]; if(DMZone[playerid] == 1) return ShowPlayerDialog(playerid,TELEWARN,DIALOG_STYLE_MSGBOX,"Error:","Teleporting Error!\n\n- {F3FF02}Sorry, But you can't Teleport to another area while in a Dm Zone","OK","Leave Dm"); new rand = random(sizeof(RandomPlayerSpawns)); SetPlayerHealth(playerid,100); ResetPlayerWeapons(playerid); GivePlayerWeapon(playerid,37,9999999); GetPlayerName(playerid, pName, sizeof(pName)); format(string, sizeof(string), "[DM] %s has joined DeathMatch Mode [ /FLAME ] ", pName, playerid); SendClientMessageToAll(COLOR_TELEPORT, string); SendClientMessage(playerid, RED,"* Server: {FFFFFF}For leave dm type {F3FF02}/LeaveDm"); SetPlayerPos(playerid, RandomPlayerSpawnsFlame[rand][0], RandomPlayerSpawnsFlame[rand][1], RandomPlayerSpawnsFlame[rand][2]); SetPlayerVirtualWorld(playerid,101);//flame if(udb_Exists(pName)) { dUserSetINT(pName).("InDm",1); } } if(listitem == 5) { new pName[MAX_PLAYER_NAME]; new string [128]; if(DMZone[playerid] == 1) return ShowPlayerDialog(playerid,TELEWARN,DIALOG_STYLE_MSGBOX,"Error:","Teleporting Error!\n\n- {F3FF02}Sorry, But you can't Teleport to another area while in a Dm Zone","OK","Leave Dm"); SetPlayerHealth(playerid,100); GetPlayerName(playerid, pName, sizeof(pName)); format(string, sizeof(string), "[DM] %s has joined DeathMatch [ //WAR2 ] ", pName, playerid); SendClientMessageToAll(COLOR_TELEPORT, string); SendClientMessage(playerid, RED,"* Server: For leave dm type /LeaveDm"); DMZone[playerid] = 4; new rand = random(sizeof(RandomPlayerSpawns)); SetPlayerPos(playerid, RandomPlayerSpawnsCtd[rand][0], RandomPlayerSpawnsCtd[rand][1], RandomPlayerSpawnsCtd[rand][2]); SetPlayerInterior(playerid, 5); ResetPlayerWeapons(playerid); GivePlayerWeapon(playerid, 16, 10); GivePlayerWeapon(playerid, 31, 1000); GivePlayerWeapon(playerid, 32, 1000); if(udb_Exists(pName)) { dUserSetINT(pName).("InDm",1); } SetPlayerVirtualWorld(playerid,102);//War2 } if(listitem == 6) { new pName[MAX_PLAYER_NAME]; new string [128]; if(DMZone[playerid] == 1) return ShowPlayerDialog(playerid,TELEWARN,DIALOG_STYLE_MSGBOX,"Error:","Teleporting Error!\n\n- {F3FF02}Sorry, But you can't Teleport to another area while in a Dm Zone","OK","Leave Dm"); SetPlayerHealth(playerid,159); GetPlayerName(playerid, pName, sizeof(pName)); format(string, sizeof(string), "[DM] %s has joined DeathMatch Mode [ /SNIPER ] ", pName, playerid); SendClientMessageToAll(COLOR_TELEPORT, string); SendClientMessage(playerid, RED,"* Server: {FFFFFF}For leave dm type {F3FF02}/LeaveDm"); DMZone[playerid] = 1; new rand = random(sizeof(RandomPlayerSpawns)); SetPlayerPos(playerid, RandomPlayerSpawnsSniper[rand][0], RandomPlayerSpawnsSniper[rand][1], RandomPlayerSpawnsSniper[rand][2]); SetPlayerInterior(playerid, 0); GivePlayerWeapon(playerid, 34, 1000); if(udb_Exists(pName)) { dUserSetINT(pName).("InDm",1); } SetPlayerVirtualWorld(playerid,105);//Sniper } if(listitem == 7) { ShowPlayerDialog(playerid, COPSNROBBERS, DIALOG_STYLE_LIST, "Choose a team:", "{F3FF02}Cop Team - You should kill Robber Team, Desert Eagle-Ak47-ShotGun\n{6EF83C}Robber Team - You should kill Cop Team, Combat-ShotGun-Ak47-Sniper", "Join", "Cancel"); } if(listitem == 8) { if(DMZone[playerid] == 1) return ShowPlayerDialog(playerid,TELEWARN,DIALOG_STYLE_MSGBOX,"Error:","Teleporting Error!\n\n- {F3FF02}Sorry, But you can't Teleport to another area while in a Dm Zone","OK","Leave Dm"); MapLoading(playerid); new rand = random(sizeof(RandomPlayerSpawns)); SetPlayerHealth(playerid,100); ResetPlayerWeapons(playerid); GivePlayerWeapon(playerid, 38, 100000); new pName[MAX_PLAYER_NAME]; new string [128]; GetPlayerName(playerid, pName, sizeof(pName)); format(string, sizeof(string), "[DM] {F81414}%s {FFFFFF}has joined DeathMatch Mode {C77D87}[ /MINIGUN2 ] ", pName, playerid); SendClientMessageToAll(COLOR_TELEPORT, string); SendClientMessage(playerid, RED,"* Server: {FFFFFF}For leave dm type {F3FF02}/LeaveDm"); SetPlayerPos(playerid, RandomPlayerSpawnsMinigun2[rand][0], RandomPlayerSpawnsMinigun2[rand][1], RandomPlayerSpawnsMinigun2[rand][2]); DMZone[playerid] = 8; SetPlayerVirtualWorld(playerid,104);//minigun2 if(udb_Exists(pName)) { dUserSetINT(pName).("InDm",1); } } if(listitem == 9) { if(DMZone[playerid] > 0) return ShowPlayerDialog(playerid,TELEWARN,DIALOG_STYLE_MSGBOX,"Error:","Teleporting Error!\n\n- {F3FF02}Sorry, But you can't Teleport to another area while in a Dm Zone","OK","Leave Dm"); ShowPlayerDialog(playerid, ZombieVsHuman, DIALOG_STYLE_LIST, "Paradise Mini-Games:", "{F81414}Zombie Team - You should kill The Human Team\n{6EF83C}Human Team - You should kill Zombie Team", "Join Team", "Cancel"); } } }