Raised This Month: $ Target: $400
 0% 

Force Push


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
_Master_
Senior Member
Join Date: Dec 2006
Old 05-13-2007 , 03:56   Re: Force Push
Reply With Quote #8

For use in FM_Touch:
PHP Code:
new Float:pos_ptr[3], Float:pos_ptd[3], Float:push_power get_cvar_float("knuck_force")

pev(ptrpev_originpos_ptr)
pev(ptdpev_originpos_ptd)

for(new 
02i++){
    
    
pos_ptd[i] -= pos_ptr[i]
    
pos_ptd[i] *= push_power
}

set_pev(ptdpev_velocitypos_ptd
For use in whatever:
PHP Code:
new Floatpos_idFloatpos_iFloatdistance_fFloat:push_power get_cvar_float("knuck_force")
new 
Floatdist
new players[32], numi

get_players
(playersnum"a")
pev(idpev_originpos_id)
dist get_cvar_float("distance_to")

for(new 
0numa++){
    
    
players[a]
    
pev(ipev_originpos_i)
    
    
distance_f get_distance_f(pos_idpos_i)
    if(
distance_f <= dist){
        
        for(new 
02i++){
            
            
pos_i[a] -= pos_id[a]
            
pos_i[a] *= push_power
        
}
        
        
set_pev(ipev_velocitypos_i)
    }

_Master_ is offline
 



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 06:35.


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