Raised This Month: $535 Target: $400
 133% 

Antizoom or Antiscope


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bojka
Junior Member
Join Date: Dec 2015
Old 12-10-2015 , 15:34   Antizoom or Antiscope
Reply With Quote #1

Hello , i would like an plugin which when a player scope with awp after 2 seconds of scoping awp to be dropped or removed from him and then to show a text line which says don't Zoom more then 2 seconds. I hope this is understandable. Sorry for my mistakes.
bojka is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 12-10-2015 , 22:25   Re: Antizoom or Antiscope
Reply With Quote #2

This will make a player drop the awp and print a message to him if he scopes for more than 2 seconds.

Allowed scope seconds set by cvar asl_scopeseconds, default 2.
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <cstrike>
#include <fakemeta>

new const Version[] = "0.1";

const 
Task_Zoom 123123;

new 
g_pScopeLimit;

public 
plugin_init() 
{
    
register_plugin"AWP Scope Limit" Version "bugsy" );
    
    
RegisterHamHam_Weapon_SecondaryAttack "weapon_awp" "AWP_SecondaryAttack_Post" true );
    
register_event"CurWeapon" "Event_CurWeapon" "b" "1=0" "2=18" );
    
    
g_pScopeLimit register_cvar"asl_scopeseconds" "2" );
}

public 
client_disconnectid )
{
    
remove_taskid Task_Zoom );
}

public 
AWP_SecondaryAttack_PostiEntity )
{
    new 
id peviEntity pev_owner );
    
    if ( 
cs_get_user_zoomid ) == )
    {
        
remove_taskid Task_Zoom );
    }
    else if ( !
task_existsid Task_Zoom ) )
    {
        
set_taskget_pcvar_floatg_pScopeLimit ) , "DropAWP" id Task_Zoom );
    }    
}

public 
Event_CurWeaponid )
{
    
remove_taskid Task_Zoom );
}

public 
DropAWPTaskID )
{
    new 
iSeconds get_pcvar_numg_pScopeLimit );
    
    
TaskID -= Task_Zoom;
    
    
engclient_cmdTaskID "drop" "weapon_awp" );
    
client_printTaskID print_chat "* Do not zoom for more than %d second%s!" iSeconds iSeconds "s" "" );

__________________

Last edited by Bugsy; 12-10-2015 at 22:32.
Bugsy is offline
Reply


Thread Tools
Display Modes

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 22:44.


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