Page 1 of 1

problem when respawning

Posted: Tue Oct 18, 2016 2:02 am
by doomjoshuaboy
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

Re: problem when respawning

Posted: Tue Oct 18, 2016 5:37 am
by Fused
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.