Raised This Month: $ Target: $400
 0% 

Respawn connected player.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 05-25-2009 , 13:42   Respawn connected player.
Reply With Quote #1

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)

xbatista is offline
Send a message via Skype™ to xbatista
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 05-25-2009 , 13:50   Re: Respawn connected player.
Reply With Quote #2

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);         } }
__________________
hleV is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 05-25-2009 , 14:01   Re: Respawn connected player.
Reply With Quote #3

Tested
Still not respawning
xbatista is offline
Send a message via Skype™ to xbatista
Old 05-13-2010, 16:06
abdul-rehman
This message has been deleted by abdul-rehman.
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 05-25-2009 , 17:04   Re: Respawn connected player.
Reply With Quote #5

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.
__________________
hleV is offline
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 05-26-2009 , 06:52   Re: Respawn connected player.
Reply With Quote #6

Don't work :S
__________________
alan_el_more is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 05-26-2009 , 08:54   Re: Respawn connected player.
Reply With Quote #7

Too not respawning with hamsandwich
xbatista is offline
Send a message via Skype™ to xbatista
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 05-26-2009 , 09:47   Re: Respawn connected player.
Reply With Quote #8

Quote:
Originally Posted by xbatista View Post
Too not respawning with hamsandwich
Why not? It is the best way!
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 05-26-2009 , 10:02   Re: Respawn connected player.
Reply With Quote #9

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);
__________________
hleV is offline
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 05-26-2009 , 10:12   Re: Respawn connected player.
Reply With Quote #10

http://forums.alliedmods.net/showpos...4&postcount=19
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
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 01:31.


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