Das Script ist jediglich eine Übersetzung von
John "Paratus" VanderZwet
Autor: John "Paratus" VanderZwet
Quelle: altisliferpg.com
Dann fangen wir mal an
Erstellt euch wenn noch nicht vorhanden einen script Ordner
1. Und erstellt die Datei sitdown.sqf mit folgendem Inhalt
Code
#include "..\..\script_macros.hpp"
/*
File: sitdown.sqf
Author: John "Paratus" VanderZwet
Description:
Sit in a chair!
*/
private ["_chair","_unit","_dir","_z"];
_chair = _this select 0;
_unit = _this select 1;
if (!isNull life_sitting) exitWith { hint "Sen zaten oturuyorsun!" };
if (vehicle _unit != _unit) exitWith { hint "Sen zaten buraya oturuyorsun!!" };
if (_unit distance _chair > 4) exitWith { hint "Umarim ayaklariniz bu kadar uzun degildir?" };
if (_unit getVariable ["restrained",false]) exitWith {};
if (_unit getVariable ["isTazed",false]) exitWith {};
if (!isNull (_chair getVariable ["sitting", objNull])) exitWith { hint "Birinin ustune oturmayi mi dusunuyorsunuz?!"; };
_dir = switch (typeOf _chair) do
{
case "Land_ChairPlastic_F": { 270 };
case "Land_CampingChair_V1_F": { 180 };
case "Land_CampingChair_V2_F": { 180 };
case "Land_ChairWood_F": { 180 };
case "Land_OfficeChair_01_F": { 180 };
case "Land_Bench_F": { 90 };
default { 180 };
};
_z = switch (typeOf _chair) do
{
default { 0 };
};
_posATL = getPosATL _chair;
_obj = "Land_ClutterCutter_small_F" createVehicle (_posATL);
_obj setPosATL (_posATL);
_obj setDir ((direction _chair) - _dir);
_obj setVariable ["idleTime", time, true];
_unit attachTo [_obj,[0,0,_z]];
life_sitting = _obj;
_chair setVariable ["sitting", _unit, true];
[_unit,"Crew","switch",true] remoteExecCall ["life_fnc_animSync",RCLIENT];
_action = _unit addAction ["<t color='#B45F04'>Otur</t>","TulparHAN\scripts\standup.sqf"];
waitUntil { isNull life_sitting || !(alive _unit) || player distance (getPos _chair) > 2 };
_unit removeAction _action;
life_sitting = objNull;
_chair setVariable ["sitting", nil, true];
if (isNull attachedTo _unit) then
{
if (attachedTo _unit == _obj) then { detach _unit; deleteVehicle _obj; };
};
Alles anzeigen
2. Nächste Datei und zwar die standup.sqf
Code
#include "..\..\script_macros.hpp"
/*
File: standup.sqf
Author: John "Paratus" VanderZwet
Description:
Stand up from chair
*/
detach player;
[player,"","switch",true] remoteExecCall ["life_fnc_animSync",RCLIENT];
if (!isNull life_sitting) then { deleteVehicle life_sitting; };
life_sitting = objNull;
_pos = getPosASL player;
_dir = getDir player;
player setPosASL [(_pos select 0) + (0.5 * sin(_dir)), (_pos select 1) + (0.5 * cos(_dir)), _pos select 2];
Alles anzeigen
3. Geht in eure Init im Hauptverzeichnis eurer Mission und füge das hinzu
Code
MAC_fnc_switchMove = {
private["_object","_anim"];
_object = _this select 0;
_anim = _this select 1;
_object switchMove _anim;
};
4. Geht in eure core/functions/fn_keyhandler.sqf und fügt das hinzu
Code
//Sitdown Script
if (_code in (actionKeys "MoveForward")) then
{
if (!isNull life_sitting) then
{
[] execVM "mission.map\script\standup.sqf";
_handled = true;
};
};
5. Zum Schluss geht in eure core/fn_setupactions.sqf und fügt das dort ein
Code
//oturma
life_actions pushBack (player addAction["<t color='#0099FF'>Otur</t>",{[cursorObject,player] execVM "mission.map\script\sitdown.sqf"},true,1,true,true,"""",'player distance cursorObject < 3 && {([str cursorObject,"bench"] call KRON_StrInStr || [str cursorObject,"chair"] call KRON_StrInStr)} ']);
Das war mein erstes Tutorial vielleicht sucht ihr ja danach