CSWR script already has an option where you easily define if the AI should use a flashlight or night vision. Also, if they can even have them in their loadout. Check this out:
Hi, I am trying to save players position on a mission map using prifilenamespace of each player. Its working fine in editor, but refuse to work on dedicated server ... I wonder where is the problem?
//PERSISTENT PLAYER POS AND RATING
//saves players pos and rating every five min
//loads players pos and rating when they join server
//initServer.sqf
[]execVM "stats.sqf";
//stats.sqf
while {true} do {
_kibaPos = getPosATL kiba3x;
profileNamespace setVariable ["KIB_kibaPos", _kibaPos];
_kibaRating = rating kiba3x;
profileNamespace setVariable ["KIB_kibaRating",_kibaRating];
_kavhanPos = getPosATL kavhan;
profileNamespace setVariable ["KIB_kavhanPos", _kavhanPos];
_kavhanRating = rating kavhan;
profileNamespace setVariable ["KIB_kavhanRating", _kavhanRating];
_konalPosition = getPosATL konal;
profileNamespace setVariable ["KIB_konalPos", _konalPosition];
_konalRating = rating konal;
profileNamespace setVariable ["KIB_konalRating", _konalRating];
sleep 300;
};
//initPlayerLocal.sqf
//playable units are given variable names "kiba3x","kavhan","konal" in the editor
if ((str player) == "kiba3x") then {
_kibaPos = profileNamespace getVariable "KIB_kibaPos";
player setPosATL _kibaPos;
_kibaRating = profileNamespace getVariable "KIB_kibaRating";
player addRating _kibaRating;
} else {
if ((str player) == "kavhan") then {
_kavhanPos = profileNamespace getVariable "KIB_kavhanPos";
player setPosATL _namalskPos;
_kavhanRating = profileNamespace getVariable "KIB_kavhanRating";
player addRating _kavhanRating;
} else {
_konalPos = profileNamespace getVariable "KIB_konalPos";
player setPosATL _konalPos;
_konalRating = profileNamespace getVariable "KIB_konalRating";
player addRating _konalRating;
};
};