Raised This Month: $ Target: $400
 0% 

Enable, Remove, Give NightVision to players.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
proffs
Senior Member
Join Date: Jul 2013
Old 03-11-2014 , 04:29   Enable, Remove, Give NightVision to players.
Reply With Quote #1

Alright so I have this game where players get nightvision. I want the Nightvision to be activated on them when the game starts. And it does. But when ever the game stops, many players have their nightvison on and can't remove it.

When game starts, I give them and activate it on them:
PHP Code:
if (cs_get_user_team(id) == CS_TEAM_CT)
        {
            
give_item(id"weapon_knife")
            
cs_set_user_nvg(id,true);
            
//engclient_cmd(iPlayer, "nightvision");            
            
set_user_health(id1500);
            
set_user_maxspeed(idZOMBIE_SPEED);
            
engclient_cmd(id"nightvision");
        } 
And When I stop the game for CTs:
PHP Code:
if( g_ThermalOn[id] )
            {
                
engclient_cmd(id"nightvision");
                
cs_set_user_nvg(id,false);
            }
            else 
cs_set_user_nvg(id,false);
            
client_cmd(id"nightvision"); 
And for Terrorist:
PHP Code:
cs_set_user_nvg(idfalse);
            
client_cmd(id"nightvision"); 
Should I do it on a another way?
proffs is offline
 


Thread Tools
Display Modes

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 06:03.


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