Raised This Month: $ Target: $400
 0% 

What is wrong with this respawn script


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
g_often
Senior Member
Join Date: Jan 2010
Location: In your mind
Old 10-22-2010 , 20:04   Re: What is wrong with this respawn script
Reply With Quote #2

Try this:

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <engine>

new CvarTimeRespawnCsTeams:g_Team;

public 
plugin_init()
{
    
register_plugin"Respawn""0.14b""G_often" )
    
    
CvarTimeRespawn register_cvar"respawn_time""1.0" )
    
    
register_event"DeathMsg""EventDeathMsg""a""1>0" );
    
    
register_event"TeamInfo""PlayerJoinTeam""a" )
}

public 
EventDeathMsg()
{
    static 
id;
    
id read_data)
    
    
g_Team cs_get_user_teamid )
    
    if( 
g_Team == CS_TEAM_UNASSIGNED || g_Team == CS_TEAM_SPECTATOR )
        return 
PLUGIN_HANDLED;
    
    
set_taskget_pcvar_floatCvarTimeRespawn ), "RespawnPlayer"id )
    return 
PLUGIN_CONTINUE;
}

public 
PlayerJoinTeam()
{
    static 
id;
    
id read_data)
    
    
g_Team cs_get_user_teamid )
    
    if( 
g_Team == CS_TEAM_UNASSIGNED || g_Team == CS_TEAM_SPECTATOR )
        return 
PLUGIN_HANDLED;
    
    
set_taskget_pcvar_floatCvarTimeRespawn ), "RespawnPlayer"id )
    return 
PLUGIN_CONTINUE;
}

public 
RespawnPlayerid )
{
    if( 
is_user_alive(id) )
        return;
    
    
set_hudmessageid22500.050.4506.06.00.50.15)
    
show_hudmessage(id,"[Respawned]")
    
    
client_print(idprint_console,"Respawned.")
    
    
entity_set_int(idEV_INT_deadflagDEAD_RESPAWNABLE)
    
entity_set_int(idEV_INT_iuser10)
    
call_think(id)
    
DispatchSpawn(id)

__________________
Reality is wrong, dreams are for real.

Last edited by g_often; 10-22-2010 at 20:30.
g_often is offline
 



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 10:16.


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