Raised This Month: $ Target: $400
 0% 

[SOLVED] "Extending freeze time" for one team


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Desikac
Senior Member
Join Date: Apr 2010
Location: Serbia
Old 04-20-2012 , 18:26   [SOLVED] "Extending freeze time" for one team
Reply With Quote #1

I want the players in the terrorist team to be frozen for 10 more seconds after the freeze time has expired and also be invisible for those 10 seconds.

This is my code:

PHP Code:
new freeze

public plugin_init() {
    
register_event("HLTV""nova_runda""a""1=0""2=0")  
    
register_logevent("roundstart"2"1=Round_Start")
    
register_event"CurWeapon""EventCurWeapon""be""1=1" )
}

public 
EventCurWeaponid ) {
    
    if(
cs_get_user_team(id) == CS_TEAM_T) {
        if(
freeze == 1) {
            
set_pev(idpev_maxspeed0.1)
            
client_print(idprint_chat"debug"//DEBUG
        
}
        else
            
set_pev(idpev_maxspeed350.0//terrorists have increased speed
    
}

    return 
PLUGIN_CONTINUE
}

public 
roundstart() {
    new 
players[32] , inum
    get_players
(playersinum)
    for(new 
0inum; ++a) {
        if(
cs_get_user_team(players[a]) == CS_TEAM_T) {
            
client_print(players[a], print_chat"Frozen cuz T!!"//DEBUG
            
set_pev(players[a], pev_maxspeed0.1)
            
set_user_renderingplayers[a], kRenderFxNone000kRenderTransAlpha1)
        }
    }
    
set_task(10.0"skinifreeze")
}

public 
nova_runda()
    
freeze 1

public skinifreeze() {
    
freeze 0
    
new players[32] , inum
    get_players
(playersinum)
    for(new 
0inum; ++a) {
        if(
cs_get_user_team(players[a]) == CS_TEAM_T) {
            
set_pev(players[a], pev_maxspeed350.0)
            
set_user_renderingplayers[a], kRenderFxNone000kRenderTransAlpha255)
        }
    }

They get invisibility but are still able to move.

Last edited by Desikac; 04-21-2012 at 10:41.
Desikac is offline
Send a message via MSN to Desikac Send a message via Skype™ to Desikac
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 04-20-2012 , 20:01   Re: "Extending freeze time" for one team
Reply With Quote #2

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

public plugin_init( )
  
register_logevent"RoundStart"2"1=Round_Start" );

public 
RoundStart( )
{
  static 
iPlayers32 ], iNumi;
  
get_playersiPlayersiNum"e""TERRORIST" );

  for( 
0iNumi++ )
    
set_peviPlayers], pev_flagspeviPlayers], pev_flags ) | FL_FROZEN );

  
set_task10.0"TimerRemoveFreeze" );
}

public 
TimerRemoveFreeze( )
{
  static 
iPlayers32 ], iNumi;
  
get_playersiPlayersiNum"e""TERRORIST" );

  for( 
0iNumi++ )
    
set_peviPlayers], pev_flagspeviPlayers], pev_flags ) & ~FL_FROZEN );

__________________

Last edited by claudiuhks; 04-20-2012 at 20:05.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
Desikac
Senior Member
Join Date: Apr 2010
Location: Serbia
Old 04-21-2012 , 10:41   Re: "Extending freeze time" for one team
Reply With Quote #3

I've managed to do it with the FL_FROZEN tag. Thx claudiuhks.
I didn't know that the cur weapon event doesn't get called when you slash or stab with a knife.
Desikac is offline
Send a message via MSN to Desikac Send a message via Skype™ to Desikac
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 04-21-2012 , 10:54   Re: [SOLVED] "Extending freeze time" for one team
Reply With Quote #4

PHP Code:
RegisterHamHam_Weapon_PrimaryAttack"weapon_knife""OnPrimaryAttack" );
RegisterHamHam_Weapon_SecondaryAttack"weapon_knife""OnSecondaryAttack" );

public 
OnPrimaryAttackiEntity )
{
  static 
iOwneriOwner peviEntitypev_owner );

  
// Now owner is slashing
}

public 
OnSecondaryAttackiEntity )
{
  static 
iOwneriOwner peviEntitypev_owner );

  
// Now owner is stabbing

__________________
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
Old 04-21-2012, 10:56
BadJoke
This message has been deleted by asherkin. Reason: Spam.
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 09:07.


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