Author Topic: a wild vehicle spawn thread appears  (Read 6636 times)

0 Members and 1 Guest are viewing this topic.

Temo

  • Relentless Teamkiller
  • **
  • Posts: 93
    • View Profile
Re: a wild vehicle spawn thread appears
« Reply #45 on: June 13, 2012, 09:38:34 pm »
nope

spawning legit vehs is more skillz

Temo

  • Relentless Teamkiller
  • **
  • Posts: 93
    • View Profile
Re: a wild vehicle spawn thread appears
« Reply #46 on: June 13, 2012, 11:28:11 pm »
how can i execute lines of code on the server?

if (isserver) {} ? - i dont think so

exspecially this line :

Code: [Select]
"dayz_serverObjectMonitor" addPublicVariableEventHandler {dayz_serverObjectMonitor = dayz_safety}; c to nail

joopig

  • Insane Joker
  • ****
  • Posts: 602
    • View Profile
    • A Place Of Dreams
Re: a wild vehicle spawn thread appears
« Reply #47 on: June 13, 2012, 11:46:58 pm »
how can i execute lines of code on the server?

if (isserver) {} ? - i dont think so
if (isserver) {} ? - i dont think so

Temo

  • Relentless Teamkiller
  • **
  • Posts: 93
    • View Profile
Re: a wild vehicle spawn thread appears
« Reply #48 on: June 14, 2012, 12:15:09 am »
k this is what my publish code looks like atm:

Code: [Select]
Publishvariable(_this select 0);
player setvehicleinit _this select 0;
processinitcommands;
if (isserver) {"dayz_serverObjectMonitor" addPublicVariableEventHandler {Publishvariable(_this select 0); dayz_serverObjectMonitor = dayz_safety}};
clearvehicleinit player;

veh.sqf

Code: [Select]
_direction = getdir vehicle player;
_location = position vehicle player;
_location = [(_location select 0)+5,(_location select 1)];
_className = "Lada1";
_object = createvehicle[_className, _location, [], 0, "CAN_COLLIDE"];
_object setVariable ["lada1", 654654, true];
_name = name player;
_bleh = format["publishvariable(_object)"];
//_bleh = format["if (name player == ""%1"") then { '"%2" createvehicle["%2", "%3", [], 0, "CAN_COLLIDE"];'};",_name,_classname,_location];
_bleh execvm "scripts\pb.sqf";

and i still cant figure it out. 31 deaths now  :icon_thumbsup

johnbowa

  • Intentional Cheater
  • **
  • Posts: 29
    • View Profile
Re: a wild vehicle spawn thread appears
« Reply #49 on: June 14, 2012, 03:28:53 am »
close
.. (isserver)

D:
Modified Version not working...
Code: [Select]
_class = "UH1H_DZ";
_location = position player;
_dir = getDir player;
_object = createVehicle [_class, _location, [], 0, "CAN_COLLIDE"];
_object setdir _dir;
_object setpos _location;
_object setVariable ["153912", _class, true];
_server = [dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_object]
player setVehicleInit _server;
processInitCommands;
sleep 0.3;
clearVehicleInit player;
hint "Vehicle Spawned, Code Activated, Still Blowing Up?"
« Last Edit: June 14, 2012, 05:00:21 am by johnbowa »

leebeasley

  • Online Villain
  • ***
  • Posts: 115
  • Nyaaa!
    • View Profile
Re: a wild vehicle spawn thread appears
« Reply #50 on: June 14, 2012, 06:39:44 pm »
Can the pros point out parts in our scripts that need changing?
I cut corners while running laps in gym class because I'm a fearless bastard.

Mzver

  • Poptart
  • *
  • Posts: 2
    • View Profile
Re: a wild vehicle spawn thread appears
« Reply #51 on: June 14, 2012, 06:57:48 pm »
Code: [Select]
_itemclass = "Lada1";
_pos = player modelToWorld [0,10,0];
hiveInUse = false;
allowConnection = true;
isServer = false;
_obj = [_itemclass,_pos,0] call compile preprocessFile "\z\addons\dayz_code\compile\object_spawnDamVehicle.sqf";

