Examples Updated

Exile Update 1.0.3
This commit is contained in:
Cloudhax23 2017-05-20 18:15:17 -05:00
parent 8273340e7c
commit 7b2407f462
9 changed files with 79 additions and 20 deletions

View File

@ -16,6 +16,29 @@ _position = [_data select 4, _data select 5, _data select 6];
_vectorDirection = [_data select 7, _data select 8, _data select 9]; _vectorDirection = [_data select 7, _data select 8, _data select 9];
_vectorUp = [_data select 10, _data select 11, _data select 12]; _vectorUp = [_data select 10, _data select 11, _data select 12];
_abandoned = _data select 18; _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 = [(_data select 1), _position, 0] call ExileServer_object_container_createContainer;
_containerObject setVectorDirAndUp [_vectorDirection, _vectorUp]; _containerObject setVectorDirAndUp [_vectorDirection, _vectorUp];
_containerObject setVariable ["ExileDatabaseID", _containerID]; _containerObject setVariable ["ExileDatabaseID", _containerID];

View File

@ -91,7 +91,7 @@ if (_devFriendlyMode isEqualTo 1) then
{ {
if ((getPlayerUID _requestingPlayer) isEqualTo (_x select 0))exitWith 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 ["ExileMoney", 500000, true];
_bambiPlayer setVariable ["ExileScore", 100000]; _bambiPlayer setVariable ["ExileScore", 100000];
@ -124,9 +124,9 @@ else
{ {
_spawnType = 0; _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 addMPEventHandler ["MPKilled", {_this call ExileServer_object_player_event_onMpKilled}];
_bambiPlayer call ExileServer_object_player_database_insert; _bambiPlayer call ExileServer_object_player_database_insert;
@ -150,4 +150,4 @@ _bambiPlayer call ExileServer_object_player_database_update;
] ]
call ExileServer_system_network_send_to; call ExileServer_system_network_send_to;
[_sessionID, _bambiPlayer] call ExileServer_system_session_update; [_sessionID, _bambiPlayer] call ExileServer_system_session_update;
true true

View File

@ -75,12 +75,12 @@ if (_devFriendlyMode isEqualTo 1) then
{ {
_devs = getArray (configFile >> "CfgSettings" >> "ServerSettings" >> "devs"); _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]; _player setVariable ["ExileMoney", 500000, true];
_bambiPlayer setVariable ["ExileScore", 100000]; _player setVariable ["ExileScore", 100000];
}; };
}; };
} }
@ -247,4 +247,4 @@ if (getNumber (configFile >> "CfgSettings" >> "VehicleSpawn" >> "thermalVision")
] ]
call ExileServer_system_network_send_to; call ExileServer_system_network_send_to;
[_sessionID, _player] call ExileServer_system_session_update; [_sessionID, _player] call ExileServer_system_session_update;
true true

View File

@ -9,9 +9,10 @@
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. * 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; _victim = _this select 0;
_killer = _this select 1; _killer = _this select 1;
_instigator = _this select 2;
if (!isServer || hasInterface || isNull _victim) exitWith {}; if (!isServer || hasInterface || isNull _victim) exitWith {};
_victim setVariable ["ExileDiedAt", time]; _victim setVariable ["ExileDiedAt", time];
if !(isPlayer _victim) exitWith {}; if !(isPlayer _victim) exitWith {};
@ -21,7 +22,7 @@ _countDeath = false;
_countKill = false; _countKill = false;
_killSummary = []; _killSummary = [];
_killingPlayer = _killer call ExileServer_util_getFragKiller; _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]; _oldVictimRespect = _victim getVariable ["ExileScore", 0];
_newVictimRespect = _oldVictimRespect; _newVictimRespect = _oldVictimRespect;
_oldKillerRespect = 0; _oldKillerRespect = 0;
@ -34,8 +35,20 @@ switch (_killType) do
{ {
default 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; _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"))); _newVictimRespect = _oldVictimRespect - round ((abs _oldVictimRespect) / 100 * (getNumber (configFile >> "CfgSettings" >> "Respect" >> "Percentages" >> "unlucky")));
}; };
case 1: case 1:

View File

@ -9,7 +9,7 @@
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. * 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; _className = _this select 0;
_position = _this select 1; _position = _this select 1;
_direction = _this select 2; _direction = _this select 2;
@ -19,4 +19,4 @@ _vehicleObject setVariable ["ExileIsPersistent", false];
_vehicleObject addEventHandler ["GetIn", {_this call ExileServer_object_vehicle_event_onGetIn}]; _vehicleObject addEventHandler ["GetIn", {_this call ExileServer_object_vehicle_event_onGetIn}];
_vehicleObject addMPEventHandler ["MPKilled", { if !(isServer) exitWith {}; _this call ExileServer_object_vehicle_event_onMPKilled;}]; _vehicleObject addMPEventHandler ["MPKilled", { if !(isServer) exitWith {}; _this call ExileServer_object_vehicle_event_onMPKilled;}];
_vehicleObject enableDynamicSimulation true; _vehicleObject enableDynamicSimulation true;
_vehicleObject _vehicleObject

View File

@ -9,7 +9,7 @@
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. * 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; _className = _this select 0;
_position = _this select 1; _position = _this select 1;
_direction = _this select 2; _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 addEventHandler ["GetIn", {_this call ExileServer_object_vehicle_event_onGetIn}];
_vehicleObject addMPEventHandler ["MPKilled", { if !(isServer) exitWith {}; _this call ExileServer_object_vehicle_event_onMPKilled;}]; _vehicleObject addMPEventHandler ["MPKilled", { if !(isServer) exitWith {}; _this call ExileServer_object_vehicle_event_onMPKilled;}];
_vehicleObject enableDynamicSimulation true; _vehicleObject enableDynamicSimulation true;
_vehicleObject _vehicleObject

View File

@ -9,7 +9,7 @@
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. * 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; _vehicleID = _this;
_data = format ["loadVehicle:%1", _vehicleID] call ExileServer_system_database_query_selectSingle; _data = format ["loadVehicle:%1", _vehicleID] call ExileServer_system_database_query_selectSingle;
_position = [_data select 8, _data select 9, _data select 10]; _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]; _vectorUp = [_data select 14, _data select 15, _data select 16];
_pinCode = _data select 20; _pinCode = _data select 20;
_texture = _data select 21; _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 = [(_data select 1), _position, [_vectorDirection, _vectorUp], true,_pinCode] call ExileServer_object_vehicle_createPersistentVehicle;
_vehicleObject setVariable ["ExileDatabaseID", _vehicleID]; _vehicleObject setVariable ["ExileDatabaseID", _vehicleID];
_vehicleObject setVariable ["ExileOwnerUID", (_data select 3)]; _vehicleObject setVariable ["ExileOwnerUID", (_data select 3)];
@ -79,4 +102,4 @@ if (_vehicleObject call ExileClient_util_world_isInTraderZone) then
{ {
_vehicleObject allowDamage false; _vehicleObject allowDamage false;
}; };
_vehicleObject _vehicleObject

View File

@ -9,7 +9,7 @@
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. * 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; _key = _this;
_result = ""; _result = "";
while{true} do while{true} do

View File

@ -9,7 +9,7 @@
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. * 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; _flag = _this;
_currentTimestamp = call ExileServer_util_time_currentTime; _currentTimestamp = call ExileServer_util_time_currentTime;
_flagBuild = _flag getVariable ["ExileTerritoryLastPayed", _currentTimestamp]; _flagBuild = _flag getVariable ["ExileTerritoryLastPayed", _currentTimestamp];