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

Solved [L4D1][HELP] Cannot block event "mission_lost"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
axelnieves2012
Senior Member
Join Date: Oct 2014
Location: Argentina
Old 10-27-2018 , 19:25   [L4D1][HELP] Cannot block event "mission_lost"
Reply With Quote #1

Im trying to make possible to play The Sacrifice finale with at least just 1 player (instead 2, just like L4D2 Mutation).

I get "Roundend blocked successful. Alive players: 1". But I still get error message on screen telling me "Mission failed. There must be at least 2 alive players" and round ends anyway.

It seems Plugin_Handled hasn't effect on "mission_lost" and "round_end".

PHP Code:
public OnPluginStart()
{
    
HookEvent("mission_lost"test_eventEventHookMode_Pre);
    
HookEvent("round_end"test_eventEventHookMode_Pre);
    
HookEvent("round_start"test_eventEventHookMode_Pre);
    
HookEvent("final_reportscreen"test_event);//never executed :(
}

public 
Action:test_event(Handle:event, const String:name[], bool:dontBroadcast)
{
    
//decl String:msg[256];
    //GetEventString(event, "message", msg, 255);
    //PrintToChatAll("Message: %s", msg);
    
    
    
new players 0;
    for (new 
i=1i<=MaxClientsi++)
    {
        if (!
IsClientInGame(i)) continue;
        if (!
IsPlayerAlive(i)) continue;
        if ( !(
GetClientTeam(i)==TEAM_SURVIVOR) ) continue;
        
players++;
    }
    if ( 
players>=)
    {
        
PrintToChatAll("Roundend blocked successful. Alive players: %i"players);
        return 
Plugin_Handled;
    }
    
    
PrintToChatAll("Mission failed. Alive players: %i"players);
    return 
Plugin_Continue;


Last edited by axelnieves2012; 10-27-2018 at 21:23.
axelnieves2012 is offline
nosoop
Veteran Member
Join Date: Aug 2014
Old 10-27-2018 , 20:16   Re: [L4D1][HELP] Cannot block event "mission_lost"
Reply With Quote #2

Events are effectively "notifications" that tell a client (or other entities) that something has happened; it doesn't stop whatever was happening.

Not sure how L4D1 performs its player check but you'll likely need to patch it up somewhere else.
__________________
I do TF2, TF2 servers, and TF2 plugins.
I don't do DMs over Discord -- PM me on the forums regarding inquiries.
AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)
nosoop is offline
axelnieves2012
Senior Member
Join Date: Oct 2014
Location: Argentina
Old 10-27-2018 , 21:22   Re: [L4D1][HELP] Cannot block event "mission_lost"
Reply With Quote #3

Quote:
Originally Posted by nosoop View Post
Events are effectively "notifications" that tell a client (or other entities) that something has happened; it doesn't stop whatever was happening.

Not sure how L4D1 performs its player check but you'll likely need to patch it up somewhere else.
Hi, thanks for replying me. I have finally found whats happens.
In that mission, when starting generator, game checks how many alive players there are.
If they are less than 2, it sets a deadflag to the last man standing, causing the mission to fail.
axelnieves2012 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 17:02.


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