Raised This Month: $ Target: $400
 0% 

mp_freezetime CT / Ts


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
PoSiTiOn Of PoWeR
BANNED
Join Date: May 2008
Location: RO
Old 09-02-2008 , 17:27   mp_freezetime CT / Ts
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>

public plugin_init() {
    
register_plugin("New""1.2""P.Of.Pw")
    
    
register_logevent("roundstart"2"1=Round_Start");
   
}

public 
roundstart(idset_task(1.0,"cmdss",id)


public 
cmdss(id)
{
    if( 
get_user_team(id) != 1
    {

        
server_cmd("mp_freezetime 2")
    
    }
    else    
    if( 
get_user_team(id) != 2
    {
        
server_cmd("mp_freezetime 5")
        
    }

I want the teams CT to start round with 5 seconds later and Ts start round with 2 seconds later .
I hope you understands.
Srry for my English .
PoSiTiOn Of PoWeR is offline
Send a message via Yahoo to PoSiTiOn Of PoWeR
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 09-03-2008 , 04:57   Re: mp_freezetime CT / Ts
Reply With Quote #2

Here. Try this. If you need any help, just ask
PHP Code:
#include <amxmodx>
#include <fakemeta>

#define TASK_CT 721983
#define TASK_TE 623917

new PCVAR_CT PCVAR_TERROR

enum 
CT TERROR }

new 
bool:g_bFreezeTime[3]

public 
plugin_init()
{
    
register_plugin"Custom Team Freezetime" "0.1a" "v3x" )

    
register_event"HLTV" "Event_NewRound" "a" "1=0" "2=0" )
    
register_event"CurWeapon" "Event_CurWeapon" "be" "1=1" )

    
PCVAR_CT register_cvar"mp_freezetime_ct" "5" )
    
PCVAR_TERROR register_cvar"mp_freezetime_terror" "2" )

    
set_cvar_num"mp_freezetime" )
}

public 
Event_NewRound()
{
    
g_bFreezeTime[CT] = true
    g_bFreezeTime
[TERROR] = true

    set_task
get_pcvar_floatPCVAR_CT ) , "Unfreeze_CT" TASK_CT )
    
set_taskget_pcvar_floatPCVAR_TERROR ) , "Unfreeze_Terror" TASK_TE )
}
    
public 
Unfreeze_CT()
    
g_bFreezeTime[CT] = false

public Unfreeze_Terror()
    
g_bFreezeTime[TERROR] = false

public Event_CurWeaponid )
{
    if( !
is_user_aliveid ) || ( !g_bFreezeTime[TERROR] && !g_bFreezeTime[CT] ) ) 
        return 
PLUGIN_CONTINUE

    
new iTeam get_user_teamid )

    if( 
iTeam && iTeam <= CT
    {
        if( 
g_bFreezeTime[iTeam] )
            
Freezeid )
    }

    return 
PLUGIN_CONTINUE
}

public 
Freezeid // From Avalanche's Frost Nades
{
    
set_pevid pev_velocity Float:{0.0,0.0,0.0} )
    
engfuncEngFunc_SetClientMaxspeed id 0.00001 )

__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
[X]-RayCat
Senior Member
Join Date: Sep 2006
Old 09-03-2008 , 16:06   Re: mp_freezetime CT / Ts
Reply With Quote #3

You can use this function to freeze players:
Code:
set_pev(id, pev_flags, pev(id, pev_flags) | FL_FROZEN)
[X]-RayCat is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 09-04-2008 , 06:53   Re: mp_freezetime CT / Ts
Reply With Quote #4

What are
PHP Code:
#define TASK_CT 721983 
#define TASK_TE 623917 
for? I don't see a reason to use task id here.
__________________
hleV is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 09-04-2008 , 11:05   Re: mp_freezetime CT / Ts
Reply With Quote #5

Habit. I always use task ids.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-04-2008 , 11:25   Re: mp_freezetime CT / Ts
Reply With Quote #6

I would do this way :

- Setting mp_freezetime to the lowest value between both value.

At the round starts :

- Blocking sound/test ( SendAudio/TextMsg ) one time for the other team.
- Freezing ( FL_FROZEN ) and disallowing fire ( offset 83 = next attack time) for this other team
- Setting a task with the second value to disable Freeze and enable fire. Also, playing the text/sounds stuff for this team.

I think it would be more consistent and natural this way.
__________________
Arkshine is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 09-04-2008 , 12:25   Re: mp_freezetime CT / Ts
Reply With Quote #7

I forgot about all of that. Mine is just an alpha version anyhow. I could rewrite it to do all of that and also have the countdown as well.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 09-04-2008 , 13:05   Re: mp_freezetime CT / Ts
Reply With Quote #8

V3x's example is more simple.
__________________

anakin_cstrike is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 09-04-2008 , 13:11   Re: mp_freezetime CT / Ts
Reply With Quote #9

Yeah, but arkshine is right. I've got an appointment to go to, so I'll make it sometime after I get back.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-04-2008 , 13:24   Re: mp_freezetime CT / Ts
Reply With Quote #10

Quote:
Originally Posted by anakin_cstrike View Post
V3x's example is more simple.
I don't think.
__________________
Arkshine is offline
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 14:21.


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