Raised This Month: $ Target: $400
 0% 

freeze


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BudaB
Junior Member
Join Date: Apr 2011
Old 06-16-2011 , 11:53   freeze
Reply With Quote #1

How to freeze some players like for 5 seconds if FREEZE = TRUE?
BudaB is offline
BudaB
Junior Member
Join Date: Apr 2011
Old 06-16-2011 , 15:56   Re: freeze
Reply With Quote #2

Would this

Code:
new bool:kazkas
 
if(kazkas)
{
    if(cs_get_user_team(id) == CS_TEAM_T)
        set_user_maxspeed(id, 0.1)
 
    set_task(5.0, "kazkas1", id)
}
 
public kazkas1
{
set_user_maxspeed(id, 250.0)
}
or this


Code:
new bool:kazkas
 
if(kazkas)
{
    if(cs_get_user_team(id) == CS_TEAM_T)
        set_pev(id, pev_flags, (pev(id, pev_flags) | FL_FROZEN));
 
    set_task(5.0, "kazkas1", id)
}
 
public kazkas1
{
set_pev(id, pev_flags, (pev(id, pev_flags) & ~FL_FROZEN));
}
codes might work?
BudaB is offline
ARES[ro]
Senior Member
Join Date: Apr 2010
Old 06-16-2011 , 16:22   Re: freeze
Reply With Quote #3

PHP Code:
// no need for the bool with my example that was based on your code ... new bool:kazkas ... to use bool dont even use tasks, only forwards
#define TASK_kazkas 1000

[...]

public 
set_kazkas(idFloat:time)
{
    if(
cs_get_user_team(id) == CS_TEAM_T)
        
set_pev(idpev_flags, (pev(idpev_flags) | FL_FROZEN))  
    if(!
task_exists(TASK_kazkas id))
        
remove_task(TASK_kazkas id)
    
set_task(time"func_task_kazkas"TASK_kazkas id)
}

public 
func_task_kazkas(taskid)
{
    new 
id taskid TASK_kazkas1
    set_pev
(idpev_flags, (pev(idpev_flags) ^ FL_FROZEN))
    
// ^ is exclusive or, and its used in assembly to clear out a number of bits and making them 0 no matter what their value is

PHP Code:
//To verify if player is frozen just do this:
if(pev(idpev_flags) == pev(idpev_flags) & FL_FROZEN)
    [...] 
__________________
okay

Last edited by ARES[ro]; 06-16-2011 at 16:34.
ARES[ro] is offline
BudaB
Junior Member
Join Date: Apr 2011
Old 06-17-2011 , 07:55   Re: freeze
Reply With Quote #4

Code does not work.
BudaB is offline
!Morte
Veteran Member
Join Date: May 2010
Old 06-17-2011 , 11:37   Re: freeze
Reply With Quote #5

PHP Code:
#include <amxmodx>
#include <fun>

const TASK_UNFREEZE 1589;

#define NORMAL_VELOCITY        240.0
#define FROZEN_VELOCITY        0.1

#define ID_UNFREEZE ( taskid - TASK_UNFREEZE )

new g_frozen[33]

public 
plugin_init()
{
    
register_plugin("Freeze test""9651854.1654""Me :D")
    
    
register_clcmd("say frozen""clcmd_frozenme")
}

public 
clcmd_frozenme(id)
{
    if(!
is_user_alive(id) || g_frozen[id] || task_exists(id+TASK_UNFREEZE))
        return;
        
    
g_frozen[id] = 1
    
    set_user_maxspeed
(idFROZEN_VELOCITY)
    
    
client_print(idprint_chat"FREEZE!")
    
    
set_task(4.0"remove_freeze"id+TASK_UNFREEZE)
}

public 
remove_freeze(taskid)
{
    
g_frozen[ID_UNFREEZE] = 0
    set_user_maxspeed
(ID_UNFREEZENORMAL_VELOCITY)

__________________
First Zombie Class
[ZP] Zombie Class: Houndeye Zombie
Quote:
Originally Posted by lucas_7_94 View Post
tenes que saber pawn antes de intentar hacer algo digno.
!Morte is offline
Send a message via MSN to !Morte Send a message via Skype™ to !Morte
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 06-17-2011 , 12:03   Re: freeze
Reply With Quote #6

You can check this plugin: http://forums.alliedmods.net/showthread.php?t=134516
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
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:32.


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