Jump to content
Sign in to follow this  
Graz

Set Radio commands to UID

Recommended Posts

I've got a small trigger that's a radio command setting a global variable.

I know that I can bind radio commands to certain player slots and only allow accepted UID's into player slots.

Is there a way to cut out the middle man and just have the Setradiomsg

//My current template from demonized

if (unit1 == player) then {

1 setRadioMsg "Alpha Radio is showing this for player unit1";

} else {

1 setRadioMsg "NULL";

hint "for other players its not showing";

};

I'd like to change unit1 = player to

an expression that obtains player UID and matches is against an array of UIDs

Does anyone know how to do this?

NOTE: This is for MP so if I could avoid using "player" it would be appreciated!!

Share this post


Link to post
Share on other sites

setRadioMsg doesn't change its activation.

Something like this. Only works in MP.

if (isDedicated) exitWith {};
if (!isMultiplayer) exitWith {hintSilent "Can only check whitelist in multiplayer"};
waitUntil {!isNull player};
waitUntil {getPlayerUID player != ""};
_wl = ["123456","654321"];

if ((getPlayerUID player) in _wl) then 
{
_trg = createTrigger ["EmptyDetector", position player]; 
_trg setTriggerText "Var to true"; 
_trg setTriggerActivation ["ALPHA", "PRESENT", false]; 
_trg setTriggerStatements ["this", 'myVar = true; publicVariable "myVar"', ""]; 
};

You could also jus change the setTriggerStatements if you give the editor-placed trigger a name.

NOTE: This is for MP so if I could avoid using "player" it would be appreciated!!

I don't think you understand how the "player" variable works. It's different on every client :).

Edited by cuel

Share this post


Link to post
Share on other sites

Wow that looks great, I'll give it a whirl tonight. Thanks so much for the lightning fast response!

On player:

Most of my edits run on the client side, so player can cause some funky stuff to happen with triggers :)

Share this post


Link to post
Share on other sites

Having a few issues:

Most of the command is perfect

if (isDedicated) exitWith {};

if (!isMultiplayer) exitWith {hintSilent "Can only check whitelist in multiplayer"}; // HAVING ISSUE HERE

waitUntil {!isNull player};

waitUntil {getPlayerUID player != ""};

_wl = ["123456","654321"];

For some reason if I run the command in the init I get errors and crashes with the multiplayer line, what are the consequences to removing this line?

seems to run fine without the multilayer part :S

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  

×