AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Respawn connected player. (https://forums.alliedmods.net/showthread.php?t=93194)

xbatista 05-25-2009 13:42

Respawn connected player.
 
So I'm using Exolent Auto join on connect code http://forums.alliedmods.net/showthread.php?p=610161
I've tryied to respawn player in join team event and tryied with client_putinserver, won't respawn, so how to respawn player when he connected?

Respawn code:
PHP Code:

public respawn_player(id)
{
    
// Disconnected, already spawned
    
if ( !is_user_connected(id) || is_user_alive(id) )
        return;
    

    
// Try to spawn the player setting the appropiate dead flag and forcing a think 
    
set_pev(idpev_deadflagDEAD_RESPAWNABLE)
    
dllfunc(DLLFunc_Thinkid)



hleV 05-25-2009 13:50

Re: Respawn connected player.
 
Code:
new FirstJoin[33];   public plugin_init()         register_logevent("JoinedTeam", 2, "1=joined team");   public client_connect(Client)         FirstJoin[Client] = true;   public JoinedTeam() {         new LogUser[80], Name[32];         read_logargv(0, LogUser, 79);         parse_loguser(LogUser, Name, 31);         new Client = get_user_index(Name);           if (FirstJoin[Client] && !is_user_alive(Client))         {                 FirstJoin[Client] = false;                   respawn_player(Client);         } }

xbatista 05-25-2009 14:01

Re: Respawn connected player.
 
Tested
Still not respawning :|

hleV 05-25-2009 17:04

Re: Respawn connected player.
 
Try to include Ham Sandwich and change
Code:
respawn_player(Client);
to
Code:
ExecuteHamB(Ham_CS_RoundRespawn, Client);
If the respawn works, the problem is in your respawn_player() stock.

alan_el_more 05-26-2009 06:52

Re: Respawn connected player.
 
Don't work :S

xbatista 05-26-2009 08:54

Re: Respawn connected player.
 
Too not respawning with hamsandwich

ot_207 05-26-2009 09:47

Re: Respawn connected player.
 
Quote:

Originally Posted by xbatista (Post 835024)
Too not respawning with hamsandwich

Why not? It is the best way!

hleV 05-26-2009 10:02

Re: Respawn connected player.
 
Looks like I've registered the logevent incorrectly. It has 3 arguments.
Code:
#include <amxmodx> #include <hamsandwich>   new FirstJoin[33];   public plugin_init()         register_logevent("JoinedTeam", 3, "1=joined team");   public client_connect(Client)         FirstJoin[Client] = true;   public JoinedTeam() {         new LogUser[80], Name[32];         read_logargv(0, LogUser, 79);         parse_loguser(LogUser, Name, 31);         new Client = get_user_index(Name);           if (FirstJoin[Client] && !is_user_alive(Client) && 1 <= get_user_team(Client) < 3)         {                 FirstJoin[Client] = false;                   set_task(1.0, "RespawnPlayer", Client);         } }   public RespawnPlayer(Client)         ExecuteHamB(Ham_CS_RoundRespawn, Client);

ot_207 05-26-2009 10:12

Re: Respawn connected player.
 
http://forums.alliedmods.net/showpos...4&postcount=19

xbatista 05-26-2009 11:21

Re: Respawn connected player.
 
Again not working
P.S. I'm using this plugin http://forums.alliedmods.net/showthread.php?p=610161


All times are GMT -4. The time now is 01:31.

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