Raised This Month: $51 Target: $400
 12% 

Solved Spawn a player during respawn timer (DOD)


Post New Thread Reply   
 
Thread Tools Display Modes
cmndrfello
Junior Member
Join Date: Jan 2022
Old 01-04-2022 , 14:33   Re: Spawn a player during respawn timer (DOD)
Reply With Quote #11

Solved
The plugin actually had a nice solution! I fixed it a bit with the 'pev_deadflag' as the original code had some stuff that could be written a lot nicer

Code:
register_forward(FM_PlayerPreThink, "dod_player_prethink")

public dod_player_prethink(id)
{
	if(pev(id, pev_health) <= 0 && pev(id,pev_team) != 3 && get_pdata_int(id,366) != -1){
		//Player is dead and not spectator
		set_task(0.4,"dod_player_spawn",id);
		set_pev(id, pev_deadflag, DEAD_RESPAWNABLE);
	}
}

public dod_player_spawn(id){
	set_pev(id, pev_iuser1, 0);
	set_pdata_int(id, 264, 0);
	dllfunc(DLLFunc_Spawn, id);
}

Last edited by cmndrfello; 01-04-2022 at 14:34.
cmndrfello is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-04-2022 , 23:06   Re: Spawn a player during respawn timer (DOD)
Reply With Quote #12

It may not be the best way to do it (that plugin is 12+ years old) but if it works, that's good to know.
__________________
fysiks is offline
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 22:21.


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