AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Get bomb origin (https://forums.alliedmods.net/showthread.php?t=239968)

ezio_auditore 05-06-2014 11:38

Get bomb origin
 
How can we get the origin of the bomb when it gets planted.
Can it be done by getting the planting player's origin? Would be better if someone will tell me :)

Backstabnoob 05-06-2014 11:44

Re: Get bomb origin
 
You should be able to find the bomb entity on the bomb_planted event from csx and then get its origin.

It won't be the same as planter's origin, because there will be some difference in the Z axis.

ezio_auditore 05-06-2014 11:47

Re: Get bomb origin
 
Oh is that it.
But can you post a code which hooks the bomb_planted event please :)

Backstabnoob 05-06-2014 11:51

Re: Get bomb origin
 
PHP Code:

#include < csx >

public bomb_plantedplanter )
{
    new 
iBomb
    
if ( ( iBomb fm_find_ent_by_model( -1"grenade""models/w_c4.mdl" ) ) )  
    {
        new 
FloatfVecOrigin]
        
peviBombpev_originfVecOrigin )
    }


It's a forward, it will get called automatically.

ezio_auditore 05-06-2014 11:55

Re: Get bomb origin
 
Quote:

Originally Posted by Backstabnoob (Post 2134478)
PHP Code:

#include < csx >
 
public bomb_plantedplanter )
{
    new 
iBomb
    
if ( ( iBomb fm_find_ent_by_model( -1"grenade""models/w_c4.mdl" ) ) )  
    {
        new 
FloatfVecOrigin]
        
peviBombpev_originfVecOrigin )
    }


It's a forward, it will get called automatically.

Thanks a lot...
but I have a question.
will
Code:
fm_find_ent_by_model()
required fakemeta_util

Backstabnoob 05-06-2014 11:57

Re: Get bomb origin
 
Just copy it from fakemeta_util or look how it's done, I copy pasted it from ven's thread

ezio_auditore 05-06-2014 11:59

Re: Get bomb origin
 
Oh thats it...
Thanks by the way.
You did a great help bud :)


All times are GMT -4. The time now is 09:36.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.