Raised This Month: $ Target: $400
 0% 

Give nightvision for spects


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-17-2007 , 03:12   Re: Give nightvision for spects
Reply With Quote #5

Try this .

EDIT: I'm not sure to understand well. Do you want to get nvg after / death / choosing spectator / both ? This code below is both.

Code:
    #include <amxmodx>     #include <fakemeta>     new g_iMsg_NvgToggle;         #define HAS_NVGOGGLES ( 1 << 0 )         #define OFFSET_NVGOGGLES  129     #define LINUX_EXTRAOFFSET 5         public plugin_init()     {         register_plugin( "Give spectator NVG", "1.0", "Arkshine" );                 register_event( "DeathMsg", "eDeathMsg", "a" );         register_event( "TeamInfo", "eTeamInfo", "a", "2=SPECTATOR" );                 g_iMsg_NvgToggle = get_user_msgid( "NVGToggle" );     }         public eDeathMsg()         set_task( 1.0, "set_user_nvg", read_data( 2 ) );             public eTeamInfo()         set_task( 1.0, "set_user_nvg", read_data( 1 ) );     public set_user_nvg( id )     {         static iDefusekit;         iDefusekit = get_user_nvg( id );                 if( !( iDefusekit & HAS_NVGOGGLES ) )         {             iDefusekit |= HAS_NVGOGGLES;             set_pdata_int( id, OFFSET_NVGOGGLES, iDefusekit, LINUX_EXTRAOFFSET );         }                 Active_nvg( id );     }         get_user_nvg( id )         return ( get_pdata_int( id, OFFSET_NVGOGGLES, LINUX_EXTRAOFFSET ) & HAS_NVGOGGLES ) ? 1 : 0;         Active_nvg( id )     {         static const sNvg_sound[] = "items/nvg_on.wav";         client_cmd( id, "spk %s", sNvg_sound );                 message_begin( MSG_ONE, g_iMsg_NvgToggle, _, id );         write_byte( 1 );         message_end();     }
__________________

Last edited by Arkshine; 12-17-2007 at 03:28.
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 11:13.


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