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

[L4D2] - kill all survivors outside of goal saferoom


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Skorpion1976
Veteran Member
Join Date: Jun 2009
Location: Austria
Old 10-03-2010 , 06:25   [L4D2] - kill all survivors outside of goal saferoom
Reply With Quote #1

Hi,
I browsed through the netprops wiki site for l4d2 and I wanted to find something that kills a player who is outside of the goal saferoom. I need this to force a round_end event under certain circumstances.

I already managed to incap all players which forces round_end too, but killing only those left outside is what I need. Is there a netprop that distinguishes players who are outside of the goal saferoom from others and therefore can be killed ? Can a round_end event be faked in another way ?
Skorpion1976 is offline
Jon
Veteran Member
Join Date: Dec 2007
Old 10-03-2010 , 15:09   Re: [L4D2] - kill all survivors outside of goal saferoom
Reply With Quote #2

Code:
#pragma semicolon 1 #include <sourcemod> #define L4D_TEAM_SURVIVOR 2 new bool:inSafeRoom[MAXPLAYERS + 1]; public OnPluginStart() {     HookEvent("player_entered_checkpoint", EventPlayerEnteredCheckpoint);     HookEvent("player_left_checkpoint", EventPlayerLeftCheckpoint); } public OnClientConnected(client) {     inSafeRoom[client] = false; } public Action:EventPlayerEnteredCheckpoint(Handle:event, const String:name[], bool:dontBroadcast) {     new client = GetClientOfUserId(GetEventInt(event, "userid"));     if(client && IsClientInGame(client) && GetClientTeam(client) == L4D_TEAM_SURVIVOR) {         inSafeRoom[client] = true;     } } public Action:EventPlayerLeftCheckpoint(Handle:event, const String:name[], bool:dontBroadcast) {     new client = GetClientOfUserId(GetEventInt(event, "userid"));     if(client && IsClientInGame(client) && GetClientTeam(client) == L4D_TEAM_SURVIVOR) {         inSafeRoom[client] = false;     } } KillOutsideSafeRoom() {     for(new i = 1; i <= MaxClients; i++) {         if(IsClientInGame(client) && GetClientTeam(client) == L4D_TEAM_SURVIVOR && !inSafeRoom[client]) {             ForcePlayerSuicide(i);         }     } }
Jon is offline
Skorpion1976
Veteran Member
Join Date: Jun 2009
Location: Austria
Old 10-04-2010 , 13:40   Re: [L4D2] - kill all survivors outside of goal saferoom
Reply With Quote #3

Oh, thanks! I am putting that in the plugin right away !
Skorpion1976 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 12:57.


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