Jump to content
Sign in to follow this  
BelgarionNL

Insurgency making Clan only Vehicles (lock)

Recommended Posts

dear fellow arma 2 players!

the clan i play with got fed up with people taking the choppers en vehicles all the time so they asked me to add a chopper and make 1 vehicle clan only!

but how do i accomplish that, seeing that on insurgency everything is spawned in when you move the MHQ so i need to script to reactivate everytime you deploy the MHQ again!

i was looking at this: http://forums.bistudio.com/showthread.php?t=116872&highlight=lock+script

but to let it run every 10 seconds will cause lag and i only want it to run after the base it deployed!

i can't be the first who encountered this problem with insurgency

Thx in advance

Belgarion

THE ANSWER IS:

initclient-common.sqf:

masterUIDArray = ["UID","UID","UID",];

masterClassArray = ["UH1Y","M2A3_EP1"];

And added a repeatedly activated trigger on the map:

Condition field: vehicle player != player

Activation Field: if (typeOf (vehicle player) in masterClassArray) then {if ((vehicle player emptyPositions "driver" == 0) && (player != driver vehicle player)) exitWith {};if (getPlayerUID player in masterUIDArray) then {hint " member/ts3 guest confirmed -- Good Hunting!"} else {player action ["getOut",(vehicle player)];hint "Only members or regulars are authorized to use this vehicle!"}}

for all the people who search the forums and would like to have a easy to find answer :)

Edited by BelgarionNL

Share this post


Link to post
Share on other sites

while {alive mhq} do
{
code
};

I've never really had a lag issue here.

EDIT: Are you looking to make it so that no one but clan members can get into the MHQ? If you are looking for that, read what's below. If you are looking for only clan members can deploy/undeploy, let me know.

If only for entering the vehicle, all you have to do is make sure the vehicle has the name check in it's init before and after respawn. So this is using Domination right? Assuming so, in the init of the vehicle you need to put the name check code in the link you posted (or something similar), then go into the x_client\x_initvec.sqf file and put the same code in the proper spot.

Edited by Grimes [3rd ID]

Share this post


Link to post
Share on other sites

just use getin eventhandlers:

something like this, untested btw:

place this in init.sqf with all your different clan members UID, its the number in profiles ingame SP menu.

MasterUIDlist = ["1234567","7654321","add more UIDs"]; publicVariable "MasterUIDlist";

place this in init of the vehicle, or alternatively save it as a script and reapply on vehicle respawn etc.

this addEventHandler ["GetIn", {
_veh = _this select 0;
_pos = _this select 1;
_unit = _this select 2;

if (isPlayer _unit) then {
	if (_pos == "driver") then {
		if ((getPlayerUID _unit) != MasterUIDlist) then {
			_fuel = fuel _veh;
			_veh setFuel 0;
			_veh vehicleChat format["%1 - you are not allowed to operate this vehicle",(name _unit)];
			sleep 1;
			_unit action ["getOut", _veh];
			_veh setFuel _fuel;
		} else {
			_veh vehicleChat format["Welcome %1",(name _unit)];
		};
	};
};
}];

it will eject any players that get into the driver seat of any vehicle and turn off the engine as well if they start it unless they are in the masterUID list.

Share this post


Link to post
Share on other sites

i know how to implement this script for lets say domination! but i don't know how to do it for INSURGENCY from Pogoman & Fireball because all is spawned it at the start!

i can't simply but this the INIT line of each vehicle! additionally i only want the MHQ/chopper and 1 vehicle locked for the clan! rest is open for public!

Edited by BelgarionNL

Share this post


Link to post
Share on other sites

just need to locate the vehicle spawn parts in the insurgency scripts, wich will require some digging on your part.

look out for createVehicle and that should narrow the search down.

then replace this line:

