Hiya, is there any way to get the upkeep duration from the TC, say for instance when a player views the contents?
Thanks in advance,
Tony.
Thanks in advance,
Tony.
In response to Rebajas ():Hiya, is there any way to get the upkeep duration from the TC, say for instance when a player views...
You can get player's building privilege, and access it's upkeep period (in the example - in minutes). Then just make calculations if you want to translate it into hrs/days.
void OnLootEntity(BasePlayer player, BaseEntity entity)
{
if(entity.ShortPrefabName == "cupboard.tool.deployed")
{
BuildingPrivlidge bp = player.GetBuildingPrivilege();
float i = bp.GetProtectedMinutes();
player.ChatMessage(string.Format("Protectedminutes: {0}",i));
}
} int days = 0;
int hours = 0;
int minutes = 0;
BuildingPrivlidge bp = player.GetBuildingPrivilege();
float i = bp.GetProtectedMinutes();
if(i>=1440)
{
int tempMin = Convert.ToInt32(i);
days = tempMin / 1440;
hours = (tempMin - days * 1440) / 60;
minutes = ((tempMin - days * 1440) - hours * 60);
}
else if(i>=60 && i<1440)
{
int tempMin = Convert.ToInt32(i);
hours = tempMin / 60;
minutes = tempMin - hours * 60;
}
else
{
minutes = Convert.ToInt32(i);
}
player.ChatMessage(string.Format("Protected for: \n{0} Days\n{1} Hours\n{2} Minutes", days, hours, minutes)); float i = toolcup.GetProtectedMinutes();returns always 0;