Raised This Month: $ Target: $400
 0% 

[FM] cs_get_user_zoom()


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MPNumB
Veteran Member
Join Date: Feb 2007
Location: Lithuania
Old 01-23-2009 , 07:39   [FM] cs_get_user_zoom()
Reply With Quote #1

How can I format this cstrike function to fakemeta?
__________________
Skill and no annoying bugs with fixed balance issues is my goal!
My approved plugins what don't show up in Approved List:
* Bomb/Death/CSS Radar
* HotVision
___
Need help? Please check this documentation first.
MPNumB is offline
Send a message via Skype™ to MPNumB
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 01-23-2009 , 07:45   Re: [FM] cs_get_user_zoom()
Reply With Quote #2

http://forums.alliedmods.net/showpos...&postcount=163
__________________
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
MPNumB
Veteran Member
Join Date: Feb 2007
Location: Lithuania
Old 01-23-2009 , 08:33   Re: [FM] cs_get_user_zoom()
Reply With Quote #3

No function there. Only offsets.
PHP Code:
#define OFFSET_ZOOMTYPE 363

#define CS_FIRST_ZOOM 0x28 
#define CS_SECOND_AWP_ZOOM 0xA 
#define CS_SECOND_NONAWP_ZOOM 0xF 
#define CS_AUGSG552_ZOOM 0x37 
#define CS_NO_ZOOM 0x5A 
 
enum 

    
CS_RESET_ZOOM 0
    
CS_SET_NO_ZOOM
    
CS_SET_FIRST_ZOOM
    
CS_SET_SECOND_ZOOM
    
CS_SET_AUGSG552_ZOOM
}; 
__________________
Skill and no annoying bugs with fixed balance issues is my goal!
My approved plugins what don't show up in Approved List:
* Bomb/Death/CSS Radar
* HotVision
___
Need help? Please check this documentation first.
MPNumB is offline
Send a message via Skype™ to MPNumB
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 01-23-2009 , 08:37   Re: [FM] cs_get_user_zoom()
Reply With Quote #4

i dont know maybe this
PHP Code:
#define cs_get_user_zoom(%1) get_pdata_int(%1, OFFSET_ZOOMTYPE) 
__________________
xPaw is offline
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
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 01:41.


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