You are not logged in.

  • Login
Bitte besucht unser neues Forum unter https://forum.nitrado.net | Please visit our new Forum at https://forum.nitrado.net

Dear visitor, welcome to Nitrado.net Prepaid Gameserver Community-Support - Archiv. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

xinvisiblekiller

User / Kunde

  • "xinvisiblekiller" started this thread

Posts: 15

  • Send private message

1

Tuesday, June 23rd 2015, 1:34pm

Ai Vehicle Patrouillen Spawn/Despawn

Guten Tag,

Ich hätte da ein anliegen das mich schon eine weile auf zack hält.

Und zwar geht es darum Ai Fahrzeuge Spawnen zu lassen...

Ich versuche die Ai Fahrzeuge Patrouillen mit diesen Script Spawnen zu lassen:

Script:

Spoiler Spoiler

_pos = _this select 0;

//Creates a group for Vehicles
_aiGroup = createGroup RESISTANCE;
_ai = ObjNull;

//Finds a safe positon in area to spawn
_safepos = [_pos,0,27,0,0,20,0] call BIS_fnc_findSafePos;

//Spawns 1 AI Unit
"O_G_Soldier_SL_F" createUnit [_safepos, _aiGroup, "_ai = this", 0.1, "PRIVATE"];
removeBackpackGlobal _ai;
removeAllItemsWithMagazines _ai;
_ai setVariable["LASTLOGOUT_EPOCH",1000000000000];
_ai setVariable["LAST_CHECK",1000000000000];
_ai enableAI "TARGET";
_ai enableAI "AUTOTARGET";
_ai enableAI "MOVE";
_ai enableAI "ANIM";
_ai enableAI "FSM";
_ai allowDammage true;
_ai setCombatMode "RED";
_ai setBehaviour "COMBAT";
_ai setVariable ["AI",true,true];


//Spawns 1 AI Unit
_ai1 = ObjNull;
_safepos = [_pos,0,27,0,0,20,0] call BIS_fnc_findSafePos;
"O_G_Soldier_SL_F" createUnit [_safepos, _aiGroup, "_ai1 = this", 0.1, "PRIVATE"];
removeBackpackGlobal _ai1;
removeAllItemsWithMagazines _ai1;
_ai1 setVariable["LASTLOGOUT_EPOCH",1000000000000];
_ai1 setVariable["LAST_CHECK",1000000000000];
_ai1 enableAI "TARGET";
_ai1 enableAI "AUTOTARGET";
_ai1 enableAI "MOVE";
_ai1 enableAI "ANIM";
_ai1 enableAI "FSM";
_ai1 allowDammage true;
_ai1 setCombatMode "RED";
_ai1 setBehaviour "COMBAT";
_ai1 setVariable ["AI",true,true];


//Spawns 1 AI Unit
_ai2 = ObjNull;
_safepos = [_pos,0,27,0,0,20,0] call BIS_fnc_findSafePos;
"O_G_Soldier_SL_F" createUnit [_safepos, _aiGroup, "_ai2 = this", 0.1, "PRIVATE"];
removeBackpackGlobal _ai2;
removeAllItemsWithMagazines _ai2;
_ai2 setVariable["LASTLOGOUT_EPOCH",1000000000000];
_ai2 setVariable["LAST_CHECK",1000000000000];
_ai2 enableAI "TARGET";
_ai2 enableAI "AUTOTARGET";
_ai2 enableAI "MOVE";
_ai2 enableAI "ANIM";
_ai2 enableAI "FSM";
_ai2 allowDammage true;
_ai2 setCombatMode "RED";
_ai2 setBehaviour "COMBAT";
_ai2 setVariable ["AI",true,true];


