AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Block nvg on round end, take from player nightvision. (https://forums.alliedmods.net/showthread.php?t=82582)

xbatista 12-26-2008 04:58

Block nvg on round end, take from player nightvision.
 
PHP Code:

public event_round_end()
{
       if (
cs_get_user_nvg(id))
       {
        
Took from he nightvision
       
}


:mrgreen:

SnoW 12-26-2008 05:50

Re: Block nvg on round end, take from player nightvision.
 
You can't check nvg like that, you have to loop all players and then use the player id, ofc with this too.
Code:

cs_set_user_nvg(id, 0)
Something like this:

Code:

public function()
{
 new players[32], num
 get_players(players, num)
 
 new player;
 for(new i = 0; i < num; i++)
 {
  player = players[i]
  if(cs_get_user_nvg(id) == 1)
      cs_set_user_nvg(id, 0);
}
}


xbatista 12-26-2008 05:54

Re: Block nvg on round end, take from player nightvision.
 
Ok thx ;)


All times are GMT -4. The time now is 09:04.

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