Raised This Month: $ Target: $400
 0% 

[Request] Some help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 10-24-2009 , 12:23   Re: [Request] Some help
Reply With Quote #7

You can use velocity setting. For example,

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

// Uncomment to use the controlled player's direction.
#define VELOCITY_BY_CONTROLLER

// I think? Adjust this.
#define RUN_SPEED 320

new gControlled[33]

public 
plugin_init()
{
    
register_plugin"Controller Mod""1.0""Hawk552" )
    
    
register_clcmd"control""CmdControl" )
}

public 
CmdControlid )
{
    new 
args[33]
    
read_argv1args32 )
    
    
gControlled[id] = get_user_indexargs )
}

public 
client_PreThinkid )
{
    if ( !
is_user_alivegControlled[id] ) )
        return
    
    new 
button pevidpev_button )
    static 
Float:velocity[3], Float:origin[3], Float:angle[3]
    
#if defined VELOCITY_BY_CONTROLLER
    
pevidpev_originorigin )  
    
pevidpev_v_angleangle 
#else
    
pevgControlled[id], pev_originorigin )  
    
pevgControlled[id], pev_v_angleangle 
#endif 

    
if ( button IN_FORWARD )
    {
        
engfuncEngFunc_MakeVectorsangle 
        
global_getglb_v_forwardvelocity 
        
        
velocity[0] = origin[0] - RUN_SPEED velocity[0]
        
velocity[1] = origin[1] - RUN_SPEED velocity[1]
        
velocity[2] = origin[2] - RUN_SPEED velocity[2]
    }
        
    
// Add more cases for the buttons...
    
    
set_pevgControlled[id], pev_velocityvelocity )
}

public 
client_disconnectid )
    
gControlled[id] = 
You'll need way more checks and code.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
 



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 17:43.


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