AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [FM] cs_get_user_zoom() (https://forums.alliedmods.net/showthread.php?t=84260)

MPNumB 01-23-2009 07:39

[FM] cs_get_user_zoom()
 
How can I format this cstrike function to fakemeta?

AntiBots 01-23-2009 07:45

Re: [FM] cs_get_user_zoom()
 
http://forums.alliedmods.net/showpos...&postcount=163

MPNumB 01-23-2009 08:33

Re: [FM] cs_get_user_zoom()
 
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
}; 


xPaw 01-23-2009 08:37

Re: [FM] cs_get_user_zoom()
 
i dont know maybe this :o
PHP Code:

#define cs_get_user_zoom(%1) get_pdata_int(%1, OFFSET_ZOOMTYPE) 


Arkshine 01-23-2009 11:11

Re: [FM] cs_get_user_zoom()
 
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;     }


All times are GMT -4. The time now is 01:41.

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