Jump to content

Trouble with Calculation of GetTimeofDeath function and also GetCauseo


Alundaio

Recommended Posts

I'm having trouble with GetTimeofDeath. It isn't returning the correct value.

 

---------------------------EXAMPLE-------------------------------------------------

Float daysBeenDead

Float hourBeenDead

Float minBeenDead

 

;GetTimeDead is 48.5 in comment example

 

set daysBeenDead to mytarget.GetTimeDead/24 ;Now this should return 2.021

set hourBeenDead to daysBeenDead - Floor daysBeenDead ; This should return 0.021

set hourBeenDead to hourBeenDead * 24 ; This should set hourBeenDead to 0.50

set minBeenDead to hourBeenDead - Floor hourBeenDead ; This should set it to 0.50

set minBeenDead to minBeenDead * 60 ;this should set it to 30.00

 

 

ShowMessage ExampleMessage,daysBeenDead,hourBeenDead,minBeenDead

 

--------------------------------------------------------------------------------------------------

The message should say "They have been dead for 2 days, 0 hours and 30 minutes"

 

But minutes is always 0.

 

Also, GetCauseofDeath always returns -1. What am I doing wrong?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...