Raised This Month: $ Target: $400
 0% 

[CSS] Respawn after 20secs


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mau5
Member
Join Date: Feb 2012
Old 03-15-2012 , 07:35   [CSS] Respawn after 20secs
Reply With Quote #1

I want an plugin that if someone dies 20secs after the round starts he gets respawned
This is for deathrun
mau5 is offline
necavi
Veteran Member
Join Date: Sep 2010
Old 03-15-2012 , 07:47   Re: [CSS] Respawn after 20secs
Reply With Quote #2

PHP Code:
#include <sourcemod>
#include <cstrike>

public Plugin:myinfo 
{
    
name "Deathrun respawn",
    
author "necavi",
    
description "Deathrun respawn",
    
version "0.1",
    
url "http://necavi.com/"
}

public 
OnPluginStart()
{
    
HookEvent("player_death",Event_PlayerDeath);
}
public 
Event_PlayerDeath(Handle:event,const String:name[],bool:dontBroadcast)
{
    if(
GetGameTime()<=20.0)
    {
        new 
client GetClientOfUserId(GetEventInt(event,"userid"));
        
CS_RespawnPlayer(client);
    }

necavi is offline
mau5
Member
Join Date: Feb 2012
Old 03-15-2012 , 08:02   Re: [CSS] Respawn after 20secs
Reply With Quote #3

thanks
mau5 is offline
mau5
Member
Join Date: Feb 2012
Old 03-15-2012 , 11:40   Re: [CSS] Respawn after 20secs
Reply With Quote #4

Can you put an limit of one respawn per round please
mau5 is offline
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 03-15-2012 , 16:43   Re: [CSS] Respawn after 20secs
Reply With Quote #5

PHP Code:
#include <sourcemod>
#include <cstrike>

public Plugin:myinfo 
{
    
name "Deathrun respawn",
    
author "necavi + Dr. McKay",
    
description "Deathrun respawn",
    
version "0.2",
    
url "http://necavi.com/"
}

new 
bool:respawned[MAXPLAYERS 1] = {false, ...};

public 
OnPluginStart()
{
    
HookEvent("player_death",Event_PlayerDeath);
    
HookEvent("teamplay_round_start"Event_RoundStart);
}
public 
Event_PlayerDeath(Handle:event,const String:name[],bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event,"userid"));
    if(
GetGameTime()<=20.0 && !respawned[client])
    {
        
respawned[client] = true;
        
CS_RespawnPlayer(client);
    }
}
public 
Event_RoundStart(Handle:event, const STring:name[], bool:dontBroadcast)
{
    for(new 
0<= MaxClientsi++)
    {
        
respawned[i] = false;
    }
}
public 
OnClientConnected(client)
{
    
respawned[client] = false;

__________________

Last edited by Dr. McKay; 07-12-2012 at 10:12.
Dr. McKay 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 04:25.


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