HX3 Foren

HX3 Foren (https://hx3.de/)
-   Editing & Scripting (https://hx3.de/editing-scripting-187/)
-   -   Random cache (https://hx3.de/editing-scripting-187/random-cache-25272/)

@Survival 11.03.2016 11:01

Random cache
 
Hallo Leute !!!

Suche ein Script für random ammocaches!! hab da schon einige gefunden sowie das RCP usw..

Nur das Problem dabei ist die caches spawnen alle im freien würde sie aber gerne in nem Haus haben.


PHP-Code:

if (isServerthen {
_box _this select 0;

//Get the position of the box
_pos getPosATL _box;

//Get an array of all the towns and select one at random
_townlist nearestLocations [getpos _box

[
"NameCityCapital","NameCity","NameVillage"],500];


//Get town from array
_rnd floor random (count _townlist);
_town _townlist select _rnd;
_town_name text (_town);


//Get town location
_locationPos locationPosition (_town);


//Move ammobox to town location
_box setPosASL [_locationPos select 0_locationPos select 10];


//Fix ammo box to ground level
_newpos getPosASL _box;

_box setPos [_newpos select 0_newpos select 10];
hint format ["%1",_box];
}; 

das hier hab ich auch probiert und schon umgeändert mit nearestobject(HAusnamen) usw.

entweder funktioniert es nicht in A3 oder ichmach iwas falsch.

burns 11.03.2016 13:36

Wenn du vom jeweiligen Haus die buildingPos ausliest, könnste die Kisten einfach darauf setzen. Wär nur blöd, wenn gleichzeitig ne KI zu demselben Punkt hingehen möchte..


Inspirationen für die Routine dahinter, könnte man sich im allseits bekannten housepatrol.sqf von Tophe of Östgöta Öps (thank youuu, Bohemiaaa) holen.

Drunken Officer 11.03.2016 14:26

edit: falsch gelesen, deswegen falscher code gepostet

@Survival 11.03.2016 14:28

Danke @Burns und @Drunken Officer


Werd mir das gleichmal ansehen.


Alle Zeitangaben in WEZ +1. Es ist jetzt 12:09 Uhr.

Angetrieben durch vBulletin, Entwicklung von Philipp Dörner & Tobias


SEO by vBSEO 3.2.0 ©2008, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119