Raised This Month: $51 Target: $400
 12% 

Blocking Swapteam During SD


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DontWannaName
Veteran Member
Join Date: Jun 2007
Location: VALVe Land, WA
Old 07-02-2010 , 20:10   Blocking Swapteam During SD
Reply With Quote #1

I made some edits to STM but they didnt work and I have a feeling its a silly mistake.

Global:
new bool:suddendeath = false;

Hook SD:
Code:
if (IsEnabled && !IsHooked) {
        if (!HookEventEx("player_death", HookPlayerDeath, EventHookMode_Post)
            || !HookEventEx("player_team", HookPlayerChangeTeam, EventHookMode_Post)
            || !HookEventEx("teamplay_round_win", HookRoundEnd, EventHookMode_Post)
            || !HookEventEx("teamplay_suddendeath_begin", SDBegin, EventHookMode_Post)
            || !HookEventEx("teamplay_suddendeath_end", SDEnd, EventHookMode_Post)) {
            SetFailState("Could not hook an event.");
            IsHooked = false;
            return;
        }
        IsHooked = true;
If Sudden death only swap the player dont respawn them:

Code:
#if USE_STB
    if (UseSTB) {
        if (forced)
            STB_MovePlayerForced(player, PlayersTeam[player]);
        else
            STB_MovePlayerUnForced(player, PlayersTeam[player]);
    } else {
        ChangeClientTeam(player, PlayersTeam[player]);
        TF2_RespawnPlayer(player);
    }
#else
    if(!suddendeath) {
        ChangeClientTeam(player, PlayersTeam[player]);
        TF2_RespawnPlayer(player);
    }
    else {
        ChangeClientTeam(player, PlayersTeam[player]);
    }
#endif
In events:

Code:
public SDBegin(Handle:event, const String:name[], bool:dontBroadcast)
{
    suddendeath = true;
}

public SDEnd(Handle:event, const String:name[], bool:dontBroadcast)
{
    suddendeath = false;
}
The svn version may fix this, but I still would like to know how to do this. Players are swapping teams during SD to respawn instantly on the other team. Would doing !isplayeralive be better.
__________________


Last edited by DontWannaName; 07-02-2010 at 20:20.
DontWannaName is offline
BrutalGoerge
AlliedModders Donor
Join Date: Jul 2007
Old 07-02-2010 , 20:37   Re: Blocking Swapteam During SD
Reply With Quote #2

teamplay_round_stalemate

i dont think those sudden death events get firedededddd
__________________
My Pluggies If you like, consider to me.
BrutalGoerge is offline
DontWannaName
Veteran Member
Join Date: Jun 2007
Location: VALVe Land, WA
Old 07-02-2010 , 20:42   Re: Blocking Swapteam During SD
Reply With Quote #3

That would be asking for too much.
__________________

DontWannaName is offline
Cr(+)sshair
Member
Join Date: Mar 2010
Old 07-03-2010 , 02:37   Re: Blocking Swapteam During SD
Reply With Quote #4

Hmmm did you try blocking join team while SD is true?
Cr(+)sshair is offline
DontWannaName
Veteran Member
Join Date: Jun 2007
Location: VALVe Land, WA
Old 07-03-2010 , 02:41   Re: Blocking Swapteam During SD
Reply With Quote #5

I still want them to be able to swap teams, just not spawn.
__________________

DontWannaName is offline
Cr(+)sshair
Member
Join Date: Mar 2010
Old 07-03-2010 , 02:48   Re: Blocking Swapteam During SD
Reply With Quote #6

Maybe create a timer for everyone who's on t and ct, store that in an array like IsT[client] == 1; and then use that I guess to switch teams to spec then to their new team. But if someone spawned that wasn't supposed to on a different array, just keep teamswitch to spec then team.
Cr(+)sshair is offline
DontWannaName
Veteran Member
Join Date: Jun 2007
Location: VALVe Land, WA
Old 07-03-2010 , 02:56   Re: Blocking Swapteam During SD
Reply With Quote #7

Sounds too complicated. This is for TF2 btw.
__________________

DontWannaName is offline
Cr(+)sshair
Member
Join Date: Mar 2010
Old 07-03-2010 , 02:59   Re: Blocking Swapteam During SD
Reply With Quote #8

Oops. Nvm lol
Cr(+)sshair 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 23:49.


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