AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Stop RoundTimer? (https://forums.alliedmods.net/showthread.php?t=163197)

sake 07-27-2011 16:59

Stop RoundTimer?
 
Hello there,

Is it possible to make the round timer stop ticking? So that it's always for example 5:00 in the game? (Counter-Strike)

kind regards

sake

lazarev 07-27-2011 17:04

Re: Stop RoundTimer?
 
make a global task, and each second send usermsg

sake 07-28-2011 16:24

Re: Stop RoundTimer?
 
Hmm. Maybe there is another way? Or another thing, how can I make the people spawn even if its the 4th minute in the round?

SnoW 07-28-2011 16:30

Re: Stop RoundTimer?
 
Quote:

Originally Posted by sake (Post 1520583)
Or another thing, how can I make the people spawn even if its the 4th minute in the round?

How does this differ from a respawn plugin?

Doc-Holiday 07-28-2011 16:47

Re: Stop RoundTimer?
 
or just do infinite round by arkshine.

sake 07-29-2011 03:01

Re: Stop RoundTimer?
 
Quote:

Originally Posted by SnoW (Post 1520589)
How does this differ from a respawn plugin?

In no way. I am trying to develop my own version of CS Deathmatch and everything works fine but this thing .).

Hunter-Digital 07-29-2011 03:07

Re: Stop RoundTimer?
 
You're talking about mid-round spawn after joining ? You'll have to do that manually.
You could have a look at my jctf plugin, it has respawning stuff.

sake 07-29-2011 03:13

Re: Stop RoundTimer?
 
Exactly! You did rephrase it 100% correctly :).

EDIT: But the code for your plugin is quite huge and I don't know which of the functions you use for respawning could help me out. :(

EDIT2: That's what I am doing right now:

PHP Code:

/*
* called on change of TeamInfo. Player gets hudmessage if he connects and is dead 
* that says he has to respawn manually.
*/
public teamAssigned()
{
    new 
id read_data(1);
    if(
id 32)
    {
        return;
    }
    if(
is_user_connected(id) && !is_user_hltv(id) && !is_user_bot(id))
    {
        new 
CsTeams:team cs_get_user_team(id);
        if(
team != CS_TEAM_CT && team != CS_TEAM_T)
        {
            return;
        }
        if(!
is_user_alive(id))
        {
            
set_hudmessage(25500, -1.00.3003.06.0);
            
show_hudmessage(id,"After selecting your model say /respawn to start the game!");
        }
    }


But that's not really user-friendly... I have also tried calling spawnPlayer:

PHP Code:

/*
* simple spawnPlayer method. spawns player.
*/
public spawnPlayer(id)
{
    if(
is_user_connected(id) && id <= 32)
    {
        
dllfunc(DLLFunc_Spawn,id);
    }


But it didn't work until a player has chosen his model...

Doc-Holiday 07-29-2011 03:50

Re: Stop RoundTimer?
 
Use exectueham to respawn the player.

also you can check when player has selected a team can you not? i could have sworn there was a way to hook switch team. which is what happens spectator to CT/T.

Catch that and ExecuteHamB(Ham_CS_RoundRespawn, id)

Hunter-Digital 07-29-2011 03:58

Re: Stop RoundTimer?
 
@sake

Why would you print a message to use /respawn when you can just trigger it from the code ?

Well, I didn't tell you to look at every single code there, you'll have to search... first find the "TeamInfo" hook, then find it's function and go from there.

Also, make sure you respawn player after he chose his class, not team, "TeamInfo" is called on both.


All times are GMT -4. The time now is 00:50.

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