mirror of
https://github.com/Schalldampfer/DeployBike4A3E.git
synced 2024-08-30 16:42:10 +00:00
check puid instead of spawned object
This commit is contained in:
parent
de75788cfc
commit
b519a1f44c
@ -11,7 +11,7 @@ _vehObj = _this select 1;
|
||||
_vehClass = typeOf _vehObj;
|
||||
|
||||
if ((_vehObj getVariable ["EPOCH_DeployOwner","-1"]) == _puid) then {//check owner
|
||||
Deploy_DeployedVehicles = Deploy_DeployedVehicles - [_vehObj];//remove from array
|
||||
Deploy_DeployedPlayer = Deploy_DeployedPlayer - [_puid];//remove from array
|
||||
deleteVehicle _vehObj;//remove vehicle
|
||||
format["You've packed a %1!", _vehClass] remoteExec ["Epoch_message",_player];
|
||||
};
|
||||
|
@ -12,12 +12,11 @@ _vehClass = _this select 1;
|
||||
diag_log format["[DeployBike] Try spawning %1 by %2",_vehClass,_player];
|
||||
|
||||
_isOk = true;
|
||||
if(isNil "Deploy_DeployedVehicles") then {Deploy_DeployedVehicles = [];};
|
||||
if(isNil "Deploy_DeployedPlayer") then {Deploy_DeployedPlayer = [];};
|
||||
|
||||
//check player haven't spawned one
|
||||
{
|
||||
if ((_x getVariable ["EPOCH_DeployOwner","-1"]) == _puid) then { _isOk = false;"You've already deployed a vehicle!" remoteExec ["Epoch_message",_player]; };
|
||||
} foreach Deploy_DeployedVehicles;
|
||||
if (_puid in Deploy_DeployedPlayer) exitWith { _isOk = false;"You've already deployed a vehicle!" remoteExec ["Epoch_message",_player]; };
|
||||
|
||||
|
||||
//spawn
|
||||
if (_isOk) then {
|
||||
@ -29,7 +28,7 @@ if (_isOk) then {
|
||||
_vehObj setVelocity [0,0,.1];
|
||||
_vehObj call EPOCH_server_setVToken;
|
||||
//_vehObj call EPOCH_server_vehicleInit;
|
||||
Deploy_DeployedVehicles set [count Deploy_DeployedVehicles, _vehObj];//add to array
|
||||
Deploy_DeployedPlayer pushBack _puid;//add to array
|
||||
_vehObj setvariable ["EPOCH_DeployOwner",_puid];//set puid as owner
|
||||
_vehObj addEventHandler ["GetIn", {"WARNING: This vehicle will be deleted at restart!" remoteExec ["Epoch_message",_this select 2];}];//warn when get in
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user