Raised This Month: $ Target: $400
 0% 

Flashlight to Nightvision


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 05-22-2013 , 20:08   Re: Flashlight to Nightvision
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <engine>

#define PLUGIN_NAME "x"
#define PLUGIN_VERSION "0.0.2"
#define PLUGIN_AUTHOR "x"

new only_disable_fl

public plugin_init()
{
    
register_plugin(PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_AUTHOR)
    
    
register_impulse(100"ClientCommand__Impulse")
    
    
only_disable_fl register_cvar("only_disable_fl""0"// Set 1 For Just Ignore When Terro Try To Use Flashlight
}

public 
ClientCommand__Impulse(id)
{
    if(!
is_user_alive(id) || cs_get_user_team(id) != CS_TEAM_T)
        return 
PLUGIN_CONTINUE
    
    
else
    {
        if(
get_pcvar_num(only_disable_fl))
            
client_print(idprint_center"YOU ARENT ALLOWED TO USE FLASHLIGHT")
    
        else
        {
            if(!
cs_get_user_nvg(id))
                
cs_set_user_nvg(id1)
        
            
engclient_cmd(id"nightvision")
        }
    }
    
    return 
PLUGIN_HANDLED

I made cvar because no makes sence use flashlight to nightvision, since they can use n. So if you want just disable flashlight and shows message that they cant use flashlight set the cvar to 1.
If cvar is 0, it does nightvision instead of flashlight for Terrorists
__________________
Jhob94 is offline
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 16:20.


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