View Single Post
wy19850
Member
Join Date: Feb 2020
Location: suzhou
Old 02-21-2020 , 17:12   Re: Need a simple auto respawn plugin
Reply With Quote #15

Quote:
Originally Posted by iceeedr View Post
Just a change in spawn, you should spawn the player after he chooses a team.

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <cstrike>
#include <fun>

#define PLUGIN "Respawn"
#define VERSION "1.0"
#define AUTHOR "NapoleoN#"

new pRespawnEnabledbool:FirstSpawn[33]

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam(Ham_Killed"player""PostPlayerKilled"1)
    
    
pRespawnEnabled register_cvar("amx_respawn","1")
    
    
register_event("TeamInfo" "TeamInfo" "a")
    
    
server_cmd("mp_buytime 0")
}

public 
client_connect(id) {
    
FirstSpawn[id] = true
}

public 
PostPlayerKilled(iVictimiAttackershouldgib) {
    if(
get_pcvar_num(pRespawnEnabled)) {
        
set_task(2.0"RespawnVictim"iVictim)
    }
}

public 
RespawnVictim(id) {
    if(
get_pcvar_num(pRespawnEnabled) && !is_user_alive(id)) {
        
ExecuteHamB(Ham_CS_RoundRespawnid
    }
}

public 
TeamInfo()
{
    new 
id szTeam];
    
    
id read_data)
    
read_dataszTeam charsmaxszTeam ) )
    
    switch( 
szTeam] )
    {
        case 
'T'
        {
            if(
FirstSpawn[id])
            {
                
set_task(2.0"RespawnVictim"id)
                
FirstSpawn[id] = false
            
}
        }
        case 
'C'
        {
            if(
FirstSpawn[id])
            {
                
set_task(2.0"RespawnVictim"id)
                
FirstSpawn[id] = false
            
}
        }
        
    }










set_task(2.0, "RespawnVictim", iVictim)

TO

set_task(10.0, "RespawnVictim", iVictim)



How will immediately resurrection, resurrection of 10 to 30 seconds, please. Thank you
wy19850 is offline
Send a message via Skype™ to wy19850