AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Give nightvision for spects (https://forums.alliedmods.net/showthread.php?t=64386)

CAMEL 12-14-2007 16:31

Give nightvision for spects
 
Give nightvision for spects :$.. I can't make it.. :$.. if someone help me or throw me a bit of information :$

_Master_ 12-16-2007 09:37

Re: Give nightvision for spects
 
[OFF-TOPIC]
IneedHelp stop posting random code. You have no ideea how many things are wrong in there. Thank you.
[/OFF-TOPIC]

CAMEL 12-16-2007 15:07

Re: Give nightvision for spects
 
someone can help? =S... I have a little code, but isn't working..

Arkshine 12-17-2007 03:12

Re: Give nightvision for spects
 
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();     }

Lisa 12-17-2007 18:42

Re: Give nightvision for spects
 
I just tried this plugin (you helped me with the other night vision plugin just now) I was going to use both. But after I loaded this one I get:

( 16) Load fails: Plugin file open error (plugin "givespec_nvg.amxx")

It compiled fine for me but has that error when I try to run it.

Arkshine 12-17-2007 18:44

Re: Give nightvision for spects
 
Quote:

Plugin file open error
Be sure that the plugin is named exactly "givespec_nvg.amxx" in your plugins/ directory.

Lisa 12-17-2007 18:48

Re: Give nightvision for spects
 
Ohh I'm sorry you're right. When I uploaded to my ftp it added '.txt' to the end of the plugin name. I should have noticed.

It works completely fine now thank you for the help!


All times are GMT -4. The time now is 11:13.

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