new Menu:CurrentMenu = GetPlayerMenu(playerid);
if(CurrentMenu == BOMB)
{
switch(row)//rot,gelb,grün,blau
{
case 0://rot
{
GetPlayerPos(playerid, PlayerExplosionX[1], PlayerExplosionY[1], PlayerExplosionZ[1]);
SendClientMessage(playerid, COLOR_LIGHTRED, "Bombe wurde gelegt! Du hast den ROTEN Draht genommen!");
bombe = CreatePickup(1252,1,PlayerExplosionX[1], PlayerExplosionY[1], PlayerExplosionZ[1],-1);
ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
bombexplotimer = SetTimerEx("bombexplode",300000,0,"i",playerid);
BombStatus = 1;
Bombactivated=1;
bombdrahtchoosen = 1;
bombdraht1 = 1;
bombdraht2 = 0;
bombdraht3 = 0;
bombdraht4 = 0;
bombzone = GangZoneCreate(PlayerExplosionX[1]-random(60), PlayerExplosionY[1]-random(60), PlayerExplosionX[1]+random(60), PlayerExplosionY[1]+random(60));
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsACop(i))
{
SendClientMessage(i,COLOR_RED,"BOMBENALARM: Es wurde eine Bombe gelegt!");
GangZoneShowForPlayer(i,bombzone,COLOR_RED);
GangZoneFlashForPlayer(i,bombzone,COLOR_GREEN);
if(IsPlayerInFrac(i, 22))
{
SendClientMessage(i, COLOR_RED, "ZENTRALE: Es wurde eine Bombe gelegt!");
SendClientMessage(i, COLOR_RED, "ZENTRALE: Das Gebiet blinkt rot - grün.");
SendClientMessage(i, COLOR_RED, "ZENTRALE: Begeben sie sich sofort zur Basis!");
GangZoneShowForPlayer(i,bombzone,COLOR_RED);
GangZoneFlashForPlayer(i,bombzone,COLOR_GREEN);
}
}
}
}
case 1://gelb maul kadoffel
{
GetPlayerPos(playerid, PlayerExplosionX[1], PlayerExplosionY[1], PlayerExplosionZ[1]);
SendClientMessage(playerid, COLOR_LIGHTRED, "Bombe wurde gelegt! Du hast den GELBEN Draht genommen!");
bombe = CreatePickup(1252,1,PlayerExplosionX[1], PlayerExplosionY[1], PlayerExplosionZ[1],-1);
ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
bombexplotimer = SetTimerEx("bombexplode",300000,0,"i",playerid);
BombStatus = 1;
Bombactivated=1;
bombdrahtchoosen = 1;
bombdraht1 = 0;
bombdraht2 = 1;
bombdraht3 = 0;
bombdraht4 = 0;
bombzone = GangZoneCreate(PlayerExplosionX[1]-random(60), PlayerExplosionY[1]-random(60), PlayerExplosionX[1]+random(60), PlayerExplosionY[1]+random(60));
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsACop(i))
{
SendClientMessage(i,COLOR_RED,"BOMBENALARM: Es wurde eine Bombe gelegt!");
GangZoneShowForPlayer(i,bombzone,COLOR_RED);
GangZoneFlashForPlayer(i,bombzone,COLOR_GREEN);
}
}
}
case 2://grün
{
GetPlayerPos(playerid, PlayerExplosionX[1], PlayerExplosionY[1], PlayerExplosionZ[1]);
SendClientMessage(playerid, COLOR_LIGHTRED, "Bombe wurde gelegt! Du hast den GRÜNEN Draht genommen!");
bombe = CreatePickup(1252,1,PlayerExplosionX[1], PlayerExplosionY[1], PlayerExplosionZ[1],-1);
ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
bombexplotimer = SetTimerEx("bombexplode",300000,0,"i",playerid);
BombStatus = 1;
Bombactivated=1;
bombdrahtchoosen = 1;
bombdraht1 = 0;
bombdraht2 = 0;
bombdraht3 = 1;
bombdraht4 = 0;
bombzone = GangZoneCreate(PlayerExplosionX[1]-random(60), PlayerExplosionY[1]-random(60), PlayerExplosionX[1]+random(60), PlayerExplosionY[1]+random(60));
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsACop(i))
{
SendClientMessage(i,COLOR_RED,"BOMBENALARM: Es wurde eine Bombe gelegt!");
GangZoneShowForPlayer(i,bombzone,COLOR_RED);
GangZoneFlashForPlayer(i,bombzone,COLOR_GREEN);
}
}
}
case 3://blau
{
GetPlayerPos(playerid, PlayerExplosionX[1], PlayerExplosionY[1], PlayerExplosionZ[1]);
SendClientMessage(playerid, COLOR_LIGHTRED, "Bombe wurde gelegt! Du hast den BLAUEN Draht genommen!");
bombe = CreatePickup(1252,1,PlayerExplosionX[1], PlayerExplosionY[1], PlayerExplosionZ[1],-1);
ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
bombexplotimer = SetTimerEx("bombexplode",300000,0,"i",playerid);
BombStatus = 1;
Bombactivated=1;
bombdrahtchoosen = 1;
bombdraht1 = 0;
bombdraht2 = 0;
bombdraht3 = 0;
bombdraht4 = 1;
bombzone = GangZoneCreate(PlayerExplosionX[1]-random(60), PlayerExplosionY[1]-random(60), PlayerExplosionX[1]+random(60), PlayerExplosionY[1]+random(60));
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsACop(i))
{
SendClientMessage(i,COLOR_RED,"BOMBENALARM: Es wurde eine Bombe gelegt!");
GangZoneShowForPlayer(i,bombzone,COLOR_RED);
GangZoneFlashForPlayer(i,bombzone,COLOR_GREEN);
}
}
}
}
}
Teste es mal. Ich glaube nicht, dass es funktioniert, weil hier immer noch Code fehlt.
Außerdem ist der Code wirklich chaotisch.
Wenn es immer noch explodiert, kannst du ja vor dr Explosion das einfügen:
if(Bombactivated == 0) return 1;