Raised This Month: $ Target: $400
 0% 

[L4D] Calling victory


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mecha the Slag
Veteran Member
Join Date: Jun 2009
Location: Denmark
Old 11-03-2009 , 15:54   [L4D] Calling victory
Reply With Quote #1

Hi. I'm making a plugin for L4D versus, and I'm trying to find a way to call victory for the survivors. I've looked through

http://wiki.alliedmods.net/Left_4_Dead_Events

but I have little idea how to use them. I tried doing the following
PHP Code:
victory() {
    new 
Handle:event CreateEvent("finale_win")
    if (
event == INVALID_HANDLE)
    {
        
PrintToChatAll("Event is an invalid handle! GASP");
        return
    }
 
    new 
String:GameDifficulty[256];
    new 
String:GameMap[256];
    
GetConVarString(FindConVar("z_difficulty"), GameDifficultysizeof(GameDifficulty));
    
GetCurrentMap(GameMapsizeof(GameMap));
 
    
SetEventString(event"map_name"GameMap)
    
SetEventString(event"difficulty"GameDifficulty)
    
FireEvent(event)
    
PrintToChatAll("Event successfully fired!");


and it's being called correctly, but it doesn't actually start the victory screen or anything (only gave me an achievement fff)

Any help appreciated.
Mecha the Slag is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 11-03-2009 , 16:39   Re: [L4D] Calling victory
Reply With Quote #2

Firing the event won't actually end the game, you'll need to call a function with an SDKCall to do that.
bl4nk is offline
Mecha the Slag
Veteran Member
Join Date: Jun 2009
Location: Denmark
Old 11-03-2009 , 16:53   Re: [L4D] Calling victory
Reply With Quote #3

How would I go about doing that? (Sorry I am rather new to Sourcemod). I can't seem to find any function that would trigger the survivor victory.

Last edited by Mecha the Slag; 11-03-2009 at 17:36.
Mecha the Slag is offline
Mecha the Slag
Veteran Member
Join Date: Jun 2009
Location: Denmark
Old 11-04-2009 , 06:15   Re: [L4D] Calling victory
Reply With Quote #4

I tried looking around the Sourcemod documentation but the documentation around Left 4 Dead is limited (or I am unable to find it). Any help is appreciated D:
Mecha the Slag is offline
DarthNinja
SourceMod Plugin Approver
Join Date: Mar 2009
Location: PreThinkHook()
Old 11-04-2009 , 20:02   Re: [L4D] Calling victory
Reply With Quote #5

Have you looked in the SM scripting API?
It took me a while before I stumbled on it
__________________
DarthNinja is offline
Mecha the Slag
Veteran Member
Join Date: Jun 2009
Location: Denmark
Old 11-04-2009 , 20:31   Re: [L4D] Calling victory
Reply With Quote #6

Quote:
Originally Posted by DarthNinja View Post
Have you looked in the SM scripting API?
It took me a while before I stumbled on it
Yes I have and I'm using it frequently. There doesn't appear to be a direct win or victory feature.

Last edited by Mecha the Slag; 11-04-2009 at 20:58.
Mecha the Slag is offline
Mecha the Slag
Veteran Member
Join Date: Jun 2009
Location: Denmark
Old 11-14-2009 , 14:28   Re: [L4D] Calling victory
Reply With Quote #7

still need help with this D:
Mecha the Slag 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:30.


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