Szerző Téma: Bomba  (Megtekintve 912 alkalommal)

Bomba
« Dátum: 2011. december 01. - 17:40:39 »
+1 Show voters
Helló!
van ez a script:
 
#define FILTERSCRIPT
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_RED 0xAA3333AA
#include <a_samp>
enum HydrogenBomb
{
Nuke,
Float:x,
Float:y,
Float:z,
bool:bombactive,
timer,
shock,
count,
area
};
new NuclearBomb[MAX_PLAYERS][HydrogenBomb];
new bool:PlayerPushed[MAX_PLAYERS];
new bool:detonated[MAX_PLAYERS];
public OnFilterScriptInit()
{
print(\"\\n--------------------------------------\");
print(\" Hydrogen Bomb \");
print(\"--------------------------------------\\n\");
for(new i=0;i<MAX_PLAYERS;i++)
{
NuclearBomb[bombactive] = false;
NuclearBomb[count] = 0;
NuclearBomb[area] = 0;
PlayerPushed = false;
detonated = false;
}
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, \"/plantbomb\", true) == 0)
{
    if(!NuclearBomb[playerid][bombactive])
    {
    new Float:bx, Float:by, Float:bz, Float:ba;
    GetPlayerPos(playerid, bx, by, bz);
    GetPlayerFacingAngle(playerid, ba);
    bx += (floatsin(-ba, degrees));
    by += (floatcos(-ba, degrees));
   NuclearBomb[playerid][Nuke] = CreateObject(3786, bx, by, bz, 0, 0, ba);
   NuclearBomb[playerid]
  • = bx;

   NuclearBomb[playerid][y] = by;
   NuclearBomb[playerid][z] = bz;
   NuclearBomb[playerid][area] = 0;
        ApplyAnimation(playerid, \"BOMBER\",\"BOM_Plant_In\",4.0,0,0,0,0,0);
   NuclearBomb[playerid][bombactive] = true;
   detonated[playerid] = false;
   SendClientMessage(playerid, COLOR_LIGHTBLUE, \"Bomb planted. Flee the area.\");
}
else return SendClientMessage(playerid, COLOR_RED, \"You\'ve already planted a bomb!\");
}
if(strcmp(cmdtext, \"/detonate\", true) == 0)
{
    if(NuclearBomb[playerid][bombactive])
    {
        NuclearBomb[playerid][timer] = SetTimerEx(\"Detonation\", 250, 1, \"i\", playerid);
        DestroyObject(NuclearBomb[playerid][Nuke]);
   SendClientMessage(playerid, COLOR_LIGHTBLUE, \"Bomb detonated.\");
    }
    else return SendClientMessage(playerid, COLOR_RED, \"You haven\'t planted a bomb!\");
}
return 0;
}
forward Detonation(playerid);
public Detonation(playerid)
{
if(NuclearBomb[playerid][count] == 0)
{
       CreateExplosion(NuclearBomb[playerid]
  • , NuclearBomb[playerid][y], NuclearBomb[playerid][z], 7, 10);

}
else if(NuclearBomb[playerid][count] == 1)
{
       CreateExplosion(NuclearBomb[playerid]
  • , NuclearBomb[playerid][y], NuclearBomb[playerid][z], 7, 10);

       CreateExplosion(NuclearBomb[playerid]
  • , NuclearBomb[playerid][y], NuclearBomb[playerid][z]+3, 7, 10);

}
else if(NuclearBomb[playerid][count] == 2)
{
       CreateExplosion(NuclearBomb[playerid]
  • , NuclearBomb[playerid][y], NuclearBomb[playerid][z], 7, 10);

       CreateExplosion(NuclearBomb[playerid]
  • , NuclearBomb[playerid][y], NuclearBomb[playerid][z]+3, 7, 10);

       CreateExplosion(NuclearBomb[playerid]
  • , NuclearBomb[playerid][y], NuclearBomb[playerid][z]+6, 7, 10);

}
else if(NuclearBomb[playerid][count] == 3)
{
       CreateExplosion(NuclearBomb[playerid]
  • , NuclearBomb[playerid][y], NuclearBomb[playerid][z]+3, 7, 10);

       CreateExplosion(NuclearBomb[playerid]
  • , NuclearBomb[playerid][y], NuclearBomb[playerid][z]+6, 7, 10);

       CreateExplosion(NuclearBomb[playerid]
  • , NuclearBomb[playerid][y], NuclearBomb[playerid][z]+9, 7, 10);

}
    else if(NuclearBomb[playerid][count] == 4)
{
       CreateExplosion(NuclearBomb[playerid]
  • , NuclearBomb[playerid][y], NuclearBomb[playerid][z]+6, 7, 10);

       CreateExplosion(NuclearBomb[playerid]
  • , NuclearBomb[playerid][y], NuclearBomb[playerid][z]+9, 7, 10);

CreateExplosion(NuclearBomb[playerid]
  • , NuclearBomb[playerid][y], NuclearBomb[playerid][z]+12, 7, 10);

}
    else if(NuclearBomb[playerid][count] == 5)
{
       CreateExplosion(NuclearBomb[playerid]
  • , NuclearBomb[playerid][y], NuclearBomb[playerid][z]+9, 7, 10);

CreateExplosion(NuclearBomb[playerid]
  • , NuclearBomb[playerid][y], NuclearBomb[playerid][z]+12, 7, 10);

CreateExplosion(NuclearBomb[playerid]
  • , NuclearBomb[playerid][y], NuclearBomb[playerid][z]+15, 7, 10);

}
    else if(NuclearBomb[playerid][count] == 6)
{
CreateExplosion(NuclearBomb[playerid]
  • , NuclearBomb[playerid][y], NuclearBomb[playerid][z]+12, 7, 10);

CreateExplosion(NuclearBomb[playerid]
  • , NuclearBomb[playerid][y], NuclearBomb[playerid][z]+15, 7, 10);

CreateExplosion(NuclearBomb[playerid]
  • , NuclearBomb[playerid][y], NuclearBomb[playerid][z]+18, 7, 10);

}
    else if(NuclearBomb[playerid][count] == 7)
{
CreateExplosion(NuclearBomb[playerid]
  • , NuclearBomb[playerid][y], NuclearBomb[playerid][z]+15, 7, 10);

CreateExplosion(NuclearBomb[playerid]
  • , NuclearBomb[playerid][y], NuclearBomb[playerid][z]+18, 7, 10);

CreateExplosion(NuclearBomb[playerid]
  • , NuclearBomb[playerid][y], NuclearBomb[playerid][z]+21, 7, 10);

}
    else if(NuclearBomb[playerid][count] == 9)
{
CreateExplosion(NuclearBomb[playerid]
  • , NuclearBomb[playerid][y], NuclearBomb[playerid][z]+18, 7, 10);

CreateExplosion(NuclearBomb[playerid]
  • , NuclearBomb[playerid][y], NuclearBomb[playerid][z]+21, 7, 10);

CreateExplosion(NuclearBomb[playerid]
  • , NuclearBomb[playerid][y], NuclearBomb[playerid][z]+24, 7, 10);

    CreateExplosion(NuclearBomb[playerid]
  • , NuclearBomb[playerid][y]+10, NuclearBomb[playerid][z]+24, 7, 10);

    CreateExplosion(NuclearBomb[playerid]
  • , NuclearBomb[playerid][y]-10, NuclearBomb[playerid][z]+24, 7, 10);

    CreateExplosion(NuclearBomb[playerid]
  • +10, NuclearBomb[playerid][y], NuclearBomb[playerid][z]+24, 7, 10);

    CreateExplosion(NuclearBomb[playerid]
  • -10, NuclearBomb[playerid][y], NuclearBomb[playerid][z]+24, 7, 10);

}
else if(NuclearBomb[playerid][count] == 10)
{
CreateExplosion(NuclearBomb[playerid]
  • , NuclearBomb[playerid][y], NuclearBomb[playerid][z]+21, 7, 10);

CreateExplosion(NuclearBomb[playerid]
  • , NuclearBomb[playerid][y], NuclearBomb[playerid][z]+24, 7, 10);

    CreateExplosion(NuclearBomb[playerid]
  • , NuclearBomb[playerid][y]+10, NuclearBomb[playerid][z]+24, 7, 10);

    CreateExplosion(NuclearBomb[playerid]
  • , NuclearBomb[playerid][y]-10, NuclearBomb[playerid][z]+24, 7, 10);

    CreateExplosion(NuclearBomb[playerid]
  • +10, NuclearBomb[playerid][y], NuclearBomb[playerid][z]+24, 7, 10);

    CreateExplosion(NuclearBomb[playerid]
  • -10, NuclearBomb[playerid][y], NuclearBomb[playerid][z]+24, 7, 10);

    CreateExplosion(NuclearBomb[playerid]
  • , NuclearBomb[playerid][y], NuclearBomb[playerid][z]+27, 7, 10);

    CreateExplosion(NuclearBomb[playerid]
  • , NuclearBomb[playerid][y]+7, NuclearBomb[playerid][z]+27, 7, 10);

    CreateExplosion(NuclearBomb[playerid]
  • , NuclearBomb[playerid][y]-7, NuclearBomb[playerid][z]+27, 7, 10);

    CreateExplosion(NuclearBomb[playerid]
  • +7, NuclearBomb[playerid][y], NuclearBomb[playerid][z]+27, 7, 10);

    CreateExplosion(NuclearBomb[playerid]
  • -7, NuclearBomb[playerid][y], NuclearBomb[playerid][z]+27, 7, 10);

}
else if(NuclearBomb[playerid][count] >= 11)
{
CreateExplosion(NuclearBomb[playerid]
  • , NuclearBomb[playerid][y], NuclearBomb[playerid][z]+24, 7, 10);

    CreateExplosion(NuclearBomb[playerid]
  • , NuclearBomb[playerid][y]+10, NuclearBomb[playerid][z]+24, 7, 10);

    CreateExplosion(NuclearBomb[playerid]
  • , NuclearBomb[playerid][y]-10, NuclearBomb[playerid][z]+24, 7, 10);

    CreateExplosion(NuclearBomb[playerid]
  • +10, NuclearBomb[playerid][y], NuclearBomb[playerid][z]+24, 7, 10);

    CreateExplosion(NuclearBomb[playerid]
  • -10, NuclearBomb[playerid][y], NuclearBomb[playerid][z]+24, 7, 10);

    CreateExplosion(NuclearBomb[playerid]
  • , NuclearBomb[playerid][y], NuclearBomb[playerid][z]+27, 7, 10);

    CreateExplosion(NuclearBomb[playerid]
  • , NuclearBomb[playerid][y]+7, NuclearBomb[playerid][z]+27, 7, 10);

    CreateExplosion(NuclearBomb[playerid]
  • , NuclearBomb[playerid][y]-7, NuclearBomb[playerid][z]+27, 7, 10);

    CreateExplosion(NuclearBomb[playerid]
  • +7, NuclearBomb[playerid][y], NuclearBomb[playerid][z]+27, 7, 10);

    CreateExplosion(NuclearBomb[playerid]
  • -7, NuclearBomb[playerid][y], NuclearBomb[playerid][z]+27, 7, 10);

    CreateExplosion(NuclearBomb[playerid]
  • , NuclearBomb[playerid][y], NuclearBomb[playerid][z]+30, 7, 10);

    CreateExplosion(NuclearBomb[playerid]
  • , NuclearBomb[playerid][y]+3, NuclearBomb[playerid][z]+30, 7, 10);

    CreateExplosion(NuclearBomb[playerid]
  • , NuclearBomb[playerid][y]-3, NuclearBomb[playerid][z]+30, 7, 10);

    CreateExplosion(NuclearBomb[playerid]
  • +3, NuclearBomb[playerid][y], NuclearBomb[playerid][z]+30, 7, 10);

    CreateExplosion(NuclearBomb[playerid]
  • -3, NuclearBomb[playerid][y], NuclearBomb[playerid][z]+30, 7, 10);

    KillTimer(NuclearBomb[playerid][timer]);
    NuclearBomb[playerid][count] = 0;
    NuclearBomb[playerid][bombactive] = false;
}
if(!detonated[playerid])
{
       NuclearBomb[playerid][shock] = SetTimerEx(\"Shockwave\", 500, 1, \"i\", playerid);
detonated[playerid] = true;
}
NuclearBomb[playerid][count]++;
return 0;
}
forward Shockwave(playerid);
public Shockwave(playerid)
{
NuclearBomb[playerid][area]+= 100;
for(new sz=0; sz<MAX_PLAYERS;sz++)
{
    if(PlayerToPoint(NuclearBomb[playerid][area], sz, NuclearBomb[playerid]
  • , NuclearBomb[playerid][y], NuclearBomb[playerid][z])/* && !PlayerPushed[sz]*/)

    {
        PushPlayer(sz, NuclearBomb[playerid]
  • , NuclearBomb[playerid][y]);

        PlayerPushed[sz] = true;
    }
}
if(NuclearBomb[playerid][area] >= 1000)
{
    NuclearBomb[playerid][area] = 0;
    for(new pz=0;pz<MAX_PLAYERS;pz++) PlayerPushed[pz] = false;
    detonated[playerid] = false;
    KillTimer(NuclearBomb[playerid][shock]);
}
return 0;
}
stock PushPlayer(playerid, Float:X, Float:Y)
{
new
   Float:pX,
   Float:pY,
   Float:pZ;
GetPlayerPos(playerid, pX, pY, pZ);
new Float:ang = (-acos((X - pX) / floatsqroot((X - pX)*(X - pX) + (Y - pY)*(Y - pY))) - 90.0);
pX = (-3 * floatsin(-ang, degrees));
pY = (-3 * floatcos(-ang, degrees));
if(GetPlayerState(playerid) == 2)
{
SetVehicleVelocity(GetPlayerVehicleID(playerid), pX, pY, 1.0);
SetVehicleHealth(GetPlayerVehicleID(playerid), 0.0);
}
else if(GetPlayerState(playerid) == 1)
{
SetPlayerVelocity(playerid, pX, pY, 1.0);
}
SetPlayerHealth(playerid, 1.0);
return 0;
}
PlayerToPoint(Float:radius, playerid, Float:X, Float:Y, Float:Z)
{
    new Float:oldpos[3], Float:temppos[3];
    GetPlayerPos(playerid, oldpos[0], oldpos[1], oldpos[2]);
    temppos[0] = (oldpos[0] -X);
    temppos[1] = (oldpos[1] -Y);
    temppos[2] = (oldpos[2] -Z);
    if(((temppos[0] < radius) && (temppos[0] > -radius)) && ((temppos[1] < radius) && (temppos[1] > -radius)) && ((temppos[2] < radius) && (temppos[2] > -radius)))
    {
        return true;
    }
    return false;
}

 
és azt hogy tudnám megcsinálni hogy több helyen is robbanjon
ugy mint ha oda is leraktam volna
pl. ezeken a pontokon:
228.9350,2487.7087,16.4844
224.3014,1882.8418,17.6406

Nem elérhető Bazsi

  • 345
    • Profil megtekintése
Bomba
« Válasz #1 Dátum: 2011. december 01. - 17:54:38 »
0 Show voters
Kiveszed ezt a részt:[pawn]if(!NuclearBomb[playerid][bombactive])[/pawn] a /plantbomb alól és akkor többet is tudsz rakni elvileg...

Bomba
« Válasz #2 Dátum: 2011. december 01. - 19:18:33 »
+1 Show voters
Idézetet írta: Bazsi date=1322758478\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"13879\" data-ipsquote-contentclass=\"forums_Topic
Kiveszed ezt a részt:[pawn]if(!NuclearBomb[playerid][bombactive])[/pawn] a /plantbomb alól és akkor többet is tudsz rakni elvileg...
 
de attól még oda is lerakja ahol éppen beírom?

Nem elérhető Bazsi

  • 345
    • Profil megtekintése
Bomba
« Válasz #3 Dátum: 2011. december 01. - 19:34:02 »
0 Show voters
Hát akkor ha beírod, akkor oda lerakja, ahol vagy és utána ha máshol megint beírod, akkor oda is lerakja és elvileg mind a két helyen lehet robbantani egyszerre...

Bomba
« Válasz #4 Dátum: 2011. december 03. - 09:42:37 »
+1 Show voters
nem megy, csak ott robban ahol lerakom

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal