Raised This Month: $ Target: $400
 0% 

Pushing someone away


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Speed!
BANNED
Join Date: Jan 2009
Old 02-13-2009 , 13:10   Re: Pushing someone away
Reply With Quote #4

doesent work for me :S
im using this
PHP Code:
public PushPlayer(const Float:center[3])
{    
    static 
client
    
for (client 1client <= g_maxplayersclient++)
    {
        new 
Float:origin[3];
        
pev(clientpev_originorigin);
        
        new 
Float:dist get_distance_f(origincenter);
        if( 
dist PUSH_RADIUS ) return;
        
        new 
Float:speed = (1.0 - (dist PUSH_RADIUS)) * PUSH_SPEED;
        
        new 
Float:velocity[3];
        
velocity[0] = origin[0] - center[0];
        
velocity[1] = origin[1] - center[1];
        
velocity[2] = origin[2] - center[2];
            
        new 
Float:length vector_length(velocity);
        
        
velocity[0] = velocity[0] / length speed;
        
velocity[1] = velocity[1] / length speed;
        
velocity[2] = velocity[2] / length speed;
            
        new 
Float:current[3];
        
pev(clientpev_velocitycurrent);
        
        
current[0] += velocity[0];
        
current[1] += velocity[1];
        
current[2] += velocity[2];
        
        
set_pev(clientpev_velocitycurrent);
    }

Speed! 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 16:58.


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