AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Quick scope ONLY ! (https://forums.alliedmods.net/showthread.php?t=136724)

Zpoke 08-29-2010 10:48

Quick scope ONLY !
 
hi, is it possible to make player hold the AWP scope for only 0.5 sec ?

Bugsy 08-29-2010 11:13

Re: Quick scope ONLY !
 
PHP Code:

#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>

new const Version[] = "0.3";

const 
Task_Unscope 24680;
const 
Float:ScopeTime 5.5;

new 
g_iPrevWeapon33 ];
new 
bool:g_bIsScoped33 ];

public 
plugin_init() 
{
    
register_plugin"Quick AWP Scope" Version "bugsy" );
    
    
RegisterHamHam_Weapon_SecondaryAttack "weapon_awp" "fw_AWPSecondaryAttack_Post"  );

    
register_event"CurWeapon" "fw_EvCurWeapon" "be" "1=1" );
}

public 
client_disconnectid )
{
    
g_bIsScopedid ] = false;
}

public 
fw_AWPSecondaryAttack_PostiEnt )
{
    static 
idid peviEnt pev_owner );
    
    switch ( 
cs_get_user_zoomid ) )
    {
        case 
CS_SET_FIRST_ZOOM:
        {    
            
g_bIsScopedid ] = true;
            
set_taskScopeTime "Unscope" Task_Unscope id );
        }
        case 
CS_SET_NO_ZOOM
        {
            
g_bIsScopedid ] = false;
            
remove_taskTask_Unscope id );
        }
    }
}

public 
UnscopeTaskID )
{
    static 
idid TaskID Task_Unscope;
    
    if ( 
is_user_connectedid ) )
    {
        
g_bIsScopedid ] = false;
        
cs_set_user_zoomid CS_SET_NO_ZOOM );
    }
}

public 
fw_EvCurWeaponid )
{    
    static 
iWeaponiWeapon read_data);
    
    if ( 
g_bIsScopedid ] && ( g_iPrevWeaponid ] == CSW_AWP ) && ( iWeapon != g_iPrevWeaponid ] ) )
    {
        
g_bIsScopedid ] = false;
        
remove_taskTask_Unscope id );
    }
    
    
g_iPrevWeaponid ] = iWeapon;
    
    return 
PLUGIN_CONTINUE;



Zpoke 08-29-2010 11:26

Re: Quick scope ONLY !
 
thanks !

Bugsy 08-29-2010 11:49

Re: Quick scope ONLY !
 
I just made a few fixes, use the new code.

Zpoke 08-30-2010 11:18

Re: Quick scope ONLY !
 
yes, ofc. thanks again.:mrgreen:

Bugsy 08-30-2010 20:28

Re: Quick scope ONLY !
 
Made some more adjustments to code above.

Zpoke 08-31-2010 09:20

Re: Quick scope ONLY !
 
Yes, thanks!


All times are GMT -4. The time now is 05:17.

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