From 7b2407f462f7f8c0225b27c1ca524a32e8db7b83 Mon Sep 17 00:00:00 2001 From: Cloudhax23 Date: Sat, 20 May 2017 18:15:17 -0500 Subject: [PATCH] Examples Updated Exile Update 1.0.3 --- ...eServer_object_container_database_load.sqf | 23 ++++++++++++++++ .../ExileServer_object_player_createBambi.sqf | 8 +++--- ...xileServer_object_player_database_load.sqf | 10 +++---- ...eServer_object_player_event_onMpKilled.sqf | 19 ++++++++++--- ...ect_vehicle_createNonPersistentVehicle.sqf | 4 +-- ...object_vehicle_createPersistentVehicle.sqf | 4 +-- ...ileServer_object_vehicle_database_load.sqf | 27 +++++++++++++++++-- .../ExileServer_system_database_handleBig.sqf | 2 +- ...rritory_maintenance_recalculateDueDate.sqf | 2 +- 9 files changed, 79 insertions(+), 20 deletions(-) diff --git a/Examples/Example Mission File/Exile.Altis/Exile_Server_Overrides/ExileServer_object_container_database_load.sqf b/Examples/Example Mission File/Exile.Altis/Exile_Server_Overrides/ExileServer_object_container_database_load.sqf index 821090a..b960edb 100644 --- a/Examples/Example Mission File/Exile.Altis/Exile_Server_Overrides/ExileServer_object_container_database_load.sqf +++ b/Examples/Example Mission File/Exile.Altis/Exile_Server_Overrides/ExileServer_object_container_database_load.sqf @@ -16,6 +16,29 @@ _position = [_data select 4, _data select 5, _data select 6]; _vectorDirection = [_data select 7, _data select 8, _data select 9]; _vectorUp = [_data select 10, _data select 11, _data select 12]; _abandoned = _data select 18; +try +{ + if !((vectorMagnitude _vectorUp) isEqualTo 1) then + { + throw true; + }; + if ((_vectorUp select 0) > 0.95) then + { + throw true; + }; + if ((_vectorUp select 1) > 0.95) then + { + throw true; + }; + if ((_vectorUp select 2) isEqualTo 0) then + { + throw true; + }; +} +catch +{ + _vectorUp = [0, 0, 1]; +}; _containerObject = [(_data select 1), _position, 0] call ExileServer_object_container_createContainer; _containerObject setVectorDirAndUp [_vectorDirection, _vectorUp]; _containerObject setVariable ["ExileDatabaseID", _containerID]; diff --git a/Examples/Example Mission File/Exile.Altis/Exile_Server_Overrides/ExileServer_object_player_createBambi.sqf b/Examples/Example Mission File/Exile.Altis/Exile_Server_Overrides/ExileServer_object_player_createBambi.sqf index 7c66bff..032636d 100644 --- a/Examples/Example Mission File/Exile.Altis/Exile_Server_Overrides/ExileServer_object_player_createBambi.sqf +++ b/Examples/Example Mission File/Exile.Altis/Exile_Server_Overrides/ExileServer_object_player_createBambi.sqf @@ -91,7 +91,7 @@ if (_devFriendlyMode isEqualTo 1) then { if ((getPlayerUID _requestingPlayer) isEqualTo (_x select 0))exitWith { - if((name _requestingPlayer) isEqualTo (_x select 1))then + if ((name _requestingPlayer) isEqualTo (_x select 1))then { _bambiPlayer setVariable ["ExileMoney", 500000, true]; _bambiPlayer setVariable ["ExileScore", 100000]; @@ -124,9 +124,9 @@ else { _spawnType = 0; }; -if((canTriggerDynamicSimulation _player) isEqualTo false) then +if((canTriggerDynamicSimulation _bambiPlayer) isEqualTo false) then { - _player triggerDynamicSimulation true; + _bambiPlayer triggerDynamicSimulation true; }; _bambiPlayer addMPEventHandler ["MPKilled", {_this call ExileServer_object_player_event_onMpKilled}]; _bambiPlayer call ExileServer_object_player_database_insert; @@ -150,4 +150,4 @@ _bambiPlayer call ExileServer_object_player_database_update; ] call ExileServer_system_network_send_to; [_sessionID, _bambiPlayer] call ExileServer_system_session_update; -true \ No newline at end of file +true diff --git a/Examples/Example Mission File/Exile.Altis/Exile_Server_Overrides/ExileServer_object_player_database_load.sqf b/Examples/Example Mission File/Exile.Altis/Exile_Server_Overrides/ExileServer_object_player_database_load.sqf index 0358e1a..ebb265a 100644 --- a/Examples/Example Mission File/Exile.Altis/Exile_Server_Overrides/ExileServer_object_player_database_load.sqf +++ b/Examples/Example Mission File/Exile.Altis/Exile_Server_Overrides/ExileServer_object_player_database_load.sqf @@ -75,12 +75,12 @@ if (_devFriendlyMode isEqualTo 1) then { _devs = getArray (configFile >> "CfgSettings" >> "ServerSettings" >> "devs"); { - if ((getPlayerUID _requestingPlayer) isEqualTo (_x select 0))exitWith + if (_playerUID isEqualTo (_x select 0)) exitWith { - if((name _requestingPlayer) isEqualTo (_x select 1))then + if (_name isEqualTo (_x select 1)) then { - _bambiPlayer setVariable ["ExileMoney", 500000, true]; - _bambiPlayer setVariable ["ExileScore", 100000]; + _player setVariable ["ExileMoney", 500000, true]; + _player setVariable ["ExileScore", 100000]; }; }; } @@ -247,4 +247,4 @@ if (getNumber (configFile >> "CfgSettings" >> "VehicleSpawn" >> "thermalVision") ] call ExileServer_system_network_send_to; [_sessionID, _player] call ExileServer_system_session_update; -true \ No newline at end of file +true diff --git a/Examples/Example Mission File/Exile.Altis/Exile_Server_Overrides/ExileServer_object_player_event_onMpKilled.sqf b/Examples/Example Mission File/Exile.Altis/Exile_Server_Overrides/ExileServer_object_player_event_onMpKilled.sqf index 70d163e..6bf464e 100644 --- a/Examples/Example Mission File/Exile.Altis/Exile_Server_Overrides/ExileServer_object_player_event_onMpKilled.sqf +++ b/Examples/Example Mission File/Exile.Altis/Exile_Server_Overrides/ExileServer_object_player_event_onMpKilled.sqf @@ -9,9 +9,10 @@ * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. */ -private["_victim","_killer","_countDeath","_countKill","_killSummary","_killingPlayer","_killType","_oldVictimRespect","_newVictimRespect","_oldKillerRespect","_newKillerRespect","_systemChat","_modifyVictimRespect","_respectLoss","_perks","_minRespectTransfer","_respectTransfer","_perkNames","_killerStatsNeedUpdate","_newKillerFrags","_victimStatsNeedUpdate","_newVictimDeaths","_victimPosition"]; +private["_victim", "_killer", "_instigator", "_countDeath", "_countKill", "_killSummary", "_killingPlayer", "_killType", "_oldVictimRespect", "_newVictimRespect", "_oldKillerRespect", "_newKillerRespect", "_unknownReasons", "_systemChat", "_modifyVictimRespect", "_respectLoss", "_perks", "_minRespectTransfer", "_respectTransfer", "_perkNames", "_killerStatsNeedUpdate", "_newKillerFrags", "_victimStatsNeedUpdate", "_newVictimDeaths", "_victimPosition"]; _victim = _this select 0; _killer = _this select 1; +_instigator = _this select 2; if (!isServer || hasInterface || isNull _victim) exitWith {}; _victim setVariable ["ExileDiedAt", time]; if !(isPlayer _victim) exitWith {}; @@ -21,7 +22,7 @@ _countDeath = false; _countKill = false; _killSummary = []; _killingPlayer = _killer call ExileServer_util_getFragKiller; -_killType = [_victim, _killer, _killingPlayer] call ExileServer_util_getFragType; +_killType = [_victim, _killer, _killingPlayer, _instigator] call ExileServer_util_getFragType; _oldVictimRespect = _victim getVariable ["ExileScore", 0]; _newVictimRespect = _oldVictimRespect; _oldKillerRespect = 0; @@ -34,8 +35,20 @@ switch (_killType) do { default { + _unknownReasons = + [ + "%1 died because... Arma.", + "%1 died because the universe hates him.", + "%1 died a mysterious death.", + "%1 died and nobody knows why.", + "%1 died because that's why.", + "%1 died because %1 was very unlucky.", + "%1 died due to Arma bugs and is probably very salty right now.", + "%1 died an awkward death.", + "%1 died. Yes, %1 is dead. Like really dead-dead." + ]; _countDeath = true; - _systemChat = format ["%1 died for an unknown reason!", name _victim]; + _systemChat = format [selectRandom _unknownReasons, name _victim]; _newVictimRespect = _oldVictimRespect - round ((abs _oldVictimRespect) / 100 * (getNumber (configFile >> "CfgSettings" >> "Respect" >> "Percentages" >> "unlucky"))); }; case 1: diff --git a/Examples/Example Mission File/Exile.Altis/Exile_Server_Overrides/ExileServer_object_vehicle_createNonPersistentVehicle.sqf b/Examples/Example Mission File/Exile.Altis/Exile_Server_Overrides/ExileServer_object_vehicle_createNonPersistentVehicle.sqf index 26101dc..ced7199 100644 --- a/Examples/Example Mission File/Exile.Altis/Exile_Server_Overrides/ExileServer_object_vehicle_createNonPersistentVehicle.sqf +++ b/Examples/Example Mission File/Exile.Altis/Exile_Server_Overrides/ExileServer_object_vehicle_createNonPersistentVehicle.sqf @@ -9,7 +9,7 @@ * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. */ -private["_className","_position","_direction","_usePositionATL","_vehicleObject"]; +private["_className", "_position", "_direction", "_usePositionATL", "_vehicleObject"]; _className = _this select 0; _position = _this select 1; _direction = _this select 2; @@ -19,4 +19,4 @@ _vehicleObject setVariable ["ExileIsPersistent", false]; _vehicleObject addEventHandler ["GetIn", {_this call ExileServer_object_vehicle_event_onGetIn}]; _vehicleObject addMPEventHandler ["MPKilled", { if !(isServer) exitWith {}; _this call ExileServer_object_vehicle_event_onMPKilled;}]; _vehicleObject enableDynamicSimulation true; -_vehicleObject \ No newline at end of file +_vehicleObject diff --git a/Examples/Example Mission File/Exile.Altis/Exile_Server_Overrides/ExileServer_object_vehicle_createPersistentVehicle.sqf b/Examples/Example Mission File/Exile.Altis/Exile_Server_Overrides/ExileServer_object_vehicle_createPersistentVehicle.sqf index 9ad945d..a1ddb76 100644 --- a/Examples/Example Mission File/Exile.Altis/Exile_Server_Overrides/ExileServer_object_vehicle_createPersistentVehicle.sqf +++ b/Examples/Example Mission File/Exile.Altis/Exile_Server_Overrides/ExileServer_object_vehicle_createPersistentVehicle.sqf @@ -9,7 +9,7 @@ * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. */ -private["_className","_position","_direction","_usePositionATL","_pinCode","_vehicleObject"]; +private["_className", "_position", "_direction", "_usePositionATL", "_pinCode", "_vehicleObject"]; _className = _this select 0; _position = _this select 1; _direction = _this select 2; @@ -22,4 +22,4 @@ _vehicleObject addEventHandler ["GetOut", {_this call ExileServer_object_vehicle _vehicleObject addEventHandler ["GetIn", {_this call ExileServer_object_vehicle_event_onGetIn}]; _vehicleObject addMPEventHandler ["MPKilled", { if !(isServer) exitWith {}; _this call ExileServer_object_vehicle_event_onMPKilled;}]; _vehicleObject enableDynamicSimulation true; -_vehicleObject \ No newline at end of file +_vehicleObject diff --git a/Examples/Example Mission File/Exile.Altis/Exile_Server_Overrides/ExileServer_object_vehicle_database_load.sqf b/Examples/Example Mission File/Exile.Altis/Exile_Server_Overrides/ExileServer_object_vehicle_database_load.sqf index 66661ec..595e418 100644 --- a/Examples/Example Mission File/Exile.Altis/Exile_Server_Overrides/ExileServer_object_vehicle_database_load.sqf +++ b/Examples/Example Mission File/Exile.Altis/Exile_Server_Overrides/ExileServer_object_vehicle_database_load.sqf @@ -9,7 +9,7 @@ * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. */ -private["_vehicleID","_data","_position","_vectorDirection","_vectorUp","_pinCode","_texture","_vehicleObject","_lock","_unlockInSafeZonesAfterRestart","_isLocked","_hitpoints","_cargoContainers"]; +private["_vehicleID", "_data", "_position", "_vectorDirection", "_vectorUp", "_pinCode", "_texture", "_vehicleObject", "_lock", "_unlockInSafeZonesAfterRestart", "_isLocked", "_hitpoints", "_cargoContainers"]; _vehicleID = _this; _data = format ["loadVehicle:%1", _vehicleID] call ExileServer_system_database_query_selectSingle; _position = [_data select 8, _data select 9, _data select 10]; @@ -17,6 +17,29 @@ _vectorDirection = [_data select 11, _data select 12, _data select 13]; _vectorUp = [_data select 14, _data select 15, _data select 16]; _pinCode = _data select 20; _texture = _data select 21; +try +{ + if !((vectorMagnitude _vectorUp) isEqualTo 1) then + { + throw true; + }; + if ((_vectorUp select 0) > 0.95) then + { + throw true; + }; + if ((_vectorUp select 1) > 0.95) then + { + throw true; + }; + if ((_vectorUp select 2) isEqualTo 0) then + { + throw true; + }; +} +catch +{ + _vectorUp = [0, 0, 1]; +}; _vehicleObject = [(_data select 1), _position, [_vectorDirection, _vectorUp], true,_pinCode] call ExileServer_object_vehicle_createPersistentVehicle; _vehicleObject setVariable ["ExileDatabaseID", _vehicleID]; _vehicleObject setVariable ["ExileOwnerUID", (_data select 3)]; @@ -79,4 +102,4 @@ if (_vehicleObject call ExileClient_util_world_isInTraderZone) then { _vehicleObject allowDamage false; }; -_vehicleObject \ No newline at end of file +_vehicleObject diff --git a/Examples/Example Mission File/Exile.Altis/Exile_Server_Overrides/ExileServer_system_database_handleBig.sqf b/Examples/Example Mission File/Exile.Altis/Exile_Server_Overrides/ExileServer_system_database_handleBig.sqf index 46eff40..7ec9ac5 100644 --- a/Examples/Example Mission File/Exile.Altis/Exile_Server_Overrides/ExileServer_system_database_handleBig.sqf +++ b/Examples/Example Mission File/Exile.Altis/Exile_Server_Overrides/ExileServer_system_database_handleBig.sqf @@ -9,7 +9,7 @@ * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. */ -private["_key","_result","_pipe"]; +private["_key", "_result", "_pipe"]; _key = _this; _result = ""; while{true} do diff --git a/Examples/Example Mission File/Exile.Altis/Exile_Server_Overrides/ExileServer_system_territory_maintenance_recalculateDueDate.sqf b/Examples/Example Mission File/Exile.Altis/Exile_Server_Overrides/ExileServer_system_territory_maintenance_recalculateDueDate.sqf index 79c881d..bb43e30 100644 --- a/Examples/Example Mission File/Exile.Altis/Exile_Server_Overrides/ExileServer_system_territory_maintenance_recalculateDueDate.sqf +++ b/Examples/Example Mission File/Exile.Altis/Exile_Server_Overrides/ExileServer_system_territory_maintenance_recalculateDueDate.sqf @@ -9,7 +9,7 @@ * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. */ -private["_flag","_currentTimestamp","_flagBuild","_maintenancePeriod","_maintenancePeriodDueDate"]; +private["_flag", "_currentTimestamp", "_flagBuild", "_maintenancePeriod", "_maintenancePeriodDueDate"]; _flag = _this; _currentTimestamp = call ExileServer_util_time_currentTime; _flagBuild = _flag getVariable ["ExileTerritoryLastPayed", _currentTimestamp];