-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSaveLocation.sqf
30 lines (26 loc) · 921 Bytes
/
SaveLocation.sqf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//SaveLocation.sqf
//Runs on server
//Called by players
//Called from SaveLocation event
//pvs
private ["_caller", "_location", "_direction", "_NPC", "_NPCString", "_markerString", "_NPCNumString", "_respawnString", "_markerPos","_uid"];
//var init
_caller = player;
_uid = getPlayerUID player;
_location = getPos player;
_direction = getDir player;
_NPC = _this select 0;
//send location data to server to save
SaveLocation = [_caller,_uid,_location,_direction,_NPC];
publicVariableServer "SaveLocation";
//create a respawn marker if talking to an npc
if not (isPlayer _NPC) then
{
_NPCString = str _NPC;
_markerString = "respawn_guerrila_" + _NPCString;
_NPCNumString = _NPCString select [3,1];
_respawnString = "respawn" + _NPCNumString;
_markerPos = missionNamespace getVariable _respawnString;
deleteMarkerLocal _markerString;
createMarkerLocal [_markerString,_markerPos];
};