Jump to content
MC.Quit

Changing player side by crosshair (help)

Recommended Posts

private ["_prisonGroup","_guardGroup","_unit"];

_guardGroup = createGroup west;
_prisonGroup = createGroup civilian;
_unit = cursorObject;
switch (playerSide) do
{
case civilian:
{
    [_unit] joinSilent _friendlyGroup;//<<Enters player to Blufor
    silentHint "you are now a Prison Guard";

};
case west:
{
    [_unit] joinSilent _enemyGroup;//<<Enters player to Civilian
    silentHint "you are now a Prisoner";
};
};

 

Did i miss something? im not sure if i done it right because i placed a player as a civ infront a opfor soldier and tried switching the civ to the guardgroup (blufor) and it didnt work

But when i used the script with addaction like that (   [Player] joinSilent _friendlyGroup;//<<Enters player to Blufor  ) it worked on me any idea why it doesnt work?

  • Like 1

Share this post


Link to post
Share on other sites

_friendyGroup and _enemyGroup are not defined.

silentHint doesn't exist. HintSilent is better.

the cursorObject is a command returning object (if exists) on real time. You need to loop a condition if you want to use it (except if you are using the debug console on the fly, during game).

addAction can be alright if you point at some unit (for cursorObject) or if you place addACttion on unit. In this case you need to use specific variables (object,caller,id). See addAction.

Share this post


Link to post
Share on other sites
3 minutes ago, pierremgi said:

_friendyGroup and _enemyGroup are not defined.

silentHint doesn't exist. HintSilent is better.

the cursorObject is a command returning object (if exists) on real time. You need to loop a condition if you want to use it (except if you are using the debug console on the fly, during game).

addAction can be alright, but you need to use the specific variables. See addAction.

i want to slap my self for stupidity. XD thanks man i didnt notice the mistake lol 

*hint to self* do not make scripts at 3 am

Share this post


Link to post
Share on other sites

Hey MC.Quit question what are you trying to do. I am currently completing a prison Mission myself? I have using two police officers a doctor and a priest lol to help us break out of the prison. I have a very easy setup to initially put them on OPFOR side so they can enter the lockdown prison camp to get into position then I have them switch to blufor using a radio trigger that needs to be called by a player or a stationary trigger activates once they walk into zone. 

 

I don't use set captive for the prisoners because I want them being shot out if there are spotted outside of the barracks. Somebody help me with a code line that will switch every single Guard from careless to aware once a gunfire goes off.  The MP's patrol in the camp will only shoot at the prisoners if they have a direct line of sight and a few metres away. The cool thing about it is for whatever reason before they shoot at you they they will point and move their hand and verbally say something to you at that point if you do not back away they will open fire last the whole Camp goes on aware and combat mode. If this could help you let me know and I will provide you with the codes. Avibird

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

×