Explosive Object?
#1

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

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.
Reply
#3

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)
Reply
#4

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.
Reply
#5

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
Reply
#6

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

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

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?..
Reply
#9

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?
Reply
#10

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...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)