#define MAX_YARIS 10 new listiemCek[MAX_YARIS] = 1;
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == yarisSilMenu) // The problem is here. { if(response) { for(new i = 1; i < sizeof(yarisIslem); i++) { if(listitem == listiemCek[i]) { new str[128]; format(str,sizeof(str),"%s isimli yarış başarıyla silindi !",yarisIslem[listiemCek[i]][yarisIsmi]); SendClientMessage(playerid,0x00FF00FF,str); new yolcek[128]; format(yolcek, sizeof(yolcek), yarisKlasor, listiemCek); if(fexist(yolcek)) { if(yarisIslem[listiemCek[i]][count]) DestroyDynamicCP(yarisIslem[listiemCek[i]][count]); if(yarisIslem[listiemCek[i]][count2]) DestroyDynamicCP(yarisIslem[listiemCek[i]][count2]); yarisIslem[listiemCek[i]][yarisIsmi] = -1; yarisIslem[listiemCek[i]][yarisAraci] = 0; yarisIslem[listiemCek[i]][CPKayitX] = 0.0; yarisIslem[listiemCek[i]][CPKayitY] = 0.0; yarisIslem[listiemCek[i]][CPKayitZ] = 0.0; yarisIslem[listiemCek[i]][CPNextX] = 0.0; yarisIslem[listiemCek[i]][CPNextY] = 0.0; yarisIslem[listiemCek[i]][CPNextZ] = 0.0; yarisIslem[listiemCek[i]][Pos1X] = 0.0; yarisIslem[listiemCek[i]][Pos1Y] = 0.0; yarisIslem[listiemCek[i]][Pos1Z] = 0.0; yarisIslem[listiemCek[i]][Pos1A] = 0.0; yarisIslem[listiemCek[i]][Pos2X] = 0.0; yarisIslem[listiemCek[i]][Pos2Y] = 0.0; yarisIslem[listiemCek[i]][Pos2Z] = 0.0; yarisIslem[listiemCek[i]][Pos2A] = 0.0; yarisIslem[listiemCek[i]][Pos3X] = 0.0; yarisIslem[listiemCek[i]][Pos3Y] = 0.0; yarisIslem[listiemCek[i]][Pos3Z] = 0.0; yarisIslem[listiemCek[i]][Pos3A] = 0.0; yarisIslem[listiemCek[i]][Pos4X] = 0.0; yarisIslem[listiemCek[i]][Pos4Y] = 0.0; yarisIslem[listiemCek[i]][Pos4Z] = 0.0; yarisIslem[listiemCek[i]][Pos4A] = 0.0; yarisIslem[listiemCek[i]][Pos5X] = 0.0; yarisIslem[listiemCek[i]][Pos5Y] = 0.0; yarisIslem[listiemCek[i]][Pos5Z] = 0.0; yarisIslem[listiemCek[i]][Pos5A] = 0.0; yarisIslem[listiemCek[i]][Pos6X] = 0.0; yarisIslem[listiemCek[i]][Pos6Y] = 0.0; yarisIslem[listiemCek[i]][Pos6Z] = 0.0; yarisIslem[listiemCek[i]][Pos6A] = 0.0; yarisIslem[listiemCek[i]][Pos7X] = 0.0; yarisIslem[listiemCek[i]][Pos7Y] = 0.0; yarisIslem[listiemCek[i]][Pos7Z] = 0.0; yarisIslem[listiemCek[i]][Pos7A] = 0.0; yarisIslem[listiemCek[i]][Pos8X] = 0.0; yarisIslem[listiemCek[i]][Pos8Y] = 0.0; yarisIslem[listiemCek[i]][Pos8Z] = 0.0; yarisIslem[listiemCek[i]][Pos8A] = 0.0; yarisIslem[listiemCek[i]][Pos9X] = 0.0; yarisIslem[listiemCek[i]][Pos9Y] = 0.0; yarisIslem[listiemCek[i]][Pos9Z] = 0.0; yarisIslem[listiemCek[i]][Pos9A] = 0.0; yarisIslem[listiemCek[i]][Pos10X] = 0.0; yarisIslem[listiemCek[i]][Pos10Y] = 0.0; yarisIslem[listiemCek[i]][Pos10Z] = 0.0; yarisIslem[listiemCek[i]][Pos10A] = 0.0; yarisIslem[listiemCek[i]][SpawnSayisi] = 0; fremove(yolcek); listiemCek[i] = 0; } } } } } return 1; }
forward YarisSilmeMenusu(playerid); public YarisSilmeMenusu(playerid) { new String[512],countX = 0; for(new i = 1; i < sizeof(yarisIslem); i++) { countX++; format(String, sizeof(String), "%s%s\n", String, yarisIslem[i][yarisIsmi]); listiemCek[i]++; } if(countX == 0) return SendClientMessage(playerid,0xFF0000FF,"Herhangi bir yarış oluşturulmamış."); ShowPlayerDialog(playerid, yarisSilMenu, DIALOG_STYLE_LIST, "Yarış Silin", String, "Sil", "Kapat"); return 1; }