Jump to content
pliskin124

Restricting 3rd Person to specific players

Recommended Posts

 

Greetings,

 

I have an issue in my mission where some players insist on third person to play barbie doll dress up...but I want to restrict it from others because I know they cheat with it, I found this script in an old thread (and didn't want to resurrect it from the dead). My question is, where can I run this from, the init.sqf, or initServer.sqf? I assume it needs to run constantly to check for this, or would I call it directly from the init.sqf with something like execVM = ThirdPerson.sqf;

 

Second question, is it possible to white list specific unit names instead of classnames? I.e. instead of B_Soldier_Rifleman, something like "Soldier1"

 

Here is the script, thanks for any assistance.

 

_whitelist = [ "B_soldier_...", "bla" ];
_top = typeof player;

if ( _top in _whitelist ) exitWith {};

while {(true)} do
{
if (cameraView == "External") then
{
	(vehicle player) switchCamera "Internal";
};

sleep 0.5;
};

Share this post


Link to post
Share on other sites

Pplace it in init.sqf, or initPlayerlocal.sqf. This code must run on every clients/host.

 

White list can be any array of playable units you want.

For example:

_whiteList = playableUnits select {side _x == west}; // will not work if AIs are disabled in lobby

_whiteList = [unit1,unit2,unit3]; // as defined in editor

_whiteList = units group1 + units group2;

 

if (player in _whitelist) ....

 

 

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

×