//Spawns 1 AI Unit
_ai3 = ObjNull;
_safepos = [_pos,0,27,0,0,20,0] call BIS_fnc_findSafePos;
"O_G_Soldier_SL_F" createUnit [_safepos, _aiGroup, "_ai3 = this", 0.1, "PRIVATE"];
removeBackpackGlobal _ai3;
removeAllItemsWithMagazines _ai3;
_ai3 setVariable["LASTLOGOUT_EPOCH",1000000000000];
_ai3 setVariable["LAST_CHECK",1000000000000];
_ai3 enableAI "TARGET";
_ai3 enableAI "AUTOTARGET";
_ai3 enableAI "MOVE";
_ai3 enableAI "ANIM";
_ai3 enableAI "FSM";
_ai3 allowDammage true;
_ai3 setCombatMode "RED";
_ai3 setBehaviour "COMBAT";
_ai3 setVariable ["AI",true,true];

//Spawns 1 AI Unit
_ai4 = ObjNull;
_safepos = [_pos,0,27,0,0,20,0] call BIS_fnc_findSafePos;
"O_G_Soldier_SL_F" createUnit [_safepos, _aiGroup, "_ai4 = this", 0.1, "PRIVATE"];
removeBackpackGlobal _ai4;
removeAllItemsWithMagazines _ai4;
_ai4 setVariable["LASTLOGOUT_EPOCH",1000000000000];
_ai4 setVariable["LAST_CHECK",1000000000000];
_ai4 enableAI "TARGET";
_ai4 enableAI "AUTOTARGET";
_ai4 enableAI "MOVE";
_ai4 enableAI "ANIM";
_ai4 enableAI "FSM";
_ai4 allowDammage true;
_ai4 setCombatMode "RED";
_ai4 setBehaviour "COMBAT";
_ai4 setVariable ["AI",true,true];


//Spawns 1 AI Unit
_ai5 = ObjNull;
_safepos = [_pos,0,27,0,0,20,0] call BIS_fnc_findSafePos;
"O_G_Soldier_SL_F" createUnit [_safepos, _aiGroup, "_ai5 = this", 0.1, "PRIVATE"];
removeBackpackGlobal _ai5;
removeAllItemsWithMagazines _ai5;
_ai5 setVariable["LASTLOGOUT_EPOCH",1000000000000];
_ai5 setVariable["LAST_CHECK",1000000000000];
_ai5 enableAI "TARGET";
_ai5 enableAI "AUTOTARGET";
_ai5 enableAI "MOVE";
_ai5 enableAI "ANIM";
_ai5 enableAI "FSM";
_ai5 allowDammage true;
_ai5 setCombatMode "RED";
_ai5 setBehaviour "COMBAT";
_ai5 setVariable ["AI",true,true];


//Spawns a AI Vehicle
_safepos = [_pos,0,27,0,0,20,0] call BIS_fnc_findSafePos;
_veh = ObjNull;
_veh = createVehicle["B_G_Offroad_01_armed_F", _safepos, [], 0, "NONE"];
_veh setVariable["LASTLOGOUT_EPOCH",1000000000000];
_veh setVariable["LAST_CHECK",1000000000000];
//Moves 2 AI units into vehicle
_ai moveInAny _veh;
_ai1 moveInAny _veh;
//So Vehicle doesnt despawn
EPOCH_VehicleSlotsLimit = EPOCH_VehicleSlotsLimit + 1;
EPOCH_VehicleSlots pushBack str(EPOCH_VehicleSlotsLimit);
_slot = EPOCH_VehicleSlots select 0;
_veh setVariable ['VEHICLE_SLOT',_slot,true];
EPOCH_VehicleSlots = EPOCH_VehicleSlots - [_slot];
EPOCH_VehicleSlotCount = count EPOCH_VehicleSlots;
publicVariable 'EPOCH_VehicleSlotCount';
_veh call EPOCH_server_setVToken;
//Creates vehicle inventory
clearWeaponCargoGlobal _veh;
clearMagazineCargoGlobal _veh;
clearBackpackCargoGlobal _veh;
clearItemCargoGlobal _veh;


