Raised This Month: $ Target: $400
 0% 

Nightvision Color


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
SAMURAI16
BANNED
Join Date: Sep 2006
Old 02-24-2007 , 12:53   Nightvision Color
Reply With Quote #1

hi, i tryed to change the NightVision color, but i don't dunno 100 %
my code:
Code:
#include <amxmodx>
#include <amxmisc>


#define PLUGIN "Test nvg color"
#define VERSION "1.0"
#define AUTHOR "SAMURAI"

new pnumenable;
new pcolor;
new pnumradius
new pnumdecay

public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    register_event("NVGToggle","open_nvg","be");
    
    pnumenable = register_cvar("custom_nvg","1");
    pcolor = register_cvar("custom_nvg_rgb","255 0 255");
    pnumradius = register_cvar("custom_nvg_radius","60");
    pnumdecay = register_cvar("custom_nvg_decay","70");
    
}

public open_nvg(id)
{
    if( (!id) || !is_user_connected(id))
    return PLUGIN_CONTINUE;
    
    if(!get_pcvar_num(pnumenable)) 
    return PLUGIN_CONTINUE;
    
    new origin[3];
    get_user_origin(id,origin,3)
    
    new color[17];
    get_pcvar_string(pcolor,color,16);
    
    new iRed[5], iGreen[7], iBlue[5]
    parse(color,iRed,4,iGreen,6,iBlue,4)
    
    message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
    write_byte(TE_DLIGHT);
    
    write_coord(origin[0]);
    write_coord(origin[1]);
    write_coord(origin[2]);
    
    write_byte(get_pcvar_num(pnumradius))
    
    write_byte(str_to_num(iRed))
    write_byte(str_to_num(iGreen))
    write_byte(str_to_num(iBlue))
    
    write_byte(7)
    write_byte(get_pcvar_num(pnumdecay))
    
    message_end();
    
    return PLUGIN_CONTINUE;
}
Problem: The Nighvision color won't changed, it's green but when i stop the nightvision appear for 1 second my TE_DLIGHT . Any ideia for what message type i should use to can change the nightvision color.

thanks

Last edited by SAMURAI16; 02-24-2007 at 13:11.
SAMURAI16 is offline
Send a message via MSN to SAMURAI16
 



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 00:37.


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