AlliedModders

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

risontek22 03-08-2013 07:53

pls help with freezing
 
hi, i need help, i have made anti-furien lead and the freeze doesnt work PLS HELP SOMEBODY

PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <cstrike>
#include <fun>
#include <fakemeta>
#include <engine>

new timer
new boolcountdownon

public plugin_init()
{
    
register_plugin("Naskok","1.0","Risontek")
    
register_logevent("odpocet"2"1=Round_Start")
}

public 
odpocet(id)
{
    if(!
countdownon
    { 
        
timer 5
        countdownon 
true 
        countdown_start
(id
        if(
get_user_team(id) == 1)
        {
            
set_pev(idpev_flagspev(idpev_flags) | FL_FROZEN)
        }
    }
}
public 
countdown_start(id)
{
    if(
timer >= 0
    {
        if(
timer == 0
        {
            
countdownon false 
            
if(get_user_team(id) == 1)
            {
                
set_pev(idpev_flagspev(idpev_flags) & ~FL_FROZEN)
            }
            return 
PLUGIN_HANDLED
        
}
        
set_hudmessage(02550, -1.00.3001.01.0
        
show_hudmessage(0"Anti-Furien naskok: %i"timer
        
timer-- 
        
set_task(1.0"countdown_start")
    }
    return 
PLUGIN_CONTINUE 



Infernuz 03-08-2013 08:01

Re: pls help with freezing
 
What are you trying to do? Freeze all terrorists on round start?

risontek22 03-08-2013 08:22

Re: pls help with freezing
 
yes, then unfreeze

Infernuz 03-08-2013 08:29

Re: pls help with freezing
 
For how long should they stay freezed?

risontek22 03-08-2013 08:32

Re: pls help with freezing
 
5 second pls help me :(

Infernuz 03-08-2013 09:25

Re: pls help with freezing
 
1 Attachment(s)
You know you could use mp_freezetime 5 in server.cfg, but anyways here:

PHP Code:

/*
 * Freezer, freezes terrorists team on round start
 * 
 * Credits: 
 *     Devil259 for freeze function    http://forums.alliedmods.net/showpost.php?p=1613026&postcount=3
 *     VEN for new round                https://forums.alliedmods.net/showthread.php?t=42159
 * 
 */
 
#include <amxmodx> 
#include <fakemeta> 

#define T_FREEZE_TIME     5.0

new bool:g_debug true;

public 
plugin_init() { 
    
register_plugin("Freezer""1.0""Infernus"
    
    
register_event("HLTV""event_new_round""a""1=0""2=0")
}

public 
event_new_round() {
    
    if(
g_debug)
        
server_print("newround_enter");
    
    
// freeze all t
    
set_task(0.1"freeze_ts"); // make sure they have time to respawn
    
    // unfreeze all t
    
if(T_FREEZE_TIME 0.1)
        
set_task(T_FREEZE_TIME"freeze_ts");
        
    if(
g_debug)
        
server_print("newround_exit");
}

public 
freeze_ts() {
    
    if(
g_debug)
        
server_print("freeze_ts_enter");
    
    new 
players[32], iplayersCount
    get_players
(playersplayersCount)
    
    for(
0playersCounti++) {
        
        if(
get_user_teamplayers[i] ) == 1) {
            
set_freeze_statusplayers[i] );
        }
    }

    if(
g_debug)
        
server_print("freeze_ts_exit");
}

public 
set_freeze_status(id) {

    new 
flags pev(idpev_flags)
    
    if(!
is_freezed(idflags))
        
set_pev(idpev_flagsflags FL_FROZEN)
    else
        
set_pev(idpev_flagsflags & ~FL_FROZEN
}

public 
bool:is_freezed(idflags) {
    
    if( 
is_user_alive(id) && ( flags FL_FROZEN ) )
        return 
true
    
    
return false;



risontek22 03-08-2013 12:01

Re: pls help with freezing
 
when this plugin freeze me it after 5 sec still frozen


All times are GMT -4. The time now is 21:49.

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