Raised This Month: $12 Target: $400
 3% 

Solved respawn plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sanjay Singh
Veteran Member
Join Date: Sep 2016
Old 01-13-2020 , 05:22   respawn plugin
Reply With Quote #1

I need a good auto respawn plugin which will respawn player when they're dead and also respawn newly connected players.
which won't respawn spec players
__________________

Last edited by Sanjay Singh; 02-25-2020 at 12:17.
Sanjay Singh is offline
Send a message via AIM to Sanjay Singh
Old 01-13-2020, 06:10
redivcram
This message has been deleted by redivcram. Reason: nvm
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 01-13-2020 , 09:10   Re: respawn plugin
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>

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

new pRespawnEnabled

new const m_iMenu 205
new const CS_Menu_ChooseAppearance 3

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
RegisterHam(Ham_Killed"player""PostPlayerKilled"1)
    
pRespawnEnabled register_cvar("amx_respawn","1")
    
    
register_clcmd("joinclass","JoinClass")
    
register_clcmd("menuselect","JoinClass")
}

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 
JoinClass(id)
{
    if(
pev_valid(id) == && get_pdata_int(idm_iMenu) == CS_Menu_ChooseAppearance)
        
set_task(1.0"RespawnVictim"id)

__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/

Last edited by iceeedr; 01-14-2020 at 08:54.
iceeedr is offline
Send a message via Skype™ to iceeedr
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-13-2020 , 09:19   Re: respawn plugin
Reply With Quote #3

@iceeedr, the only 1.9 specific thing is RegisterHamPlayer and that can be easily replaced with RegisterHam. Given that 1.9 is not the stable release yet you should try to post code that works in 1.8.2 whenever possible.

For example if you were to change some gamerules offsets I would understand using 1.9 specific natives because the alternative for 1.8.2 is orpheu and it is not a trivial replacement.
__________________

Last edited by HamletEagle; 01-13-2020 at 09:19.
HamletEagle is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 01-13-2020 , 13:44   Re: respawn plugin
Reply With Quote #4

Quote:
Originally Posted by HamletEagle View Post
@iceeedr, the only 1.9 specific thing is RegisterHamPlayer and that can be easily replaced with RegisterHam. Given that 1.9 is not the stable release yet you should try to post code that works in 1.8.2 whenever possible.

For example if you were to change some gamerules offsets I would understand using 1.9 specific natives because the alternative for 1.8.2 is orpheu and it is not a trivial replacement.
Sure, but I always try to bring amx 1.9+ to the forum so that more people upgrade their servers, I use the dev version for over 1 year and it at least for me is perfectly stable, but as you well considered it to be an extremely change Easy for version 1.8.2 I made the change, thanks.
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-13-2020 , 14:49   Re: respawn plugin
Reply With Quote #5

If it was considered perfectly stable by the people developing it then it would have been already released.
The point of having both stable and dev versions is that people are not forced to use the new version until it was thoroughly tested. We should not be trying to get people to switch to a dev version, they should switch because they feel like it.
__________________
HamletEagle is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 01-13-2020 , 15:10   Re: respawn plugin
Reply With Quote #6

Code:
I use the dev version for over 1 year and it at least for me is perfectly stable
But I understand your point.
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
Sanjay Singh
Veteran Member
Join Date: Sep 2016
Old 01-14-2020 , 05:53   Re: respawn plugin
Reply With Quote #7

Error

PHP Code:
// H:\AMX 1.8.2\scripting\autorespawn.sma(39) : error 017: undefined symbol "get_ent_data" 
__________________
Sanjay Singh is offline
Send a message via AIM to Sanjay Singh
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 01-14-2020 , 08:55   Re: respawn plugin
Reply With Quote #8

Quote:
Originally Posted by Sanjay Singh View Post
Error

PHP Code:
// H:\AMX 1.8.2\scripting\autorespawn.sma(39) : error 017: undefined symbol "get_ent_data" 
I forgot that get_ent_data was only added in amx 1.9, updated my post with version 1.8.2 (now compiled to make sure).
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
wy19850
Member
Join Date: Feb 2020
Location: suzhou
Old 02-21-2020 , 17:32   Re: respawn plugin
Reply With Quote #9

#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>

#define PLUGIN "Respawn"
#define VERSION "100.0"
#define AUTHOR "iceeedR"

new pRespawnEnabled

new const m_iMenu = 205
new const CS_Menu_ChooseAppearance = 3

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)

RegisterHam(Ham_Killed, "player", "PostPlayerKilled", 1)
pRespawnEnabled = register_cvar("amx_respawn","1")

register_clcmd("joinclass","JoinClass")
register_clcmd("menuselect","JoinClass")
}

public PostPlayerKilled(iVictim, iAttacker, shouldgib)
{
if(get_pcvar_num(pRespawnEnabled)) {
set_task(100.0, "RespawnVictim", iVictim)
}
}

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

public JoinClass(id)
{
if(pev_valid(id) == 2 && get_pdata_int(id, m_iMenu) == CS_Menu_ChooseAppearance)
set_task(100.0, "RespawnVictim", id)
}


















#define VERSION "100.0"


set_task(100.0, "RespawnVictim", iVictim)

set_task(100.0, "RespawnVictim", id)




N time debugging will immediately resurrection, 10 seconds resurrection do friends, 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:34   Re: respawn plugin
Reply With Quote #10

1.82 platform
wy19850 is offline
Send a message via Skype™ to wy19850
Reply


Thread Tools
Display Modes

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 17:27.


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