Raised This Month: $32 Target: $400
 8% 

fllow ent..!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 07-06-2016 , 12:50   fllow ent..!
Reply With Quote #1

Hi Evry one
My question is what is the code used it ? I want Example to achieve it ?
__________________

Last edited by abdobiskra; 07-25-2016 at 13:44.
abdobiskra is offline
Send a message via Skype™ to abdobiskra
Old 07-06-2016, 23:11
safetymoose
This message has been deleted by safetymoose.
Zynda
Member
Join Date: Jul 2011
Old 07-08-2016 , 08:06   Re: fllow ent (RPG Rocket)?
Reply With Quote #2

This sparked my interest because is just sounds so fun, so i whipped this up just now.
It is far from foolproof, but this will make the owner of any rpg_rocket 'follow' by copying the velocity to the owner every time the rpg thinks.

Things that will mess this up:
  • Shooting more than one rocket at a time
  • Moving backwards while in the air

PHP Code:

// Tested on 1.8.3-dev+

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <xs>

public plugin_init()
{
    
register_plugin"Rocketscience""1.0""Rocketman" )

    
RegisterHamHam_Think "rpg_rocket" "RocketThinkHandler" )
}

public 
RocketThinkHandlerentity )
{
    new 
id peventitypev_owner )
    
    if( 
is_user_connectedid ) && is_user_aliveid ) )
    {
        new 
iuser1 peventitypev_iuser1 )
        
        if( 
iuser1 == )
        {
            
set_peventitypev_iuser1)
            
            new 
Float:nullVelocity] = { 0.00.00.0 }
            
set_pevidpev_velocitynullVelocity )
            
            new 
Float:startVector]
            
peventitypev_originstartVector )
            
            new 
Float:destinationVector]
            
peventitypev_anglesdestinationVector )
            
            
engfuncEngFunc_MakeVectorsdestinationVector )
            
global_getglb_v_forwarddestinationVector )
            
            
xs_vec_mul_scalardestinationVector, -50.0destinationVector )
            
xs_vec_addstartVectordestinationVectordestinationVector )
            
            
engfuncEngFunc_SetOriginiddestinationVector )
        }
        else
        {
            new 
Float:rocketVelocity]
            
peventitypev_velocityrocketVelocity )
            
            
set_pevidpev_velocityrocketVelocity )
        }
    }

    return 
HAM_IGNORED


Last edited by Zynda; 07-08-2016 at 08:08.
Zynda is offline
Old 07-08-2016, 11:57
gabuch2
This message has been deleted by gabuch2. Reason: nvm I'm retarded
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 07-09-2016 , 06:52   Re: fllow ent (RPG Rocket)?
Reply With Quote #3

Zynda
I do not know how to thank you
__________________

Last edited by abdobiskra; 11-07-2017 at 06:25.
abdobiskra is offline
Send a message via Skype™ to abdobiskra
Leech_v2
Senior Member
Join Date: Mar 2011
Location: Chinese GuangDong
Old 07-09-2016 , 14:50   Re: fllow ent (RPG Rocket)?
Reply With Quote #4

Quote:
Originally Posted by abdobiskra View Post
Zynda
I do not know how to thank you
you body...
Leech_v2 is offline
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 07-10-2016 , 10:51   Re: fllow ent (RPG Rocket)?
Reply With Quote #5

Leech_v2
Here is not the place for sarcasm
stoped floding like gays idiots ...

--------------------------------------------

Zynda

i want add godmode if rocket explod in the wall for owner and disabel it if player not flying (after explod the rocket )

i have this stock :

PHP Code:
stock fm_set_user_godmode(indexgodmode 0) {
    
set_pev(indexpev_takedamagegodmode == DAMAGE_NO DAMAGE_AIM)
    return 
1

But I find it difficult to employ them can you tel me if you have any ida please ?
__________________

Last edited by abdobiskra; 07-10-2016 at 10:52.
abdobiskra is offline
Send a message via Skype™ to abdobiskra
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 07-10-2016 , 19:49   Re: fllow ent (RPG Rocket)?
Reply With Quote #6

Provide your rocket explosion code then.
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 07-11-2016 , 06:04   Re: fllow ent (RPG Rocket)?
Reply With Quote #7

Quote:
Originally Posted by meTaLiCroSS View Post
Provide your rocket explosion code then.
can you give me for Exp! (code)
__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
Zynda
Member
Join Date: Jul 2011
Old 07-11-2016 , 18:44   Re: fllow ent (RPG Rocket)?
Reply With Quote #8

Updated and tested as per request.

Now godmode is enabled just as the rocket explodes ( touches a wall, player etc.. ) then i set a timer to remove godmode after 0.5 seconds.

Also, that stock is just a wrapper, which i find to be more obscuring than helping in this case.

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <xs>

public plugin_init()
{
    
register_plugin"Rocketscience""1.0""Rocketman" )

    
RegisterHamHam_Think "rpg_rocket" "RocketThinkHandler" )
    
RegisterHamHam_Touch "rpg_rocket" "RocketTouchHandler" )
}

public 
RocketThinkHandlerentity )
{
    new 
id peventitypev_owner )
    
    if( 
is_user_connectedid ) && is_user_aliveid ) )
    {
        new 
iuser1 peventitypev_iuser1 )
        
        if( 
iuser1 == )
        {
            
set_peventitypev_iuser1)
            
            new 
Float:nullVelocity] = { 0.00.00.0 }
            
set_pevidpev_velocitynullVelocity )
            
            new 
Float:startVector]
            
peventitypev_originstartVector )
            
            new 
Float:destinationVector]
            
peventitypev_anglesdestinationVector )
            
            
engfuncEngFunc_MakeVectorsdestinationVector )
            
global_getglb_v_forwarddestinationVector )
            
            
xs_vec_mul_scalardestinationVector, -50.0destinationVector )
            
xs_vec_addstartVectordestinationVectordestinationVector )
            
            
engfuncEngFunc_SetOriginiddestinationVector )
        }
        else
        {
            new 
Float:rocketVelocity]
            
peventitypev_velocityrocketVelocity )
            
            new 
Float:playerVelocity]
            
pevidpev_velocityplayerVelocity )
            
            
set_pevidpev_velocityrocketVelocity )
        }
    }

    return 
HAM_IGNORED
}

public 
RocketTouchHandlerentity )
{
    new 
id peventitypev_owner )
    
    if( 
is_user_connectedid ) && is_user_aliveid ) )
    {
        
// Enable godmode
        
set_pevidpev_takedamageDAMAGE_NO )
        
        
// Set timer to remove godmode after 0.5 seconds
        
set_task0.5"ResetGodmode"id )
    }

    return 
HAM_IGNORED
}

public 
ResetGodmodeid )
{
    if( 
is_user_connectedid ) && is_user_aliveid ) )
    {
        
set_pevidpev_takedamageDAMAGE_AIM )
    }


Last edited by Zynda; 07-11-2016 at 18:50.
Zynda is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:10.


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