View Single Post
TheRunningMan
Member
Join Date: Aug 2011
Location: Russia
Old 10-11-2011 , 05:13   Re: Kill Humans in round end
Reply With Quote #26

PHP Code:
#pragma semicolon 1

#include <zombiereloaded>   
#include <sdkhooks>   
#include <sdktools>   
#include <sourcemod>   


new Handle:t_timer INVALID_HANDLE;   
new 
Float:g_cvarRoundTime
new 
Float:ForTimer;   
       
public 
OnPluginStart()   
{   
    
HookEvent("round_freeze_end"RoundTime);   
}   
public 
OnMapStart()   

    
g_cvarRoundTime GetConVarFloat(FindConVar("mp_roundtime"));   

    
ForTimer = (g_cvarRoundTime*60 3); 
}   

public 
Action:RoundTime(Handle:event, const String:name[], bool:dontBroadcast)   
{  
    for(new 
Client 1Client <= MaxClientsClient++)  
    {  
        if (
IsClientInGame(Client)) 
        { 
            if (
ZR_IsClientHuman(Client) && IsPlayerAlive(Client))   
            {   
                
PrintToChat(Client"Round start: %0.2f"g_cvarRoundTime);   
            }  
        } 
    }  
      
    if (
t_timer != INVALID_HANDLE) { 
        
KillTimer(t_timer); 
        
t_timer INVALID_HANDLE
    }
     
    
t_timer CreateTimer(ForTimerkiller);  
}   

public 
Actionkiller(Handle:timer)   
{           
    for(new 
Client 1Client <= MaxClientsClient++)    
    {    
        if (
IsClientInGame(Client)) 
        { 
            if (
ZR_IsClientHuman(Client) && IsPlayerAlive(Client))   
            {   
                
//SetEntityHealth(Client, 1);   
                //SlapPlayer(Client, 1, false)   
                
ForcePlayerSuicide(Client);
            }   
        } 
    }  
    
    if (
t_timer != INVALID_HANDLE) { 
        
KillTimer(t_timer); 
        
t_timer INVALID_HANDLE
    } 
    return 
Plugin_Handled;   
}   

public 
OnPluginEnd()    
{   
    
UnhookEvent("round_freeze_end"RoundTime);   

Why plugin sometimes ignores these conditions?
PHP Code:
public Actionkiller(Handle:timer)    
{            
    for(new 
Client 1Client <= MaxClientsClient++)     
    {     
        if (
IsClientInGame(Client))  
        {  
            if (
ZR_IsClientHuman(Client) && IsPlayerAlive(Client))    
            { 
And kill zombies ....

Last edited by TheRunningMan; 10-11-2011 at 05:17.
TheRunningMan is offline