Raised This Month: $ Target: $400
 0% 

pls help with freezing


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
risontek22
Member
Join Date: Mar 2013
Location: localhost
Old 03-08-2013 , 07:53   pls help with freezing
Reply With Quote #1

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 

risontek22 is offline
Infernuz
Member
Join Date: May 2011
Old 03-08-2013 , 08:01   Re: pls help with freezing
Reply With Quote #2

What are you trying to do? Freeze all terrorists on round start?
Infernuz is offline
Send a message via ICQ to Infernuz
risontek22
Member
Join Date: Mar 2013
Location: localhost
Old 03-08-2013 , 08:22   Re: pls help with freezing
Reply With Quote #3

yes, then unfreeze
risontek22 is offline
Infernuz
Member
Join Date: May 2011
Old 03-08-2013 , 08:29   Re: pls help with freezing
Reply With Quote #4

For how long should they stay freezed?
Infernuz is offline
Send a message via ICQ to Infernuz
risontek22
Member
Join Date: Mar 2013
Location: localhost
Old 03-08-2013 , 08:32   Re: pls help with freezing
Reply With Quote #5

5 second pls help me
risontek22 is offline
Infernuz
Member
Join Date: May 2011
Old 03-08-2013 , 09:25   Re: pls help with freezing
Reply With Quote #6

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;

Attached Files
File Type: sma Get Plugin or Get Source (freeze_t.sma - 562 views - 1.5 KB)

Last edited by Infernuz; 03-08-2013 at 09:26.
Infernuz is offline
Send a message via ICQ to Infernuz
risontek22
Member
Join Date: Mar 2013
Location: localhost
Old 03-08-2013 , 12:01   Re: pls help with freezing
Reply With Quote #7

when this plugin freeze me it after 5 sec still frozen
risontek22 is offline
Old 03-09-2013, 02:19
risontek22
This message has been deleted by YamiKaitou. Reason: wait 14 days before you bump
Reply



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 23:20.


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