AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   [L4D2] Who called the horde? (https://forums.alliedmods.net/showthread.php?t=142843)

Ulrich 11-10-2010 18:25

[L4D2] Who called the horde?
 
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.

-.-Owned Myself-.- 11-13-2010 08:39

Re: [L4D2] Who called the horde?
 
1 Attachment(s)
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);



Ulrich 11-13-2010 16:56

Re: [L4D2] Who called the horde?
 
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.

danielmyst777 11-13-2010 18:52

Re: [L4D2] Who called the horde?
 
So technically speaking, this wouldn't report the console (director) as starting hoards or admins for calling in hoards through plug-ins right?

Danny_l4d 11-15-2010 04:14

Re: [L4D2] Who called the horde?
 
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?

Skorpion1976 11-16-2010 07:38

Re: [L4D2] Who called the horde?
 
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.

xPaw 11-17-2010 10:44

Re: [L4D2] Who called the horde?
 
Quote:

Originally Posted by Skorpion1976 (Post 1350493)
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!" ); }

danielmyst777 11-17-2010 11:13

Re: [L4D2] Who called the horde?
 
@xPaw

Your code won't compile.

xPaw 11-17-2010 11:40

Re: [L4D2] Who called the horde?
 
Quote:

Originally Posted by danielmyst777 (Post 1351286)
@xPaw

Your code won't compile.

try now

danielmyst777 11-17-2010 13:48

Re: [L4D2] Who called the horde?
 
Still no dice. Here's the error I'm getting:

/groups/sourcemod/upload_tmp/textgjAbZB.sp(1) : error 038: extra characters on line


All times are GMT -4. The time now is 12:24.

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