Raised This Month: $32 Target: $400
 8% 

Need a simple auto respawn plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Hartmann
Senior Member
Join Date: Nov 2014
Old 12-11-2019 , 15:59   Re: Need a simple auto respawn plugin
Reply With Quote #11

https://forums.alliedmods.net/showpo...92&postcount=2
__________________

RETAKES v1.0
github.com/alghtryer/retakes

Contact : [email protected]

BTC Donate: 1QAh1NLmeHy81LF9r8PaeGjYqHL2BBcJTx

Hartmann is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 12-23-2019 , 16:29   Re: Need a simple auto respawn plugin
Reply With Quote #12

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
            
}
        }
        
    }

Indeed, my bad. I should've added checks weither player is on TS or CT, if not, don't respawn.
I would suggest the thread maker to use the code listed above as this is the most efficient code to use.
__________________

Last edited by Napoleon_be; 12-23-2019 at 16:32.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Kvote
New Member
Join Date: May 2019
Old 02-08-2020 , 05:09   Re: Need a simple auto respawn plugin
Reply With Quote #13

Quote:
Originally Posted by Napoleon_be View Post
Updated version. Allthough i'm not sure what you mean with changing hostname (Do you mean the server name?) Untill i get clear intell on that, i'll just leave it for now.

1. Guns on respawn have been removed
2. added a server command that changes mp_buytime to 0, allthough i'm not sure if this would work, you gotta test it.
3. will be worked on
4. Should be fixed.

Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <hamsandwich> #include <cstrike> #include <fun> #define PLUGIN "Respawn" #define VERSION "1.0" #define AUTHOR "NapoleoN#" new pRespawnEnabled public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         RegisterHam(Ham_Killed, "player", "PostPlayerKilled", 1)         pRespawnEnabled = register_cvar("amx_respawn","1")         server_cmd("mp_buytime 0") } public client_putinserver(id) {     RespawnVictim(id) } public PostPlayerKilled(iVictim, iAttacker, shouldgib) {     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_RoundRespawn, id)         // set_task(0.5, "GiveWeapons", id) // Delay the give weapon option to avoid spawning weapons too fast.     } } /*public GiveWeapons(id) {     if(is_user_alive(id)) {         if(cs_get_user_team(id) == CS_TEAM_CT) {             give_item(id, "weapon_m4a1")             cs_set_user_bpammo(id, CSW_M4A1, 90)         }                 else if(cs_get_user_team(id) == CS_TEAM_T) {             give_item(id, "weapon_ak47")             cs_set_user_bpammo(id, CSW_AK47, 90)         }     } }*/
can you stop respawn when i move a player or all, to spec?
Kvote is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 02-09-2020 , 09:51   Re: Need a simple auto respawn plugin
Reply With Quote #14

@Kvote, just use iceeedr his code since it's more efficient. Start from there and ask for suggestions to get added.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
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
wy19850
Member
Join Date: Feb 2020
Location: suzhou
Old 02-21-2020 , 17:14   Re: Need a simple auto respawn plugin
Reply With Quote #16

I need 10 to 30 seconds delay resurrection plug-in, ask for help, thank you
wy19850 is offline
Send a message via Skype™ to wy19850
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 02-22-2020 , 06:56   Re: Need a simple auto respawn plugin
Reply With Quote #17

2 versions: First one with a cvar which u can edit. Make sure to use float values (e.g. 10.0 - 15.0 - 20.0).
Second version which generates a random time value between 10.0 and 30.0 seconds.

Also i optimized the code a bit by only using the FirstSpawn[id] check only one time, and setting it to false once aswell.

First version:
Spoiler


Second Version:
Spoiler
__________________

Last edited by Napoleon_be; 02-22-2020 at 11:39.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
CubyXX543
Junior Member
Join Date: Aug 2019
Old 06-11-2022 , 13:46   Re: Need a simple auto respawn plugin
Reply With Quote #18

Quote:
Originally Posted by Napoleon_be View Post
Indeed, my bad. I should've added checks weither player is on TS or CT, if not, don't respawn.
I would suggest the thread maker to use the code listed above as this is the most efficient code to use.

what a pile of crap :no no:kiss me :kissing_closed_eyes:
CubyXX543 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 15:52.


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