AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Enable, Remove, Give NightVision to players. (https://forums.alliedmods.net/showthread.php?t=236781)

proffs 03-11-2014 04:29

Enable, Remove, Give NightVision to players.
 
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 03-11-2014 04:47

Re: Enable, Remove, Give NightVision to players.
 
Never mind fixed it, thanks anyway lolz


All times are GMT -4. The time now is 06:03.

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