Raised This Month: $ Target: $400
 0% 

[FM] cs_get_user_zoom()


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-23-2009 , 11:11   Re: [FM] cs_get_user_zoom()
Reply With Quote #5

Not tested at all :

[Edit] Oops you wanted only *get*. Oh well, whatever.

Code:
        #include <amxmodx>     #include <fakemeta>     #include <hamsandwich>         const m_iZoomType   = 363;     const m_pActiveItem = 373;     const m_iId         = 43;         const CS_FIRST_ZOOM         = 0x28;     const CS_SECOND_AWP_ZOOM    = 0xA;     const CS_SECOND_NONAWP_ZOOM = 0xF;     const CS_AUGSG552_ZOOM      = 0x37;     const CS_NO_ZOOM            = 0x5A;         enum     {         CS_RESET_ZOOM,         CS_SET_NO_ZOOM,         CS_SET_FIRST_ZOOM,         CS_SET_SECOND_ZOOM,         CS_SET_AUGSG552_ZOOM,     };         #define MAX_CLIENTS 32         new gi_MsgResetHUD;     new gi_Zooming[ MAX_CLIENTS + 1 ];         public plugin_init ()     {         register_forward ( FM_PlayerPreThink, "Forward_PlayerPreThink" );         register_forward ( FM_MessageBegin  , "Forward_MessageBegin" );                 gi_MsgResetHUD = get_user_msgid ( "ResetHUD" );     }         public client_disconnect ( id )     {         gi_Zooming[ id ] = 0;     }         public Forward_PlayerPreThink ( const id )     {         if ( gi_Zooming[ id ] )         {             set_pdata_int ( id, m_iZoomType, gi_Zooming[ id ] );         }     }         public Forward_MessageBegin ( const msg_dest, const msg_type, const Float:vf_Origin[], const id )     {         if ( msg_type == gi_MsgResetHUD )         {             if ( gi_Zooming[ id ] )             {                 gi_Zooming[ id ] = 0;             }         }     }         stock fm_get_user_zoom ( const id )     {         switch ( get_pdata_int ( id, m_iZoomType ) )         {               case CS_NO_ZOOM       : return CS_SET_NO_ZOOM;             case CS_FIRST_ZOOM    : return CS_SET_FIRST_ZOOM;             case CS_SECOND_AWP_ZOOM, CS_SECOND_NONAWP_ZOOM : return CS_SET_SECOND_ZOOM;             case CS_AUGSG552_ZOOM : return CS_AUGSG552_ZOOM;         }                 return 0;     }         stock fm_set_user_zoom ( const id , const i_ZoomType, const i_Mode )     {         new i_Value, i_CurWeapon = get_pdata_int ( get_pdata_cbase ( id, m_pActiveItem ), m_iId );                 gi_Zooming[ id ] = 0;                 if ( i_ZoomType == CS_RESET_ZOOM )         {             set_pdata_int ( id, m_iZoomType, CS_NO_ZOOM );             return 1;         }                 switch ( i_ZoomType )         {             case CS_SET_NO_ZOOM       : i_Value = CS_NO_ZOOM;             case CS_SET_FIRST_ZOOM    : i_Value = CS_FIRST_ZOOM;             case CS_SET_SECOND_ZOOM   : i_Value = ( i_CurWeapon == CSW_G3SG1 || i_CurWeapon == CSW_SG550 || i_CurWeapon == CSW_SCOUT ) ? CS_SECOND_NONAWP_ZOOM : CS_SECOND_AWP_ZOOM;             case CS_SET_AUGSG552_ZOOM : i_Value = CS_AUGSG552_ZOOM;             default : return 0;         }                 if ( !i_Mode )         {             gi_Zooming[ id ] = i_Value;         }                 set_pdata_int ( id, m_iZoomType, i_Value );         return 1;     }

Last edited by Arkshine; 01-23-2009 at 11:22.
Arkshine is offline
 



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 01:41.


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