SA-MP Forums Archive
Explosive Object? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Explosive Object? (/showthread.php?tid=265395)



Explosive Object? - Sascha - 30.06.2011

Hi guys
I'm wondering whether there is any "bomb" object that will explode automatically when it hits anything..
So.. Is there?


Re: Explosive Object? - Alvord - 30.06.2011

You could experiment on creating an object, setting a timer, and using the CreateExplosion() function. But I don't think you can make an object that blows up when it hits something.


Re: Explosive Object? - BigETI - 30.06.2011

Search for exploding barrel model ID's.
Exploding Barrels are exploding objects but still not synced with the server (the sync appears only in players stream range)


Re: Explosive Object? - Sascha - 30.06.2011

again.. I need a bomb object.. not a barell..
and a timer won't help me, 'cause if the objects hits something on its' way, it should explode directly.


Re: Explosive Object? - Amel_PAtomAXx - 30.06.2011

you can do it like this:
pawn Код:
if(strcmp(cmdtext,"/plant",true)== 0)
{
new Float:X,Float:Y,Float:Z,bomb;
GetPlayerPos(playerid,X,Y,Z);
bomb = CreateObject(ID,X,Y,Z+2,00,00,00,250); // find your object ID
return 1;
}

if(strcmp(cmdtext,"/explode",true)== 0)
{
new Float:X,Float:Y,Float:Z;
GetObjectPos(bomb,X,Y,Z);
CreateExplosion(X,Y,Z,type,Float Radius); // use explosion type what you want
DestroyObject(bomb);
return 1;
}
explosion type's can be found here

i think it will help you


Re: Explosive Object? - Sascha - 30.06.2011

I think it won't..
I need a bomb that explodes automatically.. not using a cmd..


Re: Explosive Object? - Tommy_Mandaz - 30.06.2011

Maybe create a timer and make different explosions in a couple of different coordinates?


Re: Explosive Object? - Sascha - 30.06.2011

na.. I don't want a row of explosions or so..
I'm justing asking whether there is a certain "bomb" that explodes if it hits something on it's way..
if there is not (what I guess), is there a way to do it automatically? So basicly detect if it hits anything?..


Re: Explosive Object? - Tommy_Mandaz - 30.06.2011

Maybe make it so that if the player comes near the bomb's X,Y,Z it starts and timer and explodes around the bomb?


Re: Explosive Object? - Amel_PAtomAXx - 30.06.2011

you can use like this :

pawn Код:
public OnPlayerUpdate(playerid)
{
if(IsPlayerInRangeOfPoint(playerid,1,X,Y,Z)) // X,Y,Z are cordinates of that "bomb" object
{
CreateExplosion(X,Y,Z,0,10.0);
return 1;
}

return 1;
}
try like that...