Jump to content
Robin Withes

Need some help with hideObjectGlobal

Recommended Posts

Hello,

 

I've been trying for 6 hours now to get my script working on a life server that allows cops to raid a weed processor. This is what i got so far : https://pastebin.com/VDE5WkMq

I have a huge problem with the hideobjectglobal though.. If i use the normal hideObject it only hides the object from the guy who triggers the script and if i put it on hideobjectglobal, nothing happens.

How do i fix this?

 

Share this post


Link to post
Share on other sites
Quote

[_weedShop, true] remoteExec ["hideObjectGlobal", 2];
[_weedMachine, true] remoteExec ["hideObjectGlobal", 2];
 

remoteExec with param 2 means you are executing the code only on the server. Use 0 instead. Eventhough I don't think you have to execute a global command globaly (do you? Other opinions and facts?)

Share this post


Link to post
Share on other sites

What about leaving out the remoteExec part?

object hideObjectGlobal true;

 

Share this post


Link to post
Share on other sites

Okay I'd need some more information:

  1. Are you server/client/host?
  2. How are you executing the script? (Where from and with which command?)
  3. Did you try to restart the device? (jk)
  4. Is the rest of the script working? Did you check with eg systemchat?

Hopefully we can fix this, eh?

Share this post


Link to post
Share on other sites

The rest of the script is working,

im running this on a server with the altis life framework,

the script executes when a addaction is pressed ingame

Share this post


Link to post
Share on other sites
hideObjectGlobal has to be executed on the server to work properly as far as I tested.

[_weedShop, true] remoteExec ["hideObjectGlobal", 2];

Or

_weedShop remoteExec ["hideObjectGlobal", 2];

work both for me.

Share this post


Link to post
Share on other sites

I tried this now bloodwyn:

/*
Author: Robin Withes
*/
//Denying anyone else than bluefor to execute this script
if (playerSide != west) exitWith {Hint "Only Bluefor can raid this processor.";};
//Declaring the 3 items that will need to be hided / unhided during the script
_laptop = getpos player nearestObject "Land_Laptop_unfolded_F";
_sign = getpos player nearestObject "Land_InfoStand_V2_F";
_prop = getpos player nearestObject "Land_Device_assembled_F";

[_laptop, true] remoteExec ["hideObjectGlobal", 2];
[_sign, true] remoteExec ["hideObjectGlobal", 2];
[_prop, true] remoteExec ["hideObjectGlobal", 2];
hint "Hidden all the props";

It still doesnt work. It gives me the hint but it does NOT hide the objects.

Share this post


Link to post
Share on other sites

Try to verify the objects with

_laptop = getpos player nearestObject "Land_Laptop_unfolded_F";
_sign = getpos player nearestObject "Land_InfoStand_V2_F";
_prop = getpos player nearestObject "Land_Device_assembled_F";
systemChat str [_laptop, _sign, _prop];

 

Share this post


Link to post
Share on other sites

Yep, your object must be within 50 m (of the player here) with nearestObject command.

 

Share this post


Link to post
Share on other sites

So, things seem to run like you created an object ocal. Where your info stand comes from? editor?, script? One sure thing,  the remoteExec on server (2)  for hideObjectGlobal works even if the variable (_laptop or else)  is local to a client.

Share this post


Link to post
Share on other sites

Did you test a simple hideObject, remoteExec everywhere (0)?

[_laptop, true] remoteExec ["hideObject", 0];

Share this post


Link to post
Share on other sites

tried this

/*
Author: Robin Withes
*/
//Denying anyone else than bluefor to execute this script
if (playerSide != west) exitWith {Hint "Only Bluefor can raid this processor.";};
//Declaring the 3 items that will need to be hided / unhided during the script
_laptop = getpos player nearestObject "Land_Laptop_unfolded_F";
_sign = getpos player nearestObject "Land_InfoStand_V2_F";
_prop = getpos player nearestObject "Land_Device_assembled_F";
systemChat str [_laptop, _sign, _prop];

[_laptop, true] remoteExec ["hideObject", 0];
[_sign, true] remoteExec ["hideObject", 0];
[_prop, true] remoteExec ["hideObject", 0];
hint "done 1";
//_laptop hideObjectGlobal true;
//_sign hideObjectGlobal true;
//_prop hideObjectGlobal true;

//[_laptop, true] remoteExec ["hideObjectGlobal", 2];
//[_sign, true] remoteExec ["hideObjectGlobal", 2];
//[_prop, true] remoteExec ["hideObjectGlobal", 2];

And it still does not work.

Share this post


Link to post
Share on other sites

are your _laptop and so on, attached to something? or have some specific textures?

Did you test it with an other object, named in editor, without any other consideration than hide it via this script.?

I'm still trying to help and wondering what could be wrong here. I hope you will have better help.

  • Like 1

Share this post


Link to post
Share on other sites

Are you testing this on server or in editor? Is the server using a command whitelist to prevent hacking? If yes is hideObjectGlobal allowed? 

Are you using a command whitelist in mission? If yes is hideObjectGlobal allowed there?

Share this post


Link to post
Share on other sites

It works now. I made 2 functions one of them hides the object one of them unhides it and initialised them in cfgremotexec and functions.hpp. I than did basically this:

 

 

/*
Author: Robin Withes

Description: This is a example how to hide and unhide objects. _weedmachine is the object.
*/

_weedMachine = nearestObject [player, "Land_Device_assembled_F"];
_clientID = owner _weedMachine;
_id = _clientID;

	[_weedMachine] remoteExecCall ["life_fnc_hideObj",-_id];
  hint "hid object, now waiting 10 seconds!";
  sleep 10;
  hint "Woke up, attempting to unhide obj!";
  [_weedMachine] remoteExecCall ["life_fnc_unHideObj",-_id];

 

Share this post


Link to post
Share on other sites

 

6 hours ago, mrcurry said:

Is the server using a command whitelist to prevent hacking? If yes is hideObjectGlobal allowed? 

Are you using a command whitelist in mission? If yes is hideObjectGlobal allowed there?

 This ^^^

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

×