Raised This Month: $ Target: $400
 0% 

+use Button | 3Sec Boost | 20 Sec Cooldown.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 06-27-2011 , 09:30   Re: +use Button | 3Sec Boost | 20 Sec Cooldown.
Reply With Quote #1

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

new boolg_sprint[33]
new 
cvar_speed

public plugin_init()
{
    
register_plugin("Sprint""0.1""Mini_Midget");
    
cvar_speed register_cvar("sprint_speed""400");
    
register_forwardFM_CmdStart"FMCmdStart" );
    
register_forwardFM_PlayerPreThink"FMPreThink" );
    
register_forward(FM_UpdateClientData"FMUpdateClientData"1)
    
}

public 
client_putinserver(id)
{
    
g_sprint[id] = false
}

public 
FMCmdStartiduc_handlerandseed )
{
    if (!
is_user_alive(id))
        return 
FMRES_IGNORED
        
    
if(get_uc(uc_handleUC_Buttons) & IN_USE)
    { 
        
g_sprint[id] = true
    
}
    else
    {
        
g_sprint[id] = false
    
}
    
    return 
FMRES_IGNORED
}

public 
FMPreThink(id)
{
    if (!
is_user_alive(id))
        return 
FMRES_IGNORED
    
    
static flag flag pev(idpev_flags)
    static 
button button pev(idpev_button)
    
    if ( !(
flag FL_ONGROUND) || (flag FL_DUCKING) || !(button IN_FORWARD) ) //Block not on ground or ducking or left, back, right movement keys
        
return FMRES_IGNORED
        
    
static Floatsprinting[3], Floatnormal[3]
    static 
speed speed get_pcvar_num(cvar_speed)
    
    
velocity_by_aim(idspeedsprinting//Speed
    
pev(idpev_velocitynormal)
    
sprinting[2] = normal[2]
    
    if (
g_sprint[id] == true//Walking
    
{
        
set_pev(idpev_velocitysprinting//Set the speed of sprinting
        
set_pev(idpev_buttonpev(id,pev_button) & ~IN_ATTACK);
        
set_pev(idpev_buttonpev(id,pev_button) & ~IN_ATTACK2 );    
        
engclient_cmd(id"weapon_knife")
        
//set_pev(id, pev_viewmodel2, "")
    
}
    else if (
g_sprint[id] == false//Running
    
{
        
set_pev(idpev_velocitynormal)  //Return to normal speed
    
}
    
    return 
FMRES_IGNORED
}

public 
FMUpdateClientData(idsendweaponscd_handle )
{
    if ( !
is_user_alive(id) || !g_sprint[id])
        return 
FMRES_IGNORED;

    
set_cd(cd_handleCD_ID0);        
        
    return 
FMRES_HANDLED;

__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Reply



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:29.


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