Jump to content
Sign in to follow this  
d3nn16

general (simple) script to delete dead objects

Recommended Posts

I use this method (I already posted the code in this thread) :

Put the following in init.sqf and name the character you will use as aP.

To know objects (dead or alive) around me (client machine) at 100 meters :

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_trig = createTrigger ["emptydetector", [0,0,0]];

_trig setTriggerArea [0, 0, 0, false];

_trig setTriggerActivation ["foxtrot", "present", true];

_trig setTriggerText "debug";

_trig setTriggerStatements ["this", "hint str [nearestObjects [player, ['man'], 100]]", ""];

To know what nearestObjects returns for server :

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_trig = createTrigger ["emptydetector", [0,0,0]];

_trig setTriggerArea [0, 0, 0, false];

_trig setTriggerActivation ["golf", "present", true];

_trig setTriggerText "debug2";

_trig setTriggerStatements ["this", "mytest = true; publicVariable 'mytest'", ""];

if (isServer) then

{

"mytest" addpublicvariableeventhandler

{

myres = str [nearestObjects [ap, ['man'], 100]];

publicVariable "myres";

};

}

else

{

"myres" addpublicvariableeventhandler

{

hint myres;

};

};

Share this post


Link to post
Share on other sites

addPublicVariableEventhandler note from BIKI:

Quote[/b] ]

Note that the EH is only fired on clients where the publicVariable command has not been executed, as publicVariable does not change the variable where it has been executed.

Xeno

Share this post


Link to post
Share on other sites

In this case it works :

mytest changed and PVed by client -> "mytest" addPVEH is on server

myres changed and PVed by server -> "myres" addPVEH is on client

Share this post


Link to post
Share on other sites

Then it's ok. Though I really don't understand what you want to achieve.

Xeno

Share this post


Link to post
Share on other sites

It allows me to see what is for instance the result of a command ran on a dedicated server while I am on client side.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×