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

[L4D2] Who called the horde?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ulrich
Member
Join Date: Mar 2010
Location: In a box
Old 11-10-2010 , 18:25   [L4D2] Who called the horde?
Reply With Quote #1

I'd like to request a plugin that seems very simple, but I've yet to see anywhere.
Basically, I'd like a plugin that anounces to the server (via hint or chat message, then a console message) who starts a panic event through any of the following:
-- (Survival) Starting the round.
-- Shooting an alarm car.
-- Starting a panic even such as the Carnival Gate to the staduim, or the elevator in No Mercy.

Frankly, I'm tired of people starting before anyone's ready, and most of the time I'm too busy setting up to look at who did it. I want to know who starts it so that, if nesscarry, I can start warning/punishing them. But with no auto-punish system implemented, as there are too many factors that could go wrong and there's always an admin on the server.
Thanks in advance. And if any of these isn't possible (though I don't suspect they are), or if you think of any other horde-calling events that I left out, then please feel free to throw them in.
__________________

Last edited by Ulrich; 11-10-2010 at 22:41. Reason: Minor word change
Ulrich is offline
-.-Owned Myself-.-
Member
Join Date: Jul 2008
Old 11-13-2010 , 08:39   Re: [L4D2] Who called the horde?
Reply With Quote #2

I made this little plugin in about 10 minutes using the "create_panic_event" event. I haven't tested this but it should compile and work somewhat though on the events page it says this event doesn't always occur when the panic event actually occurs.

PHP Code:
/* Left 4 Dead 2 Panic Events */

#include <sourcemod>

public OnPluginStart()
{
    
/* Hook Panic Create event after it has happened */
    
HookEvent("create_panic_event"OnPanicCreate);
}

public 
Action:OnPanicCreate(Handle:event, const String:name[], bool:dontBroadcast)
{
    
/* Copy the UserID from the event over */
    
new uId GetEventInt(event"userid");
    
/* Now get the person's name */
    
new client GetClientOfUserId(uId);
    new 
cName[MAX_NAME_LENGTH];
    
GetClientName(clientcNamesizeof(cName));
    
/* Now tell everyone who created the event */
    
PrintToChatAll("\x03[Panic Event]\x01 %s created a panic event!"cName);

Attached Files
File Type: sp Get Plugin or Get Source (l4d2panicstarter.sp - 441 views - 644 Bytes)
-.-Owned Myself-.- is offline
Ulrich
Member
Join Date: Mar 2010
Location: In a box
Old 11-13-2010 , 16:56   Re: [L4D2] Who called the horde?
Reply With Quote #3

Well, I've tested it in survival mode (which was the one I really wanted it for, anyway, to see who started the round) and it would seem that it works as intended.
Thanks again.
__________________
Ulrich is offline
danielmyst777
AlliedModders Donor
Join Date: Aug 2010
Location: Virginia
Old 11-13-2010 , 18:52   Re: [L4D2] Who called the horde?
Reply With Quote #4

So technically speaking, this wouldn't report the console (director) as starting hoards or admins for calling in hoards through plug-ins right?
__________________
danielmyst777 is offline
Danny_l4d
Senior Member
Join Date: Feb 2010
Old 11-15-2010 , 04:14   Re: [L4D2] Who called the horde?
Reply With Quote #5

this is also working on l4d1, only when on like dead air final, you touch the radio and then the fuel pump it says the server name triggert the panic event, is that possible to make it like that you see the player that pushed the button?
__________________
Danny_l4d is offline
Skorpion1976
Veteran Member
Join Date: Jun 2009
Location: Austria
Old 11-16-2010 , 07:38   Re: [L4D2] Who called the horde?
Reply With Quote #6

Hi, sometimes the server hostname appears in the chat, instead of the player´s name . This happened on c8m3 when starting the outdoor elevator next to the gas station.
Skorpion1976 is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 11-17-2010 , 10:44   Re: [L4D2] Who called the horde?
Reply With Quote #7

Quote:
Originally Posted by Skorpion1976 View Post
Hi, sometimes the server hostname appears in the chat, instead of the player´s name . This happened on c8m3 when starting the outdoor elevator next to the gas station.
Here, this should fix this.

Code:
#include <sourcemod> public OnPluginStart( ) {     HookEvent( "create_panic_event", Event_Panic ); } public Action:Event_Panic( Handle:event, const String:name[], bool:dontBroadcast ) {     new id = GetClientOfUserId( GetEventInt( event, "userid" ) );         if( IsClientConnected( id ) ) {         decl String:szName[ MAX_NAME_LENGTH ];         GetClientName( id, szName, MAX_NAME_LENGTH - 1 );                 PrintToChatAll( "\x03[Panic Event]\x01 %s has started the panic!", szName );     } else         PrintToChatAll( "\x03[Panic Event]\x01 Panic has been started!" ); }
__________________

Last edited by xPaw; 11-19-2010 at 08:27.
xPaw is offline
danielmyst777
AlliedModders Donor
Join Date: Aug 2010
Location: Virginia
Old 11-17-2010 , 11:13   Re: [L4D2] Who called the horde?
Reply With Quote #8

@xPaw

Your code won't compile.
__________________
danielmyst777 is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 11-17-2010 , 11:40   Re: [L4D2] Who called the horde?
Reply With Quote #9

Quote:
Originally Posted by danielmyst777 View Post
@xPaw

Your code won't compile.
try now
__________________
xPaw is offline
danielmyst777
AlliedModders Donor
Join Date: Aug 2010
Location: Virginia
Old 11-17-2010 , 13:48   Re: [L4D2] Who called the horde?
Reply With Quote #10

Still no dice. Here's the error I'm getting:

/groups/sourcemod/upload_tmp/textgjAbZB.sp(1) : error 038: extra characters on line
__________________
danielmyst777 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 04:12.


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