Raised This Month: $ Target: $400
 0% 

Removing limit on nightvision


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mr. Satan
Senior Member
Join Date: Apr 2004
Location: Fort Wayne, Indiana
Old 10-19-2004 , 07:08   Removing limit on nightvision
Reply With Quote #1

Would it be possible to remove the "battery life" ?

I run this plugin on my Sven Coop server and it gets annoying when using nightvision in a large dark area and having it cut out all the time.

I tried setting the battery life to 99999999 and the recharge time to 0 but it still cuts 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 */ #include <amxmodx> new gNvgRun[33] new gMsgScreenfade public plugin_init() {     register_plugin("Nightvision", "1.1", "Lazy/AssKicR")         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] Sry 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( 10 )         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(150)         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
Mr. Satan
Senior Member
Join Date: Apr 2004
Location: Fort Wayne, Indiana
Old 11-03-2004 , 13:14  
Reply With Quote #2

Sorry for the double post but...please help
__________________
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
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 11-04-2004 , 13:18  
Reply With Quote #3

Perhaps, when you run the NVG2 thing (which I believe is what actually does the nightvision), you could set a task to run it again in however many seconds it is before it expires.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
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
Mr. Satan
Senior Member
Join Date: Apr 2004
Location: Fort Wayne, Indiana
Old 11-11-2004 , 18:24  
Reply With Quote #5

Also, here's a screenshot to show the reduced nightvision brightness. The responses I have recieved after reducing the brightness have all been positive.

__________________
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
Kamikaze
Senior Member
Join Date: Mar 2004
Location: Butler, PA
Old 11-12-2004 , 01:37  
Reply With Quote #6

You going to post this in the plugins forum, looks like a great plugin.
Kamikaze is offline
Send a message via ICQ to Kamikaze Send a message via AIM to Kamikaze Send a message via MSN to Kamikaze Send a message via Yahoo to Kamikaze
Mr. Satan
Senior Member
Join Date: Apr 2004
Location: Fort Wayne, Indiana
Old 11-12-2004 , 01:39  
Reply With Quote #7

I didn't make the plugin, I only edited it.
__________________
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
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 17:19.


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