problem when respawning

Discuss all aspects related to modding Zandronum here.
Post Reply
User avatar
doomjoshuaboy
Developer
Posts: 304
Joined: Thu Aug 02, 2012 5:36 am
Location: Australia
Contact:

problem when respawning

#1

Post by doomjoshuaboy » Tue Oct 18, 2016 2:02 am

Hi again

while i was triying to get the APROP_SpawnHEALTH to work: at first after i died respawned like this:
Image (feeling like a zombie)

after i leveled up
it works at started at 10 instead of 0
but i want to start at 100 and continue up.

Code: Select all

function void SetMaximumHealth (int p) 
{
      int p_tid = GetPlayerTIDByNum(p);
	SetActorProperty(p_tid,APROP_SpawnHEALTH,CheckInventory("CurrentMaxHealth"));
}

function void IncreaseMaximumHealth (int p) 
{    
	  int p_tid = GetPlayerTIDByNum(p);
		GiveInventory("CurrentMaxHealth",10);
		If(GetActorProperty(p_tid,APROP_Health) > 0)
			GiveInventory("NewHealth",10);
	SetMaximumHealth(p);
}

script 123 RESPAWN
{
GiveInventory("TemporaryProtectionGiver",1);
GiveInventory("MegaSphere",1);
SetMaximumHealth(0);
SetActorProperty(0, APROP_Health, CheckInventory("CurrentMaxHealth"));
}
Any help would be great.

Cheers
DoomJoshuaBoy

User avatar
Fused
Contributor
Posts: 663
Joined: Sat Nov 09, 2013 9:47 am
Location: Netherlands
Contact:

Re: problem when respawning

#2

Post by Fused » Tue Oct 18, 2016 5:37 am

Can you run a debug and check how many of the item CurrentMaxHealth you have after respawning? Big chance that's all taken after you respawn.
My mods
Image Image

My socials
Image Image

Post Reply