Raised This Month: $ Target: $400
 0% 

Need help for AMX Respawn


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 04-05-2009 , 07:01   Re: Need help for AMX Respawn
Reply With Quote #1

SnoW, how killed player can be alive? your code is wrong.

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

new gCvarEnabled;

public 
plugin_init() {
    
register_plugin"Auto Respawn""1.0""xPaw" );
    
    
gCvarEnabled register_cvar"amx_respawn""1" );
    
    
RegisterHamHam_Killed"player""fwdKilledPlayer");
}

public 
fwdKilledPlayeriVictimiKiller ) {
    if( 
get_pcvar_numgCvarEnabled ) ) {
        
set_task10.0"fnRespawn"iVictim );
        
        return 
HAM_IGNORED;
    }
    
    return 
HAM_IGNORED;
}

public 
fnRespawnid ) {
    static 
iTeam get_user_teamid );
    
    if( !
is_user_alive(id) && (iTeam == || iTeam == 2) )
        
ExecuteHamBHam_CS_RoundRespawnid );
    
    return 
PLUGIN_CONTINUE;

__________________

Last edited by xPaw; 04-05-2009 at 13:42.
xPaw is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 04-05-2009 , 13:37   Re: Need help for AMX Respawn
Reply With Quote #2

Quote:
Originally Posted by xPaw View Post
SnoW, how killed player can be alive? your code is wrong.
Just optimized Miron's code and didn't look at the checks, so it left there.
Code:
    if( get_pcvar_num( gCvarEnabled ) ) { 
        set_task( 10.0, "fnRespawn", iVictim ); 
         
        return HAM_HANDLED; 
    } 
     
    return HAM_HANDLED; 
Isn't readable. I don't see a reason why you changed my HAM_IGNORED, but anyway.
SnoW is offline
Send a message via MSN to SnoW
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 02:25.


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