setdate experiment

This commit is contained in:
[VB]AWOL
2013-10-19 21:53:35 -05:00
parent 91c0c4b2b2
commit f104e02c19
3 changed files with 22 additions and 4 deletions

View File

@@ -91,4 +91,8 @@ player addWeapon "Loot";
player addWeapon "Flare";
sleep 0.1;
deleteVehicle _old;
if (!isNull _old) then {
// this should not be needed as player is deleted in player_switchModel?
deleteVehicle _old;
};

View File

@@ -268,7 +268,7 @@ if (!isDedicated) then {
_handled = false;
if (_dikCode in[0x58,0x57,0x44,0x43,0x42,0x41,0x40,0x3F,0x3E,0x3D,0x3C,0x3B,0x0B,0x0A,0x09,0x08,0x07,0x06,0x05]) then {
_handled = true;
_handled = true;
};
if (_dikCode in actionKeys "MoveForward") exitWith {r_interrupt = true};
@@ -312,7 +312,7 @@ if (!isDedicated) then {
};
if (_dikCode in actionKeys "ForceCommandingMode") then {_handled = true};
if (_dikCode in actionKeys "PushToTalk" and (diag_tickdiag_tickTime - dayz_lastCheckBit > 10)) then {
if (_dikCode in actionKeys "PushToTalk" and (diag_tickTime - dayz_lastCheckBit > 10)) then {
dayz_lastCheckBit = diag_tickTime;
[player,50,true,(getPosATL player)] spawn player_alertZombies;
};
@@ -395,6 +395,20 @@ if (!isDedicated) then {
_handled
};
player_setDate = {
private ["_setdatebool","_forEachIndex","_newdate","_n"];
_setdatebool = false;
_n = _this;
{
if (_x != (_n select _forEachIndex)) exitWith {
_setdatebool = true;
};
} forEach date;
if (_setdatebool) then {
setDate _newdate;
};
};
player_serverModelChange = {
private["_object","_model"];
_object = _this select 0;

View File

@@ -58,7 +58,7 @@ if (isServer) then {
//Client only
if (!isDedicated) then {
"PVDZE_plr_SetDate" addPublicVariableEventHandler {setDate (_this select 1)};
"PVDZE_plr_SetDate" addPublicVariableEventHandler {(_this select 1) call player_setDate};
"PVDZE_obj_RoadFlare" addPublicVariableEventHandler {(_this select 1) spawn object_roadFlare};
"PVDZE_plr_Morph2" addPublicVariableEventHandler {(_this select 1) call player_serverModelChange};
"PVDZE_plr_Morph" addPublicVariableEventHandler {(_this select 1) call server_switchPlayer};