Raised This Month: $ Target: $400
 0% 

Quick scope ONLY !


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Zpoke
Senior Member
Join Date: Aug 2009
Location: Sweden
Old 08-29-2010 , 10:48   Quick scope ONLY !
Reply With Quote #1

hi, is it possible to make player hold the AWP scope for only 0.5 sec ?
Zpoke is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-29-2010 , 11:13   Re: Quick scope ONLY !
Reply With Quote #2

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;

__________________

Last edited by Bugsy; 08-31-2010 at 14:05.
Bugsy is offline
Zpoke
Senior Member
Join Date: Aug 2009
Location: Sweden
Old 08-29-2010 , 11:26   Re: Quick scope ONLY !
Reply With Quote #3

thanks !
Zpoke is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-29-2010 , 11:49   Re: Quick scope ONLY !
Reply With Quote #4

I just made a few fixes, use the new code.
__________________
Bugsy is offline
Zpoke
Senior Member
Join Date: Aug 2009
Location: Sweden
Old 08-30-2010 , 11:18   Re: Quick scope ONLY !
Reply With Quote #5

yes, ofc. thanks again.
Zpoke is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-30-2010 , 20:28   Re: Quick scope ONLY !
Reply With Quote #6

Made some more adjustments to code above.
__________________
Bugsy is offline
Zpoke
Senior Member
Join Date: Aug 2009
Location: Sweden
Old 08-31-2010 , 09:20   Re: Quick scope ONLY !
Reply With Quote #7

Yes, thanks!
Zpoke 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 05:17.


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