Raised This Month: $ Target: $400
 0% 

Solved Spawn a player during respawn timer (DOD)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
cmndrfello
Junior Member
Join Date: Jan 2022
Old 01-02-2022 , 12:06   Spawn a player during respawn timer (DOD)
Reply With Quote #1

Hello, I've recently been trying to create a zombie plague style plugin for Day of Defeat.
I'm trying to make it so when an Allied player dies he will instantly be switched to Axis and respawn and moved to his last position.
But for some reason when I try to respawn the player after death it is unable to do it.

Even after creating a task with 'set_task' to try and respawn the player after the death animation it just won't work.

Is there a potential fix for this? Or would I have to settle for a timed respawn

Code:
public plugin_init()
{
RegisterHam(Ham_Killed, "player", "Ham_OnKilled_Post");
}

public Ham_OnKilled_Post(id, killer)
{
	new Float:value; 
	new string[MAX_STRING];
	
	//pev_deadflag of 'id' is 0 (DEAD_NO)

	if( get_user_team(id) == TEAM_HUMANS ) {
		new deathpos[3];

		get_user_origin(id, deathpos);
		dod_set_user_team(id, 2, 0);
                
                set_pev(id, pev_deadflag, DEAD_RESPAWNABLE);
                //pev_deadflag of 'id' is 3 (DEAD_RESPAWNABLE)
                DispatchSpawn(id);

		set_user_origin(id, deathpos);
	}
}

Last edited by cmndrfello; 01-04-2022 at 14:33.
cmndrfello 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 11:29.


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