|
|
Модератор форума: Slon |
Форум РЕДАКТОР - ArmA 2 Operation Arrowhead Скрипты Подскажите кто силен в скриптах (getPos,getPosASL,getPosATL) |
Подскажите кто силен в скриптах |
› Суббота
› 27.12.2014
› 16:50
› Сообщение #
Народ привет поскажите как изменить установку респа в dyaz на респ купленной техники
над водой. Все перепробовал что понимаю в скриптах не чего не помогает - на карте дейза поставил корабль и на него торговца - хотел сделать покупку боевых вертов и самов (сложно добратся,пополнение боеприпасов), проблемка в следуещем - поставил торговца он продает верты и самы при покупке верта он респится на высоте 360м от коробля. Пробовал поднять маркер респауна ( HeliHCivil) на уровень корабля - в редакторе все встает - а при запуске сервака (заход в игру) проваливается под уров воды. Включил респаун на парашутах - техника пролетает сквозь корабль и тонет .Отключил порашуты и парописал респу - _object = createVehicle [_class, [0,0,0], [], 0, "CAN_COLLIDE"]; _object_para setPos [_location select 0, _location select 1,(_location select 2) -330]; - начало работать можно выставить уровень респа от точки до корабля - но респ на земле вся техника проваливается на 330 метров и не появл на маркере. Скрипты респауна техники - Скрипт покупки техники на парашутах - Спойлерprivate ["_activatingPlayer","_isOK","_object","_worldspace","_location","_dir","_class","_uid","_key","_keySelected","_characterID","_donotusekey"];//PVDZE_veh_Publish2 = [_veh,[_dir,_location],_part_out,false,_keySelected,_activatingPlayer];_object = _this select 0;_worldspace = _this select 1;_class = _this select 2;_donotusekey = _this select 3;_keySelected = _this select 4;_activatingPlayer = _this select 5; if(_donotusekey) then { _isOK = true;} else { _isOK = isClass(configFile >> "CfgWeapons" >> _keySelected);}; if(!_isOK) exitWith { diag_log ("HIVE: CARKEY DOES NOT EXIST: "+ str(_keySelected)); }; if(_donotusekey) then { _characterID = _keySelected;} else { _characterID = str(getNumber(configFile >> "CfgWeapons" >> _keySelected >> "keyid"));}; diag_log ("PUBLISH: Attempt " + str(_object));_dir = _worldspace select 0;_location = _worldspace select 1; //Generate UID test using time_uid = _worldspace call dayz_objectUID3; // TODO: check if uid already exists && if so increment by 1 && check again as soon as we find nothing continue. //Send request_key = format["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:",dayZ_instance, _class, 0 , _characterID, _worldspace, [], [], 1,_uid];diag_log ("HIVE: WRITE: "+ str(_key)); _key call server_hiveWrite; // Switched to spawn so we can wait a bit for the ID[_object,_uid,_characterID,_class,_dir,_location,_donotusekey,_activatingPlayer] spawn { private ["_object","_uid","_characterID","_done","_retry","_key","_result","_outcome","_oid","_class","_location","_object_para","_donotusekey","_act ivatingPlayer"]; _object = _this select 0; _uid = _this select 1; _characterID = _this select 2; _class = _this select 3; //_dir = _this select 4; _location = _this select 5; _donotusekey = _this select 6; _activatingPlayer = _this select 7; _done = false; _retry = 0; // TODO: Needs major overhaul for 1.1 while {_retry < 10} do { sleep 1; // GET DB ID _key = format["CHILD:388:%1:",_uid]; diag_log ("HIVE: WRITE: "+ str(_key)); _result = _key call server_hiveReadWrite; _outcome = _result select 0; if (_outcome == "PASS") then { _oid = _result select 1; //_object setVariable ["ObjectID", _oid, true]; diag_log("CUSTOM: Selected " + str(_oid)); _done = true; _retry = 100; } else { diag_log("CUSTOM: trying again to get id for: " + str(_uid)); _done = false; _retry = _retry + 1; }; }; // Remove marker deleteVehicle _object; if(!_done) exitWith { diag_log("CUSTOM: failed to get id for : " + str(_uid)); }; if(DZE_TRADER_SPAWNMODE) then { _object_para = createVehicle ["ParachuteMediumWest", [0,0,0], [], 0, "CAN_COLLIDE"]; _object_para setPos [_location select 0, _location select 1,(_location select 2) + 65]; _object = createVehicle [_class, [0,0,0], [], 0, "CAN_COLLIDE"]; } else { _object = createVehicle [_class, _location, [], 0, "CAN_COLLIDE"]; }; if(!_donotusekey) then { // Lock vehicle _object setvehiclelock "locked"; }; clearWeaponCargoGlobal _object; clearMagazineCargoGlobal _object; // _object setVehicleAmmo DZE_vehicleAmmo; _object setVariable ["ObjectID", _oid, true]; _object setVariable ["lastUpdate",time]; _object setVariable ["CharacterID", _characterID, true]; if(DZE_TRADER_SPAWNMODE) then { _object attachTo [_object_para, [0,0,-1.6]]; sleep 1.0; WaitUntil{(([_object] call FNC_GetPos) select 2) < 0.1}; detach _object; deleteVehicle _object_para; }; PVDZE_serverObjectMonitor set [count PVDZE_serverObjectMonitor,_object]; _object call fnc_veh_ResetEH; // for non JIP users this should make sure everyone has eventhandlers for vehicles. PVDZE_veh_Init = _object; publicVariable "PVDZE_veh_Init"; diag_log ("PUBLISH: " + str(_activatingPlayer) + " Bought " + (_class) + " with ID " + str(_uid));}; Скрипт покупки техники - Спойлерprivate ["_activatingPlayer","_isOK","_object","_worldspace","_location","_dir","_class","_uid","_key","_keySelected","_characterID","_donotusekey"];//PVDZE_veh_Publish2 = [_veh,[_dir,_location],_part_out,false,_keySelected,_activatingPlayer];_object = _this select 0;_worldspace = _this select 1;_class = _this select 2;_donotusekey = _this select 3;_keySelected = _this select 4;_activatingPlayer = _this select 5;_characterID = _keySelected; _isOK = isClass(configFile >> "CfgVehicles" >> _class);if(!_isOK || isNull _object) exitWith { diag_log ("HIVE-pv3: Vehicle does not exist: "+ str(_class)); }; diag_log ("PUBLISH: Attempt " + str(_object));_dir = _worldspace select 0;_location = _worldspace select 1; //Generate UID test using time_uid = _worldspace call dayz_objectUID3; //Send request_key = format["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:",dayZ_instance, _class, 0 , _characterID, _worldspace, [], [], 1,_uid];diag_log ("HIVE: WRITE: "+ str(_key)); _key call server_hiveWrite; // Switched to spawn so we can wait a bit for the ID[_object,_uid,_characterID,_class,_dir,_location,_donotusekey,_activatingPlayer] spawn { private ["_object","_uid","_characterID","_done","_retry","_key","_result","_outcome","_oid","_class","_location","_donotusekey","_activatingPlayer", "_countr","_objectID","_objectUID","_dir","_newobject","_weapons","_magazines","_backpacks","_objWpnTypes","_objWpnQty"]; _object = _this select 0; _objectID = _object getVariable ["ObjectID","0"]; _objectUID = _object getVariable ["ObjectUID","0"]; _uid = _this select 1; _characterID = _this select 2; _class = _this select 3; _dir = _this select 4; // _location = _this select 5; _location = getPosATL _object; _donotusekey = _this select 6; _activatingPlayer = _this select 7; _done = false; _retry = 0; // TODO: Needs major overhaul for 1.1 while {_retry < 10} do { sleep 1; // GET DB ID _key = format["CHILD:388:%1:",_uid]; diag_log ("HIVE: WRITE: "+ str(_key)); _result = _key call server_hiveReadWrite; _outcome = _result select 0; if (_outcome == "PASS") then { _oid = _result select 1; //_object setVariable ["ObjectID", _oid, true]; diag_log("CUSTOM: Selected " + str(_oid)); _done = true; _retry = 100; } else { diag_log("CUSTOM: trying again to get id for: " + str(_uid)); _done = false; _retry = _retry + 1; }; }; if(!_done) exitWith { diag_log("CUSTOM: failed to get id for : " + str(_uid)); }; // add items from previous vehicle here _weapons = getWeaponCargo _object; _magazines = getMagazineCargo _object; _backpacks = getBackpackCargo _object; clearWeaponCargoGlobal _object; clearMagazineCargoGlobal _object; clearBackpackCargoGlobal _object; // Remove marker deleteVehicle _object; _newobject = createVehicle [_class, [0,0,0], [], 0, "CAN_COLLIDE"]; // remove old vehicle from DB [_objectID,_objectUID,_activatingPlayer] call server_deleteObj; // switch var to new vehicle at this point. _object = _newobject; _object setDir _dir; _object setPosATL _location; //Add weapons _objWpnTypes = _weapons select 0; _objWpnQty = _weapons select 1; _countr = 0; { _object addWeaponCargoGlobal [_x,(_objWpnQty select _countr)]; _countr = _countr + 1; } count _objWpnTypes; //Add Magazines _objWpnTypes = _magazines select 0; _objWpnQty = _magazines select 1; _countr = 0; { _object addMagazineCargoGlobal [_x,(_objWpnQty select _countr)]; _countr = _countr + 1; } count _objWpnTypes; //Add Backpacks _objWpnTypes = _backpacks select 0; _objWpnQty = _backpacks select 1; _countr = 0; { _object addBackpackCargoGlobal [_x,(_objWpnQty select _countr)]; _countr = _countr + 1; } count _objWpnTypes; _object setVariable ["ObjectID", _oid, true]; _object setVariable ["lastUpdate",time]; _object setVariable ["CharacterID", _characterID, true]; PVDZE_serverObjectMonitor set [count PVDZE_serverObjectMonitor,_object]; _object call fnc_veh_ResetEH; // for non JIP users this should make sure everyone has eventhandlers for vehicles. PVDZE_veh_Init = _object; publicVariable "PVDZE_veh_Init"; diag_log ("PUBLISH: " + str(_activatingPlayer) + " Upgraded " + (_class) + " with ID " + str(_uid));}; Подскажите что надо на что поменять ,гдето тут видел тему про установки позиции (getPos,getPosASL,getPosATL), но сейчас ненайти.Знаю что гдето тут надо немного изменить но слаб знаниями . Это из сервер функциях(server_functions.sqf) - // Find Vehicle Type to better control spawns _isAir = _vehicle isKindOf "Air"; _isShip = _vehicle isKindOf "Ship"; if(_isShip || _isAir) then { if(_isShip) then { // Spawn anywhere on coast on water waitUntil{!isNil "BIS_fnc_findSafePos"}; _position = [MarkerPosition,0,DynamicVehicleArea,10,1,2000,1] call BIS_fnc_findSafePos; //diag_log("DEBUG: spawning boat near coast " + str(_position)); } else { // Spawn air anywhere that is flat waitUntil{!isNil "BIS_fnc_findSafePos"}; _position = [MarkerPosition,0,DynamicVehicleArea,10,0,2000,0] call BIS_fnc_findSafePos; //diag_log("DEBUG: spawning air anywhere flat " + str(_position)); }; /////////////////////////////////////////////////////// dayz_objectUID3 = { private["_position","_dir","_key"]; _dir = _this select 0; _key = ""; _position = _this select 1; { _x = _x * 10; if ( _x < 0 ) then { _x = _x * -10 }; _key = _key + str(round(_x)); } count _position; _key = _key + str(round(_dir + time)); _key }; Добавлено (27.12.2014, 16:03) Добавлено (27.12.2014, 16:06) Добавлено (27.12.2014, 16:28) Добавлено (27.12.2014, 16:29) Добавлено (27.12.2014, 16:50)
09392281
|
| |||
| |||
Чат сайта |