AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   mp_freezetime CT / Ts (https://forums.alliedmods.net/showthread.php?t=76965)

PoSiTiOn Of PoWeR 09-02-2008 17:27

mp_freezetime CT / Ts
 
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 :( .

v3x 09-03-2008 04:57

Re: mp_freezetime CT / Ts
 
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 )



[X]-RayCat 09-03-2008 16:06

Re: mp_freezetime CT / Ts
 
You can use this function to freeze players:
Code:
set_pev(id, pev_flags, pev(id, pev_flags) | FL_FROZEN)

hleV 09-04-2008 06:53

Re: mp_freezetime CT / Ts
 
What are
PHP Code:

#define TASK_CT 721983 
#define TASK_TE 623917 

for? I don't see a reason to use task id here.

v3x 09-04-2008 11:05

Re: mp_freezetime CT / Ts
 
Habit. I always use task ids.

Arkshine 09-04-2008 11:25

Re: mp_freezetime CT / Ts
 
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.

v3x 09-04-2008 12:25

Re: mp_freezetime CT / Ts
 
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.

anakin_cstrike 09-04-2008 13:05

Re: mp_freezetime CT / Ts
 
V3x's example is more simple.

v3x 09-04-2008 13:11

Re: mp_freezetime CT / Ts
 
Yeah, but arkshine is right. I've got an appointment to go to, so I'll make it sometime after I get back.

Arkshine 09-04-2008 13:24

Re: mp_freezetime CT / Ts
 
Quote:

Originally Posted by anakin_cstrike (Post 681144)
V3x's example is more simple.

I don't think. :wink:


All times are GMT -4. The time now is 03:09.

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