Thread: Kill Limit
View Single Post
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 09-28-2011 , 21:43   Re: Kill Limit
Reply With Quote #4

in your server.cfg, mp_fraglimit 50

Then a plugin like this should do the trick... it is untested.

PHP Code:
#include <sourcemod>

new Handle:h_MaxFrags
new MaxFrags;

public 
OnPluginStart()
{
    
h_MaxFrags FindConVar("mp_fraglimit");
    
MaxFrags GetConVarInt(h_MaxFrags);

    
HookConVarChange(h_MaxFragsOnCVarChange);

    
HookEvent("player_death"OnPlayerDeathEventHookMode_Post);
}

public 
OnCVarChange(Handle:cvar, const String:oldVal[], const String:newVal[])
{
    
MaxFrags GetConVarInt(cvar);
}

public 
Action:OnPlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
killer GetClientOfUserId(GetEventInt(event"attacker"));

    if(
IsClientInGame(killer) && GetClientFrags(killer) >= MaxFrags)
        
PrintToChatAll("\x03%N\x04 is the WINNER the map, they reached a frag score of \x03%i\x04 first"killerMaxFrags);

Web compiler available at http://www.sourcemod.net/compiler.php or compile locally on your server

Last edited by TnTSCS; 09-29-2011 at 15:09.
TnTSCS is offline