Bomb won't explode :/
#1

Well, the object is destroyed and all, but there's no explosion.

pawn Код:
public ExplodeBomb(bombid)
{
    new Float:x, Float:z, Float:y;
    GetObjectPos(bombid, x, y, z);
    DestroyObject(BombObject[bombid]);
    BombObject[bombid] = INVALID_OBJECT_ID;
    CreateExplosion(x,y,z, 7, 25);
    return 1;
}
Reply
#2

I'm not sure if the PAWN compiler does this by itself, still, try adding a .0 after your 25 because that's a float.

If it doesn't work then i have no idea...
Reply
#3

Still no explosion :/
Reply
#4

could you show us your /placebomb command?
before you do that (to let us verify that the bombs position got set properly), have a look at bluebbery acres, position 0.0, 0.0, 3.0 and tell us if you hear/see the explosion happening there when you explode it.
ARGH cancel the upper shit. i leave it here to let you see how easy it is to fail:
pawn Код:
public ExplodeBomb(bombid)
{
    new Float:x, Float:z, Float:y;
    GetObjectPos(BombObject[bombid], x, y, z);
    DestroyObject(BombObject[bombid]);
    BombObject[bombid] = INVALID_OBJECT_ID;
    CreateExplosion(x,y,z, 7, 25);
    return 1;
}
see the difference? ^^
GetObjectPos(bombid, x, y, z); <- here the bombid is the variable,
GetObjectPos(BombObject[bombid], x, y, z); <- while its used as pointer here...

bombid=0
BombObject[0]=any id returned by createobject()

btw: its one of the most common programming issues: swapping a variable with a pointer. the human brain cant handle that "natively" lol
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)