this addEventHandler ["GetIn", {

with

_vehicleYouFound addEventHandler ["GetIn", {

Share this post


Link to post
Share on other sites

_vehicle you found is that the name of each vehicle that i need to find?

and this i just add in the init.sqf? :

this addEventHandler ["GetIn", {

_veh = _this select 0;

_pos = _this select 1;

_unit = _this select 2;

if (isPlayer _unit) then {

if (_pos == "driver") then {

if ((getPlayerUID _unit) != MasterUIDlist) then {

_fuel = fuel _veh;

_veh setFuel 0;

_veh vehicleChat format["%1 - you are not allowed to operate this vehicle",(name _unit)];

sleep 1;

_unit action ["getOut", _veh];

_veh setFuel _fuel;

} else {

_veh vehicleChat format["Welcome %1",(name _unit)];

};

};

};

}];

and i change the: _vehicleYouFound addEventHandler ["GetIn", { to: _Mhq,car1,chopper1 addEv.............

or how do i make those 3 vehicles only clan-only (as driver only ofc.)

Edited by BelgarionNL

Share this post


Link to post
Share on other sites

yes, just replace _vehicleYouFound with _Mhq or car1 or chopper1 ect and those vehicles will be clan only for driver seat.

edit: ofc asuming you found the correct place in the scripts where it is created and respawned.

Share this post


Link to post
Share on other sites
yes, just replace _vehicleYouFound with _Mhq or car1 or chopper1 ect and those vehicles will be clan only for driver seat.

edit: ofc asuming you found the correct place in the scripts where it is created and respawned.

so just add that right in the scripts

---------- Post added at 22:06 ---------- Previous post was at 21:33 ----------

problem:

//////unit definitions

#define ATVTYPE "ATV_US_EP1"

#define HELITYPE "UH60M_MEV_EP1"

#define PILOTTYPE "US_Soldier_Pilot_EP1"

#define CAR1TYPE "HMMWV_M998_crows_M2_DES_EP1"

#define CAR2TYPE "HMMWV_M998A2_SOV_DES_EP1"

#define MHQTYPE "M1126_ICV_M2_EP1"

its not individually named so i am going to add a CAR3TYPE and HELI2TYPE but it still does not name them! so how do i make sure only those vehicles are clan locked?

Share this post


Link to post
Share on other sites

isn't there a simple script that will allow certain people to lock vehicles!

since I can't change the script for individual vehicle names

this is the script:

westVehicleChecker = {

private ["_vcl","_pos","_range","_driver","_plrs","_str"];

if (!alive MHQ && startLocation == MHQ) exitWith {

_vcl = createVehicle [MHQTYPE, spawnPos, [], 0, "None"];

_vcl setVehicleInit format["this setVehicleVarName ""%1""; %1 = this;", "MHQ"];

processInitCommands;

HQ setDir (getDir vehicleServicePoint + 90);

_pos = vehicleServicePoint modelToWorld [10,0,0];

_pos set [2,0];

HQ setPosATL _pos;

};

if (startLocation != HQ) exitWith {};

_pos = startLocation modelToWorld [0,15,0];

_pos set [2,0];

if (helipad distance _pos > 1) then {

helipad setPosATL _pos;

helipad setDir (getDir startLocation - 90);

};

_pos = startLocation modelToWorld [0,-10,0];

_pos set [2,0];

if (vehicleServicePoint distance _pos > 1) then {

vehicleServicePoint setPosATL _pos;

vehicleServicePoint setDir (getDir startLocation - 90);

};

_pos = startLocation modelToWorld [6,0,0];

_pos set [2,0];

if (fieldHospital distance _pos > 1) then {

fieldHospital setPosATL _pos;

fieldHospital setDir (getDir startLocation);

};

for "_i" from 0 to (count westVehicleStrings - 1) do {

_str = westVehicleStrings select _i;

// isNil _str check if the vehicle is undefined

// note that, _str does NOT get wrapped in quotes because _str contains the vehicle name

// and we are checking for the presence of the vehicle, I assume _str whill always be a valid string

if (isNil _str) then {

_i call resetWestVehicle;

} else {

_vcl = call compile _str;

// _vcl should not be NIL here .... due to ( isNil _str) protecting us

// but it could be anything, so ... check its an object

if (typeName _vcl=="OBJECT") then {

if ( isNull _vcl) then {

_i call resetWestVehicle;

} else {

if (!alive _vcl) then {

_i call resetWestVehicle;

} else {

scopeName "main";

_range = 400;

if (typeOf _vcl == ATVTYPE) then {

_range = 100;

};

if (typeOf _vcl == HELITYPE && heliRC == 1) exitWith { breakTo "main"; };

_plrs = nearestPlayers(getPosATL _vcl,SPAWNRANGE,false,"array");

if (alive _vcl && !arrCanSee(_plrs,_vcl,45,_range) && _vcl distance startLocation > 100) then {

_driver = driver _vcl;

_gunner = gunner _vcl;

if (!isNull _driver || !isNull _gunner) then {

if (alive _driver || alive _gunner) exitWith {

breakTo "main";

};

};

{ moveOut _x; } forEach (crew _vcl);

_i call resetWestVehicle;

};

};

};

};

};

sleep 0.01;

};

};

// returns one specific vehicle or re-creates it at the start position

resetWestVehicle = {

private ["_vcl","_str","_objs","_type","_bool","_pos","_dir","_id","_i"];

_i = _this;

_str = westVehicleStrings select _i;

if (_i > 10 || _i == -1) exitWith { }; //only return listed vehicles, but not MHQ

_id = _i % 6;

_pos = startLocation modelToWorld [-10,-10+_id*6,0];

_dir = getDir startLocation - 90;

_type = if (_id % 2 == 1) then { CAR1TYPE } else { CAR2TYPE };

if (_i >= 6) then {

_id = _id + 1;

_type = ATVTYPE;

_pos = startLocation modelToWorld [-10,-7+_id*6,0];

};

if (_i == 10) then {

_type = HELITYPE;

_pos = getPosATL helipad;

_dir = getDir helipad;

if (_pos distance startLocation > 100) exitWith {}; //avoid racing condition, where helipad is still at spawnPos

};

_pos set [2,0];

_bool = isNil _str;

_vcl = call compile _str;

if !_bool then { _bool = isNull _vcl || !alive _vcl; };

if _bool then {

_objs = nearestObjects[_pos,["LandVehicle","Air","CraterLong"],20];

if (count _objs > 0) then { { if (!(_x isKindOf "AllVehicles") || !alive _x) then { deleteVehicle _x; }; } forEach _objs; };

_vcl = createVehicle [_type, spawnPos, [], 0, "None"];

_vcl setVehicleInit format["this setVehicleVarName ""%1""; %1 = this;", _str];

_vcl setDir _dir;

_vcl setPosATL _pos;

if (_i < 6 || _i == 10) then { _vcl call setVclAmmoCargo; };

processInitCommands;

[player,_vcl,"loc",rSPAWN,_vcl,{ _this call addActionLock; }] call RE;

} else {

_vcl call vehicleService;

_vcl engineOn false;

_vcl setDir _dir;

_vcl setPosATL _pos;

};

};

setWeaponCargo = {

private ["_vci","_wep","_num","_cargo","_arr1","_arr2","_count","_id"];

_vcl = _this select 0;

_wep = _this select 1;

_num = 0;

_cargo = getWeaponCargo _vcl;

_arr1 = _cargo select 0;

_id = _arr1 find _wep;

if (_id == -1) exitWith {};

_arr1 set[_id, str _wep];

_arr2 = (_cargo select 1);

_arr2 set[_id, 0];

_cargo = [_arr1,_arr2];

_count = count _arr2;

call compile format['

_vcl setVehicleInit "

clearWeaponCargo this;

for ""_i"" from 0 to (%2 - 1) do {

_wep = (%1 select 0) select _i;

_num = (%1 select 1) select _i;

this addWeaponCargo [_wep,_num];

};

";

processInitCommands;

', _cargo, _count];

};

vehicleService = {

_this call setVclAmmoCargo;

processInitCommands;

};

setVclAmmoCargo = {

_this setVehicleInit '

this setVehicleAmmo 1;

this setFuel 1;

this setDamage 0;

clearWeaponCargo this;

clearMagazineCargo this;

{ this addMagazineCargo [_x select 0, _x select 1]; } forEach humvMagazines;

if (player in crew this) then { titleText["Vehicle serviced", "PLAIN DOWN"]; };

';

};

addActionLock = {

private "_actionIndex";

_actionIndex = _this addAction ["Lock","common\client\actions\noScript.sqf",'

_this select 0 lock true;

_this select 0 removeAction (_this select 2);

_this select 0 call addActionUnlock;

',1,false,true,"","isAdmin"];

};

addActionUnlock = {

private "_actionIndex";

_actionIndex = _this addAction ["Unlock","common\client\actions\noScript.sqf",'

_this select 0 lock false;

_this select 0 removeAction (_this select 2);

_this select 0 call addActionLock;

',1,false,true,"","isAdmin"];

};

Edited by BelgarionNL

Share this post


Link to post
Share on other sites

[b]_vcl[/b] = createVehicle [MHQTYPE, spawnPos, [], 0, "None"]; 

the higlighted _vcl is what you need to add the eventhandler i described above on.

_vcl = createVehicle [MHQTYPE, spawnPos, [], 0, "None"]; 
_vcl addEventHandler ["GetIn", {.........................

edit: just to make it clear, now using above code, the MHQ can only be driven by the players who are listed in the MasterUID list.

Edited by Demonized

Share this post


Link to post
Share on other sites

i am gonna see if it works thanks :D

updated the script, add a heavy vehicle and chopper! those 2 have to be locked but for those 2 i do not see the _vcl = createVehicle [MHQTYPE, spawnPos, [], 0, "None"]; , or something similar

sorry to say i still need some help to get this to work :) mhq does not have to be locked just the huey and stryker in this case!

highlighted in bold

westVehicleChecker = {

private ["_vcl","_pos","_range","_driver","_plrs","_str"];

if (!alive MHQ && startLocation == MHQ) exitWith {

_vcl = createVehicle [MHQTYPE, spawnPos, [], 0, "None"];

_vcl setVehicleInit format["this setVehicleVarName ""%1""; %1 = this;", "MHQ"];

processInitCommands;

HQ setDir (getDir vehicleServicePoint + 90);

_pos = vehicleServicePoint modelToWorld [10,0,0];

_pos set [2,0];

HQ setPosATL _pos;

};

if (startLocation != HQ) exitWith {};

_pos = startLocation modelToWorld [-2,13,0];

_pos set [2,0];

if (helipad distance _pos > 1) then {

helipad setPosATL _pos;

helipad setDir (getDir startLocation - 180);

};

_pos = startLocation modelToWorld [1,-13,0]; // Bell: Places the new helipad2 (placed in editor)

_pos set [2,0];

if (helipad2 distance _pos > 1) then {

helipad2 setPosATL _pos;

helipad2 setDir (getDir startLocation - 90);

};

_pos = startLocation modelToWorld [11,10,0]; // Bell: Places the new helipad3 (placed in editor)

_pos set [2,0];

if (helipad3 distance _pos > 1) then {

helipad3 setPosATL _pos;

helipad3 setDir (getDir startLocation - 180);

};

_pos = startLocation modelToWorld [3,0,0];

_pos set [2,0];

if (vehicleServicePoint distance _pos > 1) then {

vehicleServicePoint setPosATL _pos;

vehicleServicePoint setDir (getDir startLocation - 180);

};

_pos = startLocation modelToWorld [1,-7,0];

_pos set [2,0];

if (fieldHospital distance _pos > 1) then {

fieldHospital setPosATL _pos;

fieldHospital setDir (getDir startLocation - 90);

};

for "_i" from 0 to (count westVehicleStrings - 1) do {

_str = westVehicleStrings select _i;

// isNil _str check if the vehicle is undefined

// note that, _str does NOT get wrapped in quotes because _str contains the vehicle name

// and we are checking for the presence of the vehicle, I assume _str whill always be a valid string

if (isNil _str) then {

_i call resetWestVehicle;

} else {

_vcl = call compile _str;

// _vcl should not be NIL here .... due to ( isNil _str) protecting us

// but it could be anything, so ... check its an object

if (typeName _vcl=="OBJECT") then {

if ( isNull _vcl) then {

_i call resetWestVehicle;

} else {

if (!alive _vcl) then {

_i call resetWestVehicle;

} else {

scopeName "main";

_range = 400;

if (typeOf _vcl == ATVTYPE) then {

_range = 100;

};

if (typeOf _vcl == HELITYPE && heliRC == 1) exitWith { breakTo "main"; };

_plrs = nearestPlayers(getPosATL _vcl,SPAWNRANGE,false,"array");

if (alive _vcl && !arrCanSee(_plrs,_vcl,45,_range) && _vcl distance startLocation > 100) then {

_driver = driver _vcl;

_gunner = gunner _vcl;

if (!isNull _driver || !isNull _gunner) then {

if (alive _driver || alive _gunner) exitWith {

breakTo "main";

};

};

{ moveOut _x; } forEach (crew _vcl);

_i call resetWestVehicle;

};

};

};

};

};

sleep 0.1;

};

};

// returns one specific vehicle or re-creates it at the start position

resetWestVehicle = {

private ["_vcl","_str","_objs","_type","_bool","_pos","_dir","_id","_i"];

_i = _this;

_str = westVehicleStrings select _i;

if (_i > 14 || _i == -1) exitWith { }; //only return listed vehicles, but not MHQ

_id = _i % 4;

_pos = startLocation modelToWorld [-10,-8+_id*3.5,0];

_dir = getDir startLocation - 90;

_type = if (_id % 2 == 1) then { CAR1TYPE } else { CAR2TYPE };

if (_i >= 4) then {

_id = _id + 1;

_type = ATVTYPE;

_pos = startLocation modelToWorld [-10,5+_id*2,0];

};

if (_i == 8) then {// Bell: Places the new HEAVYTYPE at helipad2

_type = HEAVYTYPE;

_pos = getPosATL helipad2;

_pos set [2,0];

_dir = getDir helipad2 - 0;

};

if (_i == 9) then {

_type = STATICHQ1;

_pos = startLocation modelToWorld [12,18,0]; // Bell: Places the new STATICHQ1

_pos set [2,0];

_dir = getDir startLocation - 315;

};

if (_i == 10) then {

_type = STATICHQ2;

_pos = startLocation modelToWorld [15,-15,0]; // Bell: Places the new STATICHQ2

_pos set [2,0];

_dir = getDir startLocation - 225;

};

if (_i == 11) then {

_type = STATICHQ3;

_pos = startLocation modelToWorld [-15,15,0]; // Bell: Places the new STATICHQ3

_pos set [2,0];

_dir = getDir startLocation - 45;

};

if (_i == 12) then {

_type = STATICHQ4;

_pos = startLocation modelToWorld [-15,-15,0]; // Bell: Places the new STATICHQ4

_pos set [2,0];

_dir = getDir startLocation - 135;

};

if (_i == 13) then {

_type = HELITYPE;

_pos = getPosATL helipad;

_dir = getDir helipad;

if (_pos distance startLocation > 100) exitWith {}; //avoid racing condition, where helipad is still at spawnPos

};

if (_i == 14) then { // Bell: Places the new CHOPPER at helipad3

_type = HELI2TYPE;

_pos = getPosATL helipad3;

_dir = getDir helipad;

if (_pos distance startLocation > 100) exitWith {}; //avoid racing condition, where helipad is still at spawnPos

};

_pos set [2,0];

_bool = isNil _str;

_vcl = call compile _str;

if !_bool then { _bool = isNull _vcl || !alive _vcl; };

if _bool then {

_objs = nearestObjects[_pos,["LandVehicle","Air","CraterLong"],20];

if (count _objs > 0) then { { if (!(_x isKindOf "AllVehicles") || !alive _x) then { deleteVehicle _x; }; } forEach _objs; };

_vcl = createVehicle [_type, spawnPos, [], 0, "None"];

_vcl setVehicleInit format["this setVehicleVarName ""%1""; %1 = this;", _str];

_vcl setDir _dir;

_vcl setPosATL _pos;

if (_i < 6 || _i == 10) then { _vcl call setVclAmmoCargo; };

processInitCommands;

[player,_vcl,"loc",rSPAWN,_vcl,{ _this call addActionLock; }] call RE;

} else {

_vcl call vehicleService;

_vcl engineOn false;

_vcl setDir _dir;

_vcl setPosATL _pos;

};

};

setWeaponCargo = {

private ["_vci","_wep","_num","_cargo","_arr1","_arr2","_count","_id"];

_vcl = _this select 0;

_wep = _this select 1;

_num = 0;

_cargo = getWeaponCargo _vcl;

_arr1 = _cargo select 0;

_id = _arr1 find _wep;

if (_id == -1) exitWith {};

_arr1 set[_id, str _wep];

_arr2 = (_cargo select 1);

_arr2 set[_id, 0];

_cargo = [_arr1,_arr2];

_count = count _arr2;

call compile format['

_vcl setVehicleInit "

clearWeaponCargo this;

for ""_i"" from 0 to (%2 - 1) do {

_wep = (%1 select 0) select _i;

_num = (%1 select 1) select _i;

this addWeaponCargo [_wep,_num];

};

";

processInitCommands;

', _cargo, _count];

};

vehicleService = {

_this call setVclAmmoCargo;

processInitCommands;

};

setVclAmmoCargo = {

_this setVehicleInit '

this setVehicleAmmo 1;

this setFuel 1;

this setDamage 0;

clearWeaponCargo this;

clearMagazineCargo this;

{ this addMagazineCargo [_x select 0, _x select 1]; } forEach humvMagazines;

if (player in crew this) then { titleText["Vehicle serviced", "PLAIN DOWN"]; };

';

};

addActionLock = {

private "_actionIndex";

_actionIndex = _this addAction ["Lock","common\client\actions\noScript.sqf",'

_this select 0 lock true;

_this select 0 removeAction (_this select 2);

_this select 0 call addActionUnlock;

',1,false,true,"","isAdmin"];

};

addActionUnlock = {

private "_actionIndex";

_actionIndex = _this addAction ["Unlock","common\client\actions\noScript.sqf",'

_this select 0 lock false;

_this select 0 removeAction (_this select 2);

_this select 0 call addActionLock;

',1,false,true,"","isAdmin"];

};

also the Init script is not very easily moddable:

but i think i need to keep that init line from your script in initserver-common.sqf right?

if !isDedicated then { startLoadingScreen ["Loading...","RscLoadScreenCustom"]; };

enableSaving [false, false];

waitUntil { isServer || !isNull player };

waitUntil { !isNil "BIS_MPF_InitDone" };

waitUntil { BIS_MPF_InitDone };

// Global Variable Init

curTime = time; //mission start time

serverLoadHint = false; //server load hint message

if (local player) then { call compile preprocessFileLineNumbers "initclient.sqf"; };

if (isServer) then { call compile preprocessFileLineNumbers "initserver.sqf"; };

Initclient-common.sqf:

// \initclient-common.sqf

#include "defines.sqf"

#include "functions.sqf"

#include "client\defines.sqf"

#include "client\variables.sqf"

#include "client\briefing.sqf"

#include "client\AI\functions.sqf"

#include "client\actions\functions.sqf"

#include "client\gear\functions.sqf"

#include "client\injured\functions.sqf"

#include "client\markers\functions.sqf"

#include "client\markers\createMarkers.sqf"

#include "client\misc\functions.sqf"

#include "client\misc\triggers.sqf"

#include "client\respawn\functions.sqf"

#include "client\support\functions.sqf"

#include "client\UI\functions.sqf"

#include "client\UI\onKeyPress.sqf"

#include "client\UI\onMouseMove.sqf"

player enableIRLasers true;

player enableGunLights true;

player setVariable ["BIS_noCoreConversations", true];

// Grass

grasslayer = 1;

setTerrainGrid 12.5;

// FSM for service point (vehicle repairs etc.)

execFSM "common\fsm\ServicePoint.fsm";

if isWest then {

//player addRating 1000000;

player addEventHandler ["handleDamage", { _this call handleDamage; }];

player addEventHandler ["killed",{ _this call onPlayerKilled; }];

player addEventHandler ["respawn",{ titleCut ["", "BLACK IN", 10]; }];

player addEventHandler ["fired",{ call firedEH; }];

call addActions;

};

if isEast then {

player setVariable ["INS_playerString",str player, true];

player addEventHandler ["respawn",{ removeAllWeapons player; }];

};

if (isServer) then { [] spawn { call compile preprocessFileLineNumbers "initserver.sqf"; }; };

endLoadingScreen;

waitUntil { !(isNull (findDisplay 46)) };

(findDisplay 46) displayAddEventHandler ["KeyDown", "_this call onKeyPress"];

(findDisplay 46) displayAddEventHandler ["MouseMoving", "_this call onMouseMove"];

waitUntil { !isDead(HQ) || time > 30 };

#include "client\mainLoop.sqf"

initserver-common.sqf:

#include "defines.sqf"

#include "functions.sqf"

#include "server\defines.sqf"

#include "server\cleanup\functions.sqf"

#include "server\markers\functions.sqf"

#include "server\AI\functions.sqf"

#include "server\AI\initUPS.sqf"

#include "server\caches\functions.sqf"

#include "server\vehicles\functions.sqf"

onPlayerConnected '

_caches = cacheList;

for "_i" from 0 to (count _caches - 1) do {

_cache = _caches select _i;

{

_x setMarkerPos (getMarkerPos _x);

_x setMarkerText (markerText _x);

} forEach cacheMarkers(_cache);

};

';

if (ambientCivilians == 1) then {

nul0 = [] execVM "common\server\IEDdetect\IEDdetect_init.sqf";

/* 200 - is the ambient radius from the player

1 - is the minimum amount of civilians near the player

70 - is the % of presence of a triggerman among them

10 - is the scan interval time

"house" - is the object classtype of what could potentially host triggermen bombs (there is always a 50% chance it will be a suicide bomber)

0 - is the beeping (0=no beep, 1=beep, 2=random)

100 - is the area to scan for suitable objects (e.g. "car") and attach the bomb to one of those, randomly. This is also the scan area for the triggerman to trigger the bomb

5 - is the area to scan for hostiles that can instill fear in the triggerman (read above for how fear works).

20 - is the area to scan for possible victims that will make the triggerman touch the bomb off.

65 - is the % for the triggerman to be a suicide bomber instead

WEST - is the side to consider enemy of the triggerman */

nul0 = [200,1,70,10,"house",0,100,5,20,65,WEST] execVM "common\server\IEDdetect\IEDdetect_ambientBombers.sqf";

};

setDate [2010, Month, Day, Hour, Minute + (time/60)];

setViewDistance VIEWDISTANCE;

_pos = randPos;

while { count (_pos isFlatEmpty [30,0,0.2,20,0,false,objNull]) == 0 || getTerrainHeightASL _pos <= 2 } do {

_pos = randPos;

};

HQ setDir (((CENTERPOS select 0) - (_pos select 0)) atan2 ((CENTERPOS select 1) - (_pos select 1))+90);

HQ setPosATL _pos;

waitUntil { !isDead(HQ) };

[] spawn { call spawnAIGuns; };

[] spawn { call setupCaches; };

[] spawn { call spawnAIVehicles; };

#include "server\mainLoop.sqf"

Edited by BelgarionNL

Share this post


Link to post
Share on other sites

No one will help you if you act like that. Threads are made daily in this section, sometimes other just get bumped to the next page out of site. Instead of getting ticked off, a simple *bump* will bring the thread back to the first page.

Share this post


Link to post
Share on other sites

why not execute a client loop? You could make an ID list serversided (using the serverside addon) and then get the client files to load that variable. Then set a script on a constant loop and if the player's ID doesnt match the ones in the variable list you could then implement your desired action. Make an array containing the classnames of the vehicles you want protected. Then a simple code:

_uid = getPlayerUID vehicle player;

If(((typeof vehicle player) in YourArrayName)&&!(_uid in Clanmemberlist) then {
player action ["getOut", vehicle player];
};

I haven't tested it but it should work.

Also try adding Demonized's code to turn off the engine in as well.

Edited by Double Doppler

Share this post


Link to post
Share on other sites

problem is that this is the first time i am editing anything else then domination and i am not familiar with those arrays and i need something more complete or a lengthier explanation on how to do it!

@kylania! hehe you are completely right! but the public tends to exploit stuff!

by making a huey and bradley ts3 regulars only it won't be exploited on the server and it won't f*ck the server up!

@Grimes [3rd ID]: my damn it reply was more my frustration at me that i can't fix it myself

Share this post


Link to post
Share on other sites
My idea was the most elegant and foolproof method. :)

I'm with ya. If they are messing up your server or mission because they are "exploiting" these vehicles, then kick them. Done. Easy. No scripting :D Using playerUIDs works, yes, but think of all the editing and adding and removing you'll have to do. Bleh.

Share this post


Link to post
Share on other sites
why not execute a client loop? You could make an ID list serversided (using the serverside addon) and then get the client files to load that variable. Then set a script on a constant loop and if the player's ID doesnt match the ones in the variable list you could then implement your desired action. Make an array containing the classnames of the vehicles you want protected. Then a simple code:

_uid = getPlayerUID vehicle player;

If(((typeof vehicle player) in YourArrayName)&&!(_uid in Clanmemberlist) then {
player action ["getOut", vehicle player];
};

I haven't tested it but it should work.

Also try adding Demonized's code to turn off the engine in as well.

could anyone explain this to me with a bit more details so i know how to do it?

Share this post


Link to post
Share on other sites

so no one has ever done this before! i can hardly imagine that

Edited by BelgarionNL

Share this post


Link to post
Share on other sites

I've added this to my initclient-common.sqf is that the correct sqf for this script?

masterUIDArray = ["UID","UID","UID",];

masterClassArray = ["UH1Y","M2A3_EP1"];

And added a repeatedly activated trigger:

Condition field: vehicle player != player

Activation Field: if (typeOf (vehicle player) in masterClassArray) then {if ((vehicle player emptyPositions "driver" == 0) && (player != driver vehicle player)) exitWith {};if (getPlayerUID player in masterUIDArray) then {hint " member/ts3 guest confirmed -- Good Hunting!"} else {player action ["getOut",(vehicle player)];hint "Only members or regulars are authorized to use this vehicle!"}}

this works PERFECTLY!

Edited by BelgarionNL

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  

×