Search the Community
Showing results for tags 'setPosATL'.
Found 2 results
-
inidbi2 Help - Saving Player Location (Help with an Array)
pliskin124 posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi there, Thank you for taking the time to look at my post. I am trying to save the players location data into the idbi2 database. I have the Gear, Name, and UID all saving correctly, but for the life of me I cannot get the players location to save and read. I keep getting the error "error type String, expected number" on the init.sqf line 13 the "player setPosATL [_location select 0, _location select 1, _location select 2];" section. - Any help would be most appreciated. Init.sqf: _clientID = clientOwner; _UID = getPlayerUID player; _name = name player; _location = getPosATL player; checkForDatabase = [_clientID, _UID, _name, _location]; publicVariableServer "checkForDatabase"; "loadData" addPublicVariableEventHandler { _gear = (_this select 1); _location = [_this select 0, _this select 1, _this select 2]; player setUnitLoadout _gear; player setPosATL [_location select 0, _location select 1, _location select 2]; }; }; initServer: "checkForDatabase" addPublicVariableEventHandler { private ["_data"]; _data = (_this select 1); _clientID = (_data select 0); _UID = (_data select 1); _playerName = (_data select 2); _location = [_data select 0, _data select 1, _data select 2]; _inidbi = ["new", _UID, _location] call OO_INIDBI; _fileExist = "exists" call _inidbi; if (_fileExist) then { hint "FILE DOES EXIST, GETTING DATA"; null = [_UID, _clientID, _location] execVM "getData.sqf"; } else { hint "FILE DOES NOT EXIST, CREATING DATABASE"; null = [_clientID, _UID, _playerName, _location] execVM "createDatabase.sqf"; }; }; "saveData" addPublicVariableEventHandler { private ["_data"]; _data = (_this select 1); _UID = (_data select 0); _gear = (_data select 1); _location = [_data select 0, _data select 1, _data select 2]; _inidbi = ["new", _UID] call OO_INIDBI; ["write", ["Player Location", "Location", _location]] call _inidbi; ["write", ["Player Gear", "Gear", _gear]] call _inidbi; hint "data saved"; }; getData.sqf _UID = (_this select 0); _clientID = (_this select 1); _inidbi = ["new", _UID] call OO_INIDBI; _gear = ["read", ["Player Gear", "Gear", []]] call _inidbi; _location = ["read", ["Player Location", "Location", []]] call _inidbi; loadData = _gear; _clientID publicVariableClient "loadData"; saveData.sqf { _gear = getUnitLoadout player; _location = getPosATL player; saveData = [_UID, _gear, _location]; publicVariableServer "saveData"; }- 28 replies
-
how to make an array with setPosATL & setDir positions for MP respawn ?
doomnet posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
hello, i have made some positions with setPosATL and setDir this setPosATL [16559.8,21846.6,1.13549]; this setDir 271.228; this setPosATL [16560.2,21848.7,1.10291]; this setDir 279.611; this setPosATL [16556.1,21847.2,0.573884]; this setDir 3.74775; this setPosATL [16556.8,21850.9,0.636226]; this setDir 268.757; how to make an array to use in this code for random respawn positions ? if (isServer) then { _randomPos = [,,,,] call BIS_fnc_selectRandom; player setPos (getPos _randomPos); }; i found a lot of answers for making an array but not for multiple setPos and setDir positions in one array !