Raised This Month: $32 Target: $400
 8% 

[SOLVED] [ANY?] Allow attack after round end


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Root_
Veteran Member
Join Date: Jan 2012
Location: ryssland
Old 07-14-2013 , 10:41   [SOLVED] [ANY?] Allow attack after round end
Reply With Quote #1

Hello!
It is possible to allow players to attack after losing a round?
I dont need to ignore round end conditions at all, I'd to see a plugin which allows losers to attack (probably with stripping all weapons but melee)
Thanks!
__________________


dodsplugins.com - Plugins and Resources for Day of Defeat
http://twitch.tv/zadroot

Last edited by Root_; 08-08-2013 at 08:57. Reason: solved
Root_ is offline
Root_
Veteran Member
Join Date: Jan 2012
Location: ryssland
Old 07-17-2013 , 08:07   Re: [ANY?] Allow attack after round end
Reply With Quote #2

I tried to SetWinningTeam after round end, but that's not really good solution (cant get the round end info, player is still respawning etc)

EDIT: Found a solution (see below), full plugin can be found here https://forums.alliedmods.net/showthread.php?t=222941
__________________


dodsplugins.com - Plugins and Resources for Day of Defeat
http://twitch.tv/zadroot

Last edited by Root_; 08-08-2013 at 08:58.
Root_ is offline
Root_
Veteran Member
Join Date: Jan 2012
Location: ryssland
Old 08-08-2013 , 08:57   Re: [ANY?] Allow attack after round end
Reply With Quote #3

Nevermind. I found a solution for Day of Defeat: Source
PHP Code:
#include <dodhooks>
#include <sdktools_gamerules>

public OnRoundWin()
{
    
/**
    * This dirty way works like a charm
    * Since event is called after team has won, the original SetWinningTeam callback is already set up
    * However, if we change round state during this callback, it will cause infinite loop during m_flRestartRoundTime
    * In other words this event will be fired at every frame until new round starts
    * A solution: after event is fired once (for all the plugins), stop the SetWinningTeam hook chain
    * Winners panel will still be shown and round will started eventually after bonus round time is expired
    */
    
StopChain true;

    
/**
    * I call this Fake-RoundState
    * It _should_ set round state to normal, but its wont
    * SDKTools actually dont set round state properly as DoD Hooks does
    * Why? If I'd use DoD Hooks 'SetRoundState' native, it would change round state immediately
    * But this one just allows players to shoot during bonus round (as when round would run as usual)
    */
    
GameRules_SetProp("m_iRoundState"RoundState_RoundRunning);
}

/* OnSetWinningTeam()
 *
 * Called when a team is about to win (DoD Hooks).
 * ----------------------------------------------------------------- */
public Action:OnSetWinningTeam(index)
{
    
// Round ended - block hook chain;  Plugin_Continue otherwise
    
return StopChain Plugin_Handled Plugin_Continue;

I guess it would work also with TF2 using DHooks example
__________________


dodsplugins.com - Plugins and Resources for Day of Defeat
http://twitch.tv/zadroot

Last edited by Root_; 08-08-2013 at 09:00.
Root_ is offline
Reply


Thread Tools
Display Modes

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:51.


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