_safepos = [_pos,0,27,0,0,20,0] call BIS_fnc_findSafePos;
_veh = ObjNull;
_veh = createVehicle["B_G_Offroad_01_armed_F", _safepos, [], 0, "NONE"];
_veh setVariable["LASTLOGOUT_EPOCH",1000000000000];
_veh setVariable["LAST_CHECK",1000000000000];
_ai2 moveInAny _veh;
_ai3 moveInAny _veh;
EPOCH_VehicleSlotsLimit = EPOCH_VehicleSlotsLimit + 1;
EPOCH_VehicleSlots pushBack str(EPOCH_VehicleSlotsLimit);
_slot = EPOCH_VehicleSlots select 0;
_veh setVariable ['VEHICLE_SLOT',_slot,true];
EPOCH_VehicleSlots = EPOCH_VehicleSlots - [_slot];
EPOCH_VehicleSlotCount = count EPOCH_VehicleSlots;
publicVariable 'EPOCH_VehicleSlotCount';
_veh call EPOCH_server_setVToken;
clearWeaponCargoGlobal _veh;
clearMagazineCargoGlobal _veh;
clearBackpackCargoGlobal _veh;
clearItemCargoGlobal _veh;

_safepos = [_pos,0,27,0,0,20,0] call BIS_fnc_findSafePos;
_veh = ObjNull;
_veh = createVehicle["B_G_Offroad_01_armed_F", _safepos, [], 0, "NONE"];
_veh setVariable["LASTLOGOUT_EPOCH",1000000000000];
_veh setVariable["LAST_CHECK",1000000000000];
_ai4 moveInAny _veh;
_ai5 moveInAny _veh;
EPOCH_VehicleSlotsLimit = EPOCH_VehicleSlotsLimit + 1;
EPOCH_VehicleSlots pushBack str(EPOCH_VehicleSlotsLimit);
_slot = EPOCH_VehicleSlots select 0;
_veh setVariable ['VEHICLE_SLOT',_slot,true];
EPOCH_VehicleSlots = EPOCH_VehicleSlots - [_slot];
EPOCH_VehicleSlotCount = count EPOCH_VehicleSlots;
publicVariable 'EPOCH_VehicleSlotCount';
_veh call EPOCH_server_setVToken;
clearWeaponCargoGlobal _veh;
clearMagazineCargoGlobal _veh;
clearBackpackCargoGlobal _veh;
clearItemCargoGlobal _veh;


Jedoch despawnen sie nach kurzer zeit (4-10 Sek) weiß jemand woran das liegt ?

Mir ist auch aufgefallen das man normale Fahrzeuge auch nicht spawnen kann...

Script:

Spoiler Spoiler

_spawn = "C_Offroad_01_F";
_posplr = [((getPos player) select 0) - 3, ((getPos player) select 1) + 3, 0];
_dirplr = getDir player;
_spwnveh = _spawn createVehicle (_posplr);


Ich nutze die Map Altis .

Würde mich über antworten freuen. :)

Mfg. Nils

sp4rky

Moderator

  • "sp4rky" is male

Posts: 2,096

Location: EditorCity

Occupation: Support: Epoch, Nitrado, InfiStar

Thanks: 111

  • Send private message

2

Tuesday, June 23rd 2015, 5:36pm

benutze

Source code

1
setVariable ["LAST_CHECK", (diag_tickTime + 14400)];
dann passt es :)
> GITHUB <

:gamer:

Kein Support per PN!

xinvisiblekiller

User / Kunde

  • "xinvisiblekiller" started this thread

Posts: 15

  • Send private message

3

Tuesday, June 23rd 2015, 5:54pm

Danke, sp4rky

Da ich gerade keine Zeit habe werde ich es später mal testen..

Bitte besucht unser neues Forum unter https://forum.nitrado.net| Please visit our new Forum at https://forum.nitrado.net