Sign in to follow this  
geekm0nkey

Insure and item gets deleted?

4 posts in this topic

Is there a syntax for if I wanted to delete an item and insure that it actually gets deleted? specifically a body... I know exile has a hide body function but can this function be called within another script, if the deletevehicle function wouldn't do?

while {_this select 0} do
{
	deleteVehicle (_this select 0);
};

 

Edited by geekm0nkey

Share this post


Link to post
Share on other sites
54 minutes ago, geekm0nkey said:

Is there a syntax for if I wanted to delete an item and insure that it actually gets deleted? specifically a body... I know exile has a hide body function but can this function be called within another script, if the deletevehicle function wouldn't do?


while {_this select 0} do
{
	deleteVehicle (_this select 0);
};

 

object != bool 

hideBody _body; // Hide the body, and delete it, can be called anywhere.

or

_body call ExileServer_system_garbageCollector_deleteObject; // Delete the body, can only be called from the server.

 

If you delete something, it gets deleted. there is no chance of it not getting deleted.

Edited by StokesMagee

Share this post


Link to post
Share on other sites
Advertisement
7 hours ago, StokesMagee said:

If you delete something, it gets deleted. there is no chance of it not getting deleted.

Thanks for the suggestion.. however the above statement is not exactly true...  From Bohemia..

A deleted player unit will stay visible until that player has disconnected.

Also

If a dead unit is human player, the body is hidden but not deleted until player respawns.

How this become relevant, is I am issuing a reward based upon an action performed on a dead player (heads out of the gutter sickos) and I need to put into place a check or condition that would prevent abuse, such as claiming reward twice, or by multiple players. I will try the hide body function... If it doesn't work, could i use the same technique that the waste trader uses? Move the player body to a off map location? just before calling the hideBody code?

Share this post


Link to post
Share on other sites
2 hours ago, geekm0nkey said:

Thanks for the suggestion.. however the above statement is not exactly true...  From Bohemia..

A deleted player unit will stay visible until that player has disconnected.

Also

If a dead unit is human player, the body is hidden but not deleted until player respawns.

How this become relevant, is I am issuing a reward based upon an action performed on a dead player (heads out of the gutter sickos) and I need to put into place a check or condition that would prevent abuse, such as claiming reward twice, or by multiple players. I will try the hide body function... If it doesn't work, could i use the same technique that the waste trader uses? Move the player body to a off map location? just before calling the hideBody code?

// Can use this and let Exile clean it up
if (!_body getVariable ["RewardClaimed", false]) then // Check if the variable exists, it don't so it returns false
{
    // it's not been claimed 
	_body setVariable ["RewardClaimed", true]; // Set the variable to true, so the above statement is false
}
else
{
	// The reward has already been claimed..
}


// Or you can use this and clean it up yourself, and if a player is still controlling it, then let Exile clean it up.
if (_body getVariable ["RewardClaimed", false]) exitWith 
{
  // reward has been claimed 
};

// You can add the rewards here

deleteVehicle _body;
if (!isNull _body) then
{
	// Body has not been deleted, due to a player still using "controlling" it
	_body setVariable ["RewardClaimed", true]; // Set the variable so it can't be claimed twice.
};

Use this on the server

Edited by StokesMagee
  • Like 1

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.