Raised This Month: $105 Target: $400
 26% 

respawn plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sanjay Singh
Senior Member
Join Date: Sep 2016
Old 01-13-2020 , 06: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; 01-13-2020 at 06:23.
Sanjay Singh is offline
Send a message via AIM to Sanjay Singh
Old 01-13-2020, 07:10
redivcram
This message has been deleted by redivcram. Reason: nvm
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 01-13-2020 , 10: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)

__________________

Last edited by iceeedr; 01-14-2020 at 09: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 , 10: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 10:19.
HamletEagle is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 01-13-2020 , 14: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.
__________________
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 , 15: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 , 16: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.
__________________
iceeedr is offline
Send a message via Skype™ to iceeedr
Sanjay Singh
Senior Member
Join Date: Sep 2016
Old 01-14-2020 , 06: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 , 09: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).
__________________
iceeedr is offline
Send a message via Skype™ to iceeedr
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 21:52.


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