Jump to content
Sign in to follow this  
CaptainGalaxy

Need help: Showing a hint to one side only

Recommended Posts

I'm making a sort of a quest multiplayer mission where two teams need to locate a laptop which will lead them to the next clue and so on...

If the _caller is west I want the hint to show to the west side players only etc.

I've already tried to apply my poor scripting skills and I'm not surprised it doesn't work. Any help is much appreciated!

I've placed a laptop with this in the init field:

this addAction ["Show me the hint", "Hint.sqf"];

Hint.sqf:

private = ["_laptop","_caller","_unitside"];

_laptop = _this select 0;
_caller - _this select 1;
_unitside = side _caller;

switch (_unitside) do { 
case west:

{if (side player == west) then

	{
	hint "Hint text here"; // script is supposed to check for a _caller side, then broadcast a hint to all players of the same side.
	};
else
	{
	hint "Blufor has located the laptop."; // this hint is supposed to appear for every player of the other side.
	};};

case east:

{if (side player == east) then

	{
	hint "Hint text here";
	};
else
	{
	hint "Opfor has located the laptop.";
	};};

};

Share this post


Link to post
Share on other sites

Just a quick idea, something along the lines of the following should do it (cant test it)

Laptop

this addAction ["Show me the hint", "LaptopFound.sqf"];  

LaptopFound.sqf

_sideThatFoundLaptop = side _this select 1;

[[[_sideThatFoundLaptop],"hint.sqf"],"BIS_fnc_execVM",true,true] call BIS_fnc_MP;


hint.sqf

if (!isDedicated) then
{

_unitside = _this select 0;

switch (_unitside) do {  
   case west: 

   {if (side player == west) then 

       { 
       hint "Hint text here"; // script is supposed to check for a _caller side, then broadcast a hint to all players of the same side. 
       }; 
   else 
       { 
       hint "Blufor has located the laptop."; // this hint is supposed to appear for every player of the other side. 
       };}; 

   case east: 

   {if (side player == east) then 

       { 
       hint "Hint text here"; 
       }; 
   else 
       { 
       hint "Opfor has located the laptop."; 
       };}; 

};
};

Should be enough to get you in the right direction at least

Share this post


Link to post
Share on other sites
Should be enough to get you in the right direction at least

Thank you! Bis_fnc_MP is definitely the way to go. Will try it out.

Share this post


Link to post
Share on other sites
this addAction ["Show me the hint", {["Hint.sqf","BIS_fnc_execVM",side (_this select 1)] call BIS_fnc_MP;}];

Share this post


Link to post
Share on other sites
this addAction ["Show me the hint", {["Hint.sqf","BIS_fnc_execVM",side (_this select 1)] call BIS_fnc_MP;}];

This worked like a charm, thanks!

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  

×