AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   freezing (https://forums.alliedmods.net/showthread.php?t=196479)

GhostMan 09-21-2012 16:32

freezing
 
In certain situacion i want to freeze every alive T or CT and after 15sec unfreeze them.

Am i doing it correctly?

Terrorist freeze/unfreeze
PHP Code:

switch(cs_get_user_team(tid))
{
    case 
CS_TEAM_T:
    {
        if(!(
pev(tidpev_flags) & FL_FROZEN))
        {
            
client_print(tidprint_center"You have been frozen for 15sec");
            
set_pev(tidpev_flags, (pev(tidpev_flags) | FL_FROZEN));
            
set_task(15.0"UnFreezeT"TASK_UNFREEZET);
        }
    }
}

public 
UnFreezeT()
{
    new 
players[32], numtid;
    
get_players(playersnum"ae""TERRORIST");
    
    for(new 
inumi++)
    {
        
tid players[i]
        
set_pev(tidpev_flags, (pev(tidpev_flags) & ~FL_FROZEN));
    }



CT freeze/unfreeze
PHP Code:

switch(cs_get_user_team(tid))
{        
    case 
CS_TEAM_CT:
    {
        if(!(
pev(tidpev_flags) & FL_FROZEN))
        {
            
client_print(tidprint_center"You have been frozen for 15sec");
            
set_pev(tidpev_flags, (pev(tidpev_flags) | FL_FROZEN));
            
set_task(15.0"UnFreezeCT"TASK_UNFREEZECT);
        }
    }
}
public 
UnFreezeCT()
{
    new 
players[32], numtid;
    
get_players(playersnum"ae""CT");
    
    for(new 
inumi++)
    {
        
tid players[i];
        
set_pev(tidpev_flags, (pev(tidpev_flags) & ~FL_FROZEN));
    }


I need all that "Swith" thing, becouse i'm doing some stuff with opposite team too.

Swaycher 09-21-2012 22:49

Re: freezing
 
PHP Code:

set_task(15.0"UnFreezeCT"TASK_UNFREEZECT); 

to:

PHP Code:

set_task(15.0"UnFreezeCT"tid+TASK_UNFREEZECT); 


GhostMan 09-22-2012 06:02

Re: freezing
 
Can you explain me what's the difference?

fysiks 09-22-2012 13:37

Re: freezing
 
Before asking if you are doing it correctly, you should test it. If it doesn't work then you have your answer. Test it. If it doesn't work, post the WHOLE code as an attachment.

Quote:

Originally Posted by GhostMan (Post 1803824)
Can you explain me what's the difference?

It doesn't do anything.


All times are GMT -4. The time now is 08:19.

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