Raised This Month: $ Target: $400
 0% 

Disable ZOOM


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
IAmReallyCool
Member
Join Date: Nov 2013
Old 01-23-2014 , 02:23   Disable ZOOM
Reply With Quote #1

How can I disable zooming for particular players on some event and then reset zoom (allow to use it for all clients)?

Last edited by IAmReallyCool; 01-23-2014 at 03:22.
IAmReallyCool is offline
Leonidddd
Member
Join Date: Apr 2012
Old 01-24-2014 , 04:30   Re: Disable ZOOM
Reply With Quote #2

Try
But i prefer to use orpheu.
Leonidddd is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-25-2014 , 06:35   Re: Disable ZOOM
Reply With Quote #3

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

#pragma semicolon 1

#define PLUGIN "No Zoom"
#define VERSION "0.0.1"

#define cm(%0)    ( sizeof(%0) - 1 )

const XO_CBASEPLAYERITEM 4;
const 
m_pPlayer 41;

const 
XO_CBASEPLAYERWEAPON 4;
const 
m_flNextSecondaryAttack 47;

new 
g_iMaxPlayers;
#define IsPlayer(%0)    ( 1 <= (%0) <= g_iMaxPlayers )

new bool:g_bBlockZoom[33];

public 
plugin_init()
{
    
register_pluginPLUGINVERSION"ConnorMcLeod" );

    new 
iZoomWeaponsIndexes[] = {
        
CSW_AWPCSW_SCOUT,        // snipers
        
CSW_SG550CSW_G3SG1,    // riffles snipers
        
CSW_SG552CSW_AUG        // riffles
    
};

    new 
szClass[32];
    for(new 
ii<sizeof(iZoomWeaponsIndexes); i++)
    {
        
get_weaponname(iZoomWeaponsIndexes[i], szClasscharsmax(szClass));
        
RegisterHam(Ham_Item_DeployszClass"OnZoomWpns_Deploy_P"true);
        
RegisterHam(Ham_Weapon_SecondaryAttackszClass"OnZoomWpns_SecondaryAttack"false);
    }

    
g_iMaxPlayers get_maxplayers();
}

public 
client_putinserverid )
{
    
g_bBlockZoom[id] = false;
}

public 
OnZoomWpns_Deploy_Pweapon )
{
    new 
id get_pdata_cbase(weaponm_pPlayerXO_CBASEPLAYERITEM);

    if( 
IsPlayer(id) && g_bBlockZoom[id] )
    {
        
set_pdata_float(weaponm_flNextSecondaryAttack9999.0XO_CBASEPLAYERWEAPON);
    }
}

public 
OnZoomWpns_SecondaryAttackweapon 
{
    new 
id get_pdata_cbase(weaponm_pPlayerXO_CBASEPLAYERITEM);

    if( 
IsPlayer(id) && g_bBlockZoom[id] )
    {
        
ExecuteHam(Ham_CS_Weapon_SendWeaponAnimweapon00);
        
set_pdata_float(weaponm_flNextSecondaryAttack9999.0XO_CBASEPLAYERWEAPON);
        return 
HAM_SUPERCEDE;
    }
    return 
HAM_IGNORED;

__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 10:14.


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