AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Weapon firing error (https://forums.alliedmods.net/showthread.php?t=131755)

Lure.d 07-08-2010 14:58

Weapon firing error
 
Hi, I successfully made it to block reloading if ammo is 5 or > .
But when it comes to firing a weapon, i can't seem to make it.
I want it to be able to shoot each 1 seccond, and if it hasn't come i just returned
that it was handled by fakemeta( FMRES_HANDLED )

Thing is even THAT doesn't work, and when i shoot its just like a non-stopping 1ms
taking to shoot firing - its very fast, and ACTUALLY don't hit people, glass any other ent's.
So thats why im asking how to fix it, since i wan't the scout to fire each 1 second, not each 1ms...


PHP Code:

public fw_CmdStartclientuc_handleseed )
{
    
// Ignore dead/those who haven't our weapon
    
new ammoclipweapon get_user_weaponclientclipammo );
    if ( !
is_user_aliveclient ) || !g_has_scoutclient ] || weapon != CSW_SCOUT )
        return 
FMRES_IGNORED;
    
    
// Buttons    
    
new buttons get_ucuc_handleUC_Buttons );
    
    if( 
buttons IN_RELOAD )
    {
        if( 
clip >= )
        {
            
buttons &= ~IN_RELOAD;
            
set_ucuc_handleUC_Buttonsbuttons );
            return 
FMRES_HANDLED;
        }
    }
    
    if( 
buttons IN_ATTACK )
    {
        if( 
clip >= )
        {
            if( 
get_gametime( ) - g_lastclient ] > 1.0 )
            {
                
g_lastclient ] = get_gametime( );
                
cs_set_weapon_ammofind_ent_by_owner( -1"weapon_scout"client ), cs_get_weapon_ammoclient ) - );
                
buttons &= ~IN_ATTACK;
                
set_ucuc_handleUC_Buttonsbuttons );
                return 
FMRES_IGNORED;
            }
            else
            {
                
buttons &= ~IN_ATTACK;
                
set_ucuc_handleUC_Buttonsbuttons );
                return 
FMRES_HANDLED;
            }
        }
    }
    
    return 
FMRES_IGNORED;



drekes 07-08-2010 16:17

Re: Weapon firing error
 
isn't it
PHP Code:

FMRES_SUPERCEDE

when you are trying to block something?

Lure.d 07-08-2010 16:49

Re: Weapon firing error
 
supercede work same good as handled on reload, and on firing its not changing anything ;)

Sylwester 07-08-2010 17:23

Re: Weapon firing error
 
If you want to change fire rate then take a look at this plugin:
http://forums.alliedmods.net/showthread.php?p=597185

Lure.d 07-08-2010 18:42

Re: Weapon firing error
 
thanks! that's what i've been searching for :P


All times are GMT -4. The time now is 07:11.

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