Heute mach ich mal ein Tutuorial wie man in der Altis LIfe 5.0 eine zweite Sirene einfügt
1. Als erstes gehen wir in den Core\Cop Ordner, dort erstellen wir eine Datei namens fn_copSiren2.sqf in diese fügen wir folgendes ein:
#include "..\..\script_macros.hpp"
/*
File: fn_copSiren2.sqf
Author: Bryan "Tonic" Boardwine
Description:
Starts the second cop siren sound for other players.
*/
private ["_vehicle"];
_vehicle = param [0,objNull,[objNull]];
if (isNull _vehicle) exitWith {};
if (isNil {_vehicle getVariable "siren2"}) exitWith {};
for "_i" from 0 to 1 step 0 do {
if (!(_vehicle getVariable "siren2")) exitWith {};
if (count crew _vehicle isEqualTo 0) then {_vehicle setVariable ["siren2",false,true]};
if (!alive _vehicle) exitWith {};
if (isNull _vehicle) exitWith {};
_vehicle say3D ["StadtSignal",500,1]; //Hier einfach die eigene Sirene einfügen, max distance & pitch
sleep 2.995;//Und die eigene Länge des Sounds
if (!(_vehicle getVariable "siren2")) exitWith {};
};
Alles anzeigen
2. Dann gehen wir in die Functions.hpp und fügen folgendes zur Class Cop hinzu
class copSiren2 {};
Das ganze sollte dann in etwa so aussehen:
class Cop {
file = "core\cop";
class bountyReceive {};
class containerInvSearch {};
class copInteractionMenu {};
class copLights {};
class copLoadout {};
class copMarkers {};
class copSearch {};
class copSiren {};
class copSiren2 {};
class doorAnimate {};
class fedCamDisplay {};
class licenseCheck {};
class licensesRead {};
class questionDealer {};
class radar {};
class repairDoor {};
class restrain {};
class searchClient {};
class seizeClient {};
class sirenLights {};
class spikeStripEffect {};
class ticketGive {};
class ticketPaid {};
class ticketPay {};
class ticketPrompt {};
class vehInvSearch {};
class wantedGrab {};
class seizeWeapon {}; // Ohne das hier bei euch wenn ihr das script nicht habt
class sperrzonensystem {}; // genau so wie das
};
Alles anzeigen
3. Gehen wir unter core\functions in die fn_keyHandler.sqf und fügen folgendes ein:
Ich habe bei mir das ganze unter den B key hinzugefügt... also wurde aus
//Surrender (Shift + B)
case 48: {
if (_shift) then {
if (player getVariable ["playerSurrender",false]) then {
player setVariable ["playerSurrender",false,true];
} else {
[] spawn life_fnc_surrender;
};
_handled = true;
};
};
Alles anzeigen
das hier:
//Surrender (Shift + B)
case 48: {
if (_shift) then {
if (player getVariable ["playerSurrender",false]) then {
player setVariable ["playerSurrender",false,true];
} else {
[] spawn life_fnc_surrender;
};
_handled = true;
} else {
if (playerSide in [west,independent] && {vehicle player != player} && {!life_siren2_active} && {((driver vehicle player) == player)}) then {
[] spawn {
life_siren2_active = true;
sleep 4.5;
life_siren2_active = false;
};
_veh = vehicle player;
if (isNil {_veh getVariable "siren2"}) then {_veh setVariable ["siren2",false,true];};
if ((_veh getVariable "siren2")) then {
titleText [localize "STR_MISC_SirensOFF","PLAIN"];
_veh setVariable ["siren2",false,true];
if !(isNil {(_veh getVariable "sirenJIP")}) then {
private _jip = _veh getVariable "sirenJIP";
_veh setVariable ["sirenJIP",nil,true];
remoteExec ["",_jip]; //remove from JIP queue
};
} else {
titleText [localize "STR_MISC_SirensON","PLAIN"];
_veh setVariable ["siren2",true,true];
private "_jip";
if (playerSide isEqualTo west) then {
_jip = [_veh] remoteExec ["life_fnc_copSiren2",RCLIENT,true];
};
_veh setVariable ["sirenJIP",_jip,true];
};
};
};
};
Alles anzeigen
4. Müssen wir natürlich auch die JIP(life_fnc_copSiren2,CLIENT) in die CfgRemoteExec.hpp einfügen unter /* Client only functions */
das ganze sollte dann so aussehen:
/* Client only functions */
F(life_fnc_AAN,CLIENT)
F(life_fnc_addVehicle2Chain,CLIENT)
F(life_fnc_adminID,CLIENT)
F(life_fnc_adminInfo,CLIENT)
F(life_fnc_bountyReceive,CLIENT)
JIP(life_fnc_copLights,CLIENT)
F(life_fnc_copSearch,CLIENT)
JIP(life_fnc_copSiren,CLIENT)
JIP(life_fnc_copSiren2,CLIENT) // cop sirene 2
F(life_fnc_freezePlayer,CLIENT)
F(life_fnc_garageRefund,CLIENT)
F(life_fnc_giveDiff,CLIENT)
F(life_fnc_hideObj,CLIENT)
Alles anzeigen
5. Was ich fast vergessan hatte war das wenn ihr eigene Sound einfügen wollte diese natürlich in der description.ext einfügen müsst, also so:
class LandSignal {
name = "LandSignal";
sound[] = {"\sounds\LandSignal.ogg", 1.0, 1};
titles[] = {};
};
MfG Larry - Cloud7even.cc Team