AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Most Efficient way to respawn player? (https://forums.alliedmods.net/showthread.php?t=274919)

Spirit_12 11-17-2015 22:05

Most Efficient way to respawn player?
 
I'm looking for the most efficient way to respawn a player. I don't intend to use deathmatch as it has a lot more features than what I require.

Would entity_spawn method be my best bet, or there is something else?

wickedd 11-17-2015 22:11

Re: Most Efficient way to respawn player?
 
PHP Code:

 ExecuteHam 


Spirit_12 11-17-2015 22:24

Re: Most Efficient way to respawn player?
 
You mean

Code:

Ham_Respawn

wickedd 11-17-2015 22:56

Re: Most Efficient way to respawn player?
 
No.
Code:

ExecuteHam(Ham_CS_RoundRespawn, this);
Edit:
PHP Code:

#include < amxmodx >
#include < hamsandwich >

public plugin_init()
{
    
register_event"DeathMsg""drop_dead""a" );
}    

public 
drop_dead( )
{
    new 
iVictim read_data)
    
    if( 
is_user_connectediVictim ) )
    {
        
set_task0.9"revive_you"iVictim )
    }
}

public 
revive_youid )
{
    
ExecuteHamHam_CS_RoundRespawnid )



fysiks 11-18-2015 20:46

Re: Most Efficient way to respawn player?
 
If other plugins need to know that the player respawned then you should use ExecuteHamB() (this triggers all associated hooks for the spawn event IIRC).

Jhob94 11-20-2015 09:48

Re: Most Efficient way to respawn player?
 
PHP Code:

set_pev(idpev_deadflagDEAD_RESPAWNABLE)
ExecuteHamB(Ham_CS_RoundRespawnid

That is the most correct way to respawn a player.

HamletEagle 11-20-2015 10:21

Re: Most Efficient way to respawn player?
 
Quote:

Originally Posted by Jhob94 (Post 2364775)
PHP Code:

set_pev(idpev_deadflagDEAD_RESPAWNABLE)
ExecuteHamB(Ham_CS_RoundRespawnid

That is the most correct way to respawn a player.

Setting deadflag is not needed, game does this automatically.


All times are GMT -4. The time now is 18:04.

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