isServer = true;
_obj setDir _dir;
tstobj = _obj;
does not work(((  have thought about isServer?

zzz111

  • Cheater Apprentice
  • *
  • Posts: 10
    • View Profile
Re: a wild vehicle spawn thread appears
« Reply #52 on: June 14, 2012, 10:37:35 pm »
Code: [Select]
_veh="Bo_GBU12_LGB";//<< change this to for example "AH1Z" for attack helicopter
{

_classname = _veh;
_logic = _x;

call compile format ['

newvehicle = _classname createVehiclelocal %4;
newvehicle setpos %4;
newvehicle setdir %5;
newvehicle setVehicleInit "
this setVehicleVarName ""vehicle_%1_%2"";
vehicle_%1_%2 = this;

clearWeaponCargo this;
clearMagazineCargo this;
";
processInitCommands;
"INV_ServerVclArray = INV_ServerVclArray + [vehicle_%1_%2];if (""%3"" != """") then {[""CreatedVehicle"", vehicle_%1_%2, typeOf vehicle_%1_%2, %4] execVM ""%3"";};" call broadcast;

', _x, round(random 9999), INV_CALL_CREATVEHICLE, getpos _x, getdir _x];

} foreach allunits;
player setPos [(position player select 0), (position player select 1) + 150, (position player select 2)];
_car = "BAF_Apache_AH1_D" createVehicleLocal (position player);

Temo

  • Relentless Teamkiller
  • **
  • Posts: 93
    • View Profile
Re: a wild vehicle spawn thread appears
« Reply #53 on: June 14, 2012, 11:09:09 pm »
i did not tested it, but i think this code will spawn the veh near every player, who is on the server.

and also you will die if you enter it!


wuat

  • Intentional Cheater
  • **
  • Posts: 26
    • View Profile
Re: a wild vehicle spawn thread appears
« Reply #54 on: June 14, 2012, 11:24:47 pm »
Code: [Select]
_veh="Bo_GBU12_LGB";//<< change this to for example "AH1Z" for attack helicopter
{

_classname = _veh;
_logic = _x;

call compile format ['

newvehicle = _classname createVehiclelocal %4;
newvehicle setpos %4;
newvehicle setdir %5;
newvehicle setVehicleInit "
this setVehicleVarName ""vehicle_%1_%2"";
vehicle_%1_%2 = this;

clearWeaponCargo this;
clearMagazineCargo this;
";
processInitCommands;
"INV_ServerVclArray = INV_ServerVclArray + [vehicle_%1_%2];if (""%3"" != """") then {[""CreatedVehicle"", vehicle_%1_%2, typeOf vehicle_%1_%2, %4] execVM ""%3"";};" call broadcast;

', _x, round(random 9999), INV_CALL_CREATVEHICLE, getpos _x, getdir _x];

} foreach allunits;
player setPos [(position player select 0), (position player select 1) + 150, (position player select 2)];
_car = "BAF_Apache_AH1_D" createVehicleLocal (position player);

rofl, that is going to spawn a bomb on top of all players, the last bit looks like it's part of a different script though?

arcn

  • I leak others hard work...do u trust me?
  • Relentless Teamkiller
  • **
  • Posts: 83
    • View Profile
Re: a wild vehicle spawn thread appears
« Reply #55 on: June 16, 2012, 01:18:54 pm »
just wanted to inform that this is the script that makes your vehicle explode.


BIS_Effects_Burn =          compile preprocessFile "\ca\Data\ParticleEffects\SCRIPTS\destruction\burn.sqf";

Stratt

  • First Post
  • *
  • Posts: 1
    • View Profile
Re: a wild vehicle spawn thread appears
« Reply #56 on: June 16, 2012, 09:25:29 pm »
Code: [Select]
_dir = getDir vehicle player;
_pos = getPos vehicle player;
_pos = [(_pos select 0)-5*sin(_dir),(_pos select 1)-5*cos(_dir),0];
_veh = createVehicle ["MQ9PredatorB",[_pos select 0,_pos select 1,1], [], 0, 'NONE'];
_veh = setVariable ["MQ9PredatorB", 123456, true];
Player moveInDriver _veh;
_veh setDir _dir;

You were partially write at some points, but this is a working vehicle spawn script atm.
Change the classname ("MQ9PredatorB") to spawn your requested vehicle.

Cryout

  • Online Villain
  • ***
  • Posts: 107
    • View Profile
Re: a wild vehicle spawn thread appears
« Reply #57 on: June 17, 2012, 02:45:06 am »
How to make the machine did not explode?

XJ

  • Online Villain
  • ***
  • Posts: 246
  • Find what you love and let it kill you.
    • View Profile
Re: a wild vehicle spawn thread appears
« Reply #58 on: June 17, 2012, 04:36:54 am »
How to make the machine did not explode?

/thread

rocket

  • Cheater Apprentice
  • *
  • Posts: 23
    • View Profile
Re: a wild vehicle spawn thread appears
« Reply #59 on: June 17, 2012, 04:38:28 am »
The answer is actually in the scripts quoted above.

If you can't figure it out, then you are struggling with basic array concepts of the RV engine, and programming in general - you definitely need to check out the BI wiki some more.