only allow selling of vehicle if local to player

This makes it so you must get into the drivers seat once first before
you can sell the vehicle.
This commit is contained in:
[VB]AWOL
2013-11-07 09:21:03 -06:00
parent cdc433fa0a
commit 54d692de1e
4 changed files with 49 additions and 25 deletions

View File

@@ -4,8 +4,8 @@ if(TradeInprogress) exitWith { cutText [(localize "str_epoch_player_103") , "PLA
TradeInprogress = true;
// Test cannot lock while another player is nearby
_playerNear = {isPlayer _x} count (player nearEntities ["CAManBase", 12]) > 1;
if(_playerNear) exitWith { TradeInprogress = false; cutText [(localize "str_epoch_player_104") , "PLAIN DOWN"]; };
//_playerNear = {isPlayer _x} count (player nearEntities ["CAManBase", 12]) > 1;
//if(_playerNear) exitWith { TradeInprogress = false; cutText [(localize "str_epoch_player_104") , "PLAIN DOWN"]; };
// [part_out,part_in, qty_out, qty_in, loc];
@@ -148,27 +148,31 @@ if (_qty >= _qty_in) then {
_okToSell = false;
};
};
if(local _obj) then {
if(_okToSell) then {
if(_okToSell) then {
if(!isNull _obj and alive _obj) then {
if(!isNull _obj and alive _obj) then {
for "_x" from 1 to _qty_out do {
player addMagazine _part_out;
for "_x" from 1 to _qty_out do {
player addMagazine _part_out;
};
_objectID = _obj getVariable ["ObjectID","0"];
_objectUID = _obj getVariable ["ObjectUID","0"];
PVDZE_obj_Delete = [_objectID,_objectUID,_activatingPlayer];
publicVariableServer "PVDZE_obj_Delete";
deleteVehicle _obj;
cutText [format[(localize "str_epoch_player_181"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
};
_objectID = _obj getVariable ["ObjectID","0"];
_objectUID = _obj getVariable ["ObjectUID","0"];
PVDZE_obj_Delete = [_objectID,_objectUID,_activatingPlayer];
publicVariableServer "PVDZE_obj_Delete";
deleteVehicle _obj;
cutText [format[(localize "str_epoch_player_181"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
} else {
cutText [format[(localize "str_epoch_player_182"),_textPartIn] , "PLAIN DOWN"];
};
} else {
cutText [format[(localize "str_epoch_player_182"),_textPartIn] , "PLAIN DOWN"];
cutText [(localize "str_epoch_player_245"), "PLAIN DOWN"];
};
};

View File

@@ -4,8 +4,8 @@ if(TradeInprogress) exitWith { cutText [(localize "str_epoch_player_103") , "PLA
TradeInprogress = true;
// Test cannot lock while another player is nearby
_playerNear = {isPlayer _x} count (player nearEntities ["CAManBase", 12]) > 1;
if(_playerNear) exitWith { TradeInprogress = false; cutText [(localize "str_epoch_player_104") , "PLAIN DOWN"]; };
//_playerNear = {isPlayer _x} count (player nearEntities ["CAManBase", 12]) > 1;
//if(_playerNear) exitWith { TradeInprogress = false; cutText [(localize "str_epoch_player_104") , "PLAIN DOWN"]; };
// [part_out,part_in, qty_out, qty_in, loc];
@@ -145,6 +145,10 @@ if (_qty >= _qty_in) then {
_obj = _obj select 0;
_okToSell = true;
if(!local _obj) then {
_okToSell = false;
};
if(_okToSell and !isNull _obj and alive _obj) then {
for "_x" from 1 to _qty_out do {
@@ -160,6 +164,8 @@ if (_qty >= _qty_in) then {
deleteVehicle _obj;
cutText [format[(localize "str_epoch_player_181"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
} else {
cutText [(localize "str_epoch_player_245"), "PLAIN DOWN"];
};
};

View File

@@ -4,8 +4,8 @@ if(TradeInprogress) exitWith { cutText [(localize "str_epoch_player_103") , "PLA
TradeInprogress = true;
// Test cannot lock while another player is nearby
_playerNear = {isPlayer _x} count (player nearEntities ["CAManBase", 12]) > 1;
if(_playerNear) exitWith { TradeInprogress = false; cutText [(localize "str_epoch_player_104") , "PLAIN DOWN"]; };
//_playerNear = {isPlayer _x} count (player nearEntities ["CAManBase", 12]) > 1;
//if(_playerNear) exitWith { TradeInprogress = false; cutText [(localize "str_epoch_player_104") , "PLAIN DOWN"]; };
// [part_out,part_in, qty_out, qty_in, loc];
@@ -169,10 +169,10 @@ if (_qty >= _qty_in) then {
};
};
if(_okToSell) then {
if(local _obj and !isNull _obj and alive _obj) then {
if(_okToSell) then {
if(!isNull _obj and alive _obj) then {
for "_x" from 1 to _qty_out do {
player addMagazine _part_out;
};
@@ -186,10 +186,14 @@ if (_qty >= _qty_in) then {
deleteVehicle _obj;
cutText [format[(localize "str_epoch_player_181"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
} else {
cutText [format[(localize "str_epoch_player_182"),_textPartIn] , "PLAIN DOWN"];
};
} else {
cutText [format[(localize "str_epoch_player_182"),_textPartIn] , "PLAIN DOWN"];
cutText [(localize "str_epoch_player_245"), "PLAIN DOWN"];
};
};
{player removeAction _x} forEach s_player_parts;s_player_parts = [];

View File

@@ -4974,5 +4974,15 @@
<French></French>
<Czech></Czech>
</Key>
<Key ID="STR_EPOCH_PLAYER_245">
<Original>Failed to sell vehicle, you must get into drivers seat first.</Original>
<English>Failed to sell vehicle, you must get into drivers seat first.</English>
<German>Failed to sell vehicle, you must get into drivers seat first.</German>
<Russian>Failed to sell vehicle, you must get into drivers seat first.</Russian>
<Spanish>Failed to sell vehicle, you must get into drivers seat first.</Spanish>
<Dutch>Failed to sell vehicle, you must get into drivers seat first.</Dutch>
<French>Failed to sell vehicle, you must get into drivers seat first.</French>
<Czech>Failed to sell vehicle, you must get into drivers seat first.</Czech>
</Key>
</Package>
</Project>