AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   [L4D2] - kill all survivors outside of goal saferoom (https://forums.alliedmods.net/showthread.php?t=139605)

Skorpion1976 10-03-2010 06:25

[L4D2] - kill all survivors outside of goal saferoom
 
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 ?

Jon 10-03-2010 15:09

Re: [L4D2] - kill all survivors outside of goal saferoom
 
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);         }     } }

Skorpion1976 10-04-2010 13:40

Re: [L4D2] - kill all survivors outside of goal saferoom
 
Oh, thanks! I am putting that in the plugin right away !


All times are GMT -4. The time now is 13:14.

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