Raised This Month: $ Target: $400
 0% 

Removing limit on nightvision


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Mr. Satan
Senior Member
Join Date: Apr 2004
Location: Fort Wayne, Indiana
Old 11-06-2004 , 09:35  
Reply With Quote #4

Nah, I figured it out.

Code:
/* AMX Mod Script  *  * Nightvision Plugin  *  * 2003 - Lazy ([email protected])  *  * This plugin adds nightvision goggles to mods that don't have it already,  * help is available when users say !help nightvision.  *  * Changelog:  *  * 0.1 : First builds and general setup  * 0.2 : Fixed nightvision effect problem  * 0.3 : Added screenfade effect  * 0.4 : Nightvision tweaks  * 0.5 : Nightvision tweaks  * 0.6 : Removed some useless code  * 0.7 : Added support for SvenCoop  * 0.8 : Fixed stupid bug  * 0.9 : Tweaked battery  * 1.0 : Fixed fatal bug  * 1.1 : Changed commands nvg_on/nvg_off to nightvision  * 1.2 : Removed the "timelimit" - NV will only turn off on death. ~ Mr. Satan  * 1.3 : Darkened nightvision. Same effect but not as bright. ~ Mr. Satan */ #include <amxmodx> new gNvgRun[33] new gMsgScreenfade public plugin_init() {     register_plugin("Nightvision", "1.3", "Lazy/AssKicR/Mr. Satan")         register_cvar("mp_nightvision", "1", FCVAR_SERVER)         register_clcmd("say", "HandleSay", 0, "For Help")     register_clcmd("nightvision","HandleNVG",0,"Toggles Nightvision")         gMsgScreenfade = get_user_msgid("ScreenFade")         register_event("DeathMsg", "Grab_Death", "a")         return PLUGIN_CONTINUE } public HandleNVG(id) {     if (get_cvar_num("mp_nightvision")!=1) {         client_print(id,print_center,"[AMXX] Sorry, server has disabled this command")         return PLUGIN_HANDLED     } else {         if (is_user_alive(id) == 1) {             if (gNvgRun[id]) {                 KillNVG(id)                 return PLUGIN_HANDLED             } else {                 InitNVG(id)                 return PLUGIN_HANDLED             }         }     }     return PLUGIN_CONTINUE } public client_connect(id) {     gNvgRun[id] = 0         return PLUGIN_CONTINUE } public client_disconnect(id) {     gNvgRun[id] = 0         remove_task(144)     remove_task(145)     remove_task(147)         return PLUGIN_CONTINUE } public Grab_Death() {     new victim = read_data(2)     KillNVG(victim) } public InitNVG(id) {     new player[32]         get_user_name(id, player, 32)             gNvgRun[id] = 1             emit_sound(id, CHAN_ITEM, "items/flashlight1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)         set_task(0.10, "RunNVG", 144, player, 32, "b")     set_task(0.10, "RunNVG2", 147, player, 32, "b")         return PLUGIN_HANDLED } public RunNVG(player[]) {     new origin[3]     new id         id = get_user_index(player)         get_user_origin(id, origin)         message_begin(MSG_ONE, SVC_TEMPENTITY, {0,0,0}, id)         write_byte( 27 )         write_coord( origin[0] )     write_coord( origin[1] )     write_coord( origin[2] )         write_byte( 125 )     write_byte( 0 )     write_byte( 255 )     write_byte( 0 )         write_byte( 1 )     write_byte( 0 )         message_end()     // Svencoop     if (is_user_alive(id) == 0)     {         emit_sound(id, CHAN_ITEM, "items/flashlight1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)                 remove_task(144)         remove_task(145)         remove_task(147)                 gNvgRun[id] = 0     } } public RunNVG2(player[]) {     new id         id = get_user_index(player)     message_begin(MSG_ONE, gMsgScreenfade, {0,0,0}, id)         write_short(1000)     write_short(1000)     write_short(1<<12)         write_byte(0)     write_byte(255)     write_byte(0)         write_byte(9999)         message_end() } public KillNVG(id) {     emit_sound(id, CHAN_ITEM, "items/flashlight1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)         remove_task(144)     remove_task(145)     remove_task(147)         gNvgRun[id] = 0         return PLUGIN_HANDLED } public HandleSay(id) {     new chatstr[256]     new msgbox[256]         read_args(chatstr, 256)         format(msgbox, 256, "Nightvision:^n===========^n^nTo toggle nightvision type nightvision in console.^nWarning, nightvision may slow down some computers.")         if (containi(chatstr, "!help nightvision") == 1)            show_motd(id, msgbox, "Nightvision Help")         return PLUGIN_CONTINUE }
__________________
DITN's TEAMSPEAK Server @ ditn.sytes.net:8767
Mr. Satan is offline
Send a message via AIM to Mr. Satan Send a message via MSN to Mr. Satan Send a message via Yahoo to Mr. Satan
 



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 17:19.


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