Author Topic: General help for newbie  (Read 3394 times)

0 Members and 1 Guest are viewing this topic.

failulator

  • Cheater Apprentice
  • *
  • Posts: 11
    • View Profile
Re: General help for newbie
« Reply #45 on: June 06, 2012, 06:13:10 am »
Still struggling a bit with getting spawned vehicles to register on the server and not kill user on entry. Its my understanding that commands stored in setVehicleInit are executed over the network rather than locally when processInitCommands is called, so I tried spawning a vehicle using that with the following code with the hope that since its sent over the network and not locally the server will recognize the vehicle as being valid:

Code: [Select]
playa = name (vehicle player);
publicVariable "playa";
init="if (name (vehicle player) == playa) then {_obj = createVehicle['M1030', getPos player, [], 0, 'CAN_COLLIDE']; _obj setVariable ['ObjectID', 654132, true];};";
publicVariable "init";
player setVehicleInit init;sleep 0.1;hintsilent "";processInitCommands;sleep 0.1;hintsilent "";clearVehicleInit player;

I'm able to spawn a vehicle this way, but I still die on entry.  Is this because this code is somehow executing only locally still even though setvehicleinit commands are sent over the network? or is there some variable somewhere i'm forgetting to set that the server is checking for?   Is this not a proper method for executing code remotely?  :icon_confused2

O_GREEN_O

  • Cheater Apprentice
  • *
  • Posts: 10
    • View Profile
Re: General help for newbie
« Reply #46 on: June 06, 2012, 12:10:54 pm »
I have a script marking vehicles mark on the map, but to enter it manually sooooo long time, tell me the solution
Quote
_obj="VEHICLESNAME";
_objects = allMissionObjects _obj;
_lbl = "";
_count = 1;
{
   _marker = Format["%1Markers%2",_count,_obj];
   createMarkerLocal [_marker,position _x];
   _marker setMarkerTypeLocal "dot";
   _marker setMarkerColorLocal "ColorBlue";
   _marker setMarkerSizeLocal [1,1];
   _lbl = Format["%1 [%2]",_obj,_count];
   _marker setMarkerTextLocal _lbl;
   _count = _count + 1;
} forEach _objects;

Quote
"ATV_CZ_EP1",
"Lada1_TK_CIV_EP1",
"Ikarus",
"Lada1",
"BAF_Offroad_W",
"Old_moto_TK_Civ_EP1",
"SkodaRed",
"TT650_Civ",
"UAZ_CDF",
"LandRover_TK_CIV_EP1",
"UAZ_Unarmed_TK_CIV_EP1",
"Volha_2_TK_CIV_EP1",
"hilux1_civil_3_open_EP1",
"UH1H_DZ",
"Fishing_Boat",
"Smallboat_1",
"PBX"

XJ

  • Online Villain
  • ***
  • Posts: 246
  • Find what you love and let it kill you.
    • View Profile
Re: General help for newbie
« Reply #47 on: June 06, 2012, 01:24:27 pm »
I have a script marking vehicles mark on the map, but to enter it manually sooooo long time, tell me the solution

[..]

It is "please". "Please tell me how to solve the problem.", not "Tell me the solution, you owe me!".  :icon_rolleyes2

Code: [Select]
_obj="VEHICLESNAME";
_objects = allMissionObjects _obj;
//This is inefficient BS.

The solution is something you could easily think of yourself. Instead of manually running the script for each object, run it for an array that includes all of them.

Code: [Select]
_obj = ["classname1","classname2","classname3", .... ];
_objects = allMissionObjects _obj;

Energizer

  • Online Villain
  • ***
  • Posts: 121
    • View Profile
Re: General help for newbie
« Reply #48 on: June 06, 2012, 01:40:31 pm »
I have try spawn car with the script (in a server without battleeye)

but when i entered into the car i automatly die..

someone tell me why?

O_GREEN_O

  • Cheater Apprentice
  • *
  • Posts: 10
    • View Profile
Re: General help for newbie
« Reply #49 on: June 06, 2012, 02:12:30 pm »
Quote
_obj = ["Ikarus","Lada1","Lada1_TK_CIV_EP1","BAF_Offroad_W","Old_moto_TK_Civ_EP1","SkodaRed","TT650_Civ","UAZ_CDF","LandRover_TK_CIV_EP1","UAZ_Unarmed_TK_CIV_EP1","Volha_2_TK_CIV_EP1","hilux1_civil_3_open_EP1","UH1H_DZ","Fishing_Boat","Smallboat_1","PBX","ATV_CZ_EP1";]
= _objects allMissionObjects _obj;
_lbl = "";
_count = 1;
{
   _marker = Format["%1Markers%2",_count,_obj];
   createMarkerLocal [_marker,position _x];
   _marker setMarkerTypeLocal "dot";
   _marker setMarkerColorLocal "ColorBlue";
   _marker setMarkerSizeLocal [1,1];
   _lbl = Format["%1 [%2]",_obj,_count];
   _marker setMarkerTextLocal _lbl;
   _count = _count + 1;
} forEach _objects;

Not work
« Last Edit: June 06, 2012, 02:23:54 pm by O_GREEN_O »

cairney

  • Relentless Teamkiller
  • **
  • Posts: 58
  • There's no certainty ? only opportunity.
    • View Profile
Re: General help for newbie
« Reply #50 on: June 06, 2012, 02:33:37 pm »
I have a script marking vehicles mark on the map, but to enter it manually sooooo long time, tell me the solution

[..]

It is "please". "Please tell me how to solve the problem.", not "Tell me the solution, you owe me!".  :icon_rolleyes2

Code: [Select]
_obj="VEHICLESNAME";
_objects = allMissionObjects _obj;
//This is inefficient BS.

The solution is something you could easily think of yourself. Instead of manually running the script for each object, run it for an array that includes all of them.

Code: [Select]
_obj = ["classname1","classname2","classname3", .... ];
_objects = allMissionObjects _obj;

Thanks, helps me understand more.

XJ

  • Online Villain
  • ***
  • Posts: 246
  • Find what you love and let it kill you.
    • View Profile
Re: General help for newbie
« Reply #51 on: June 06, 2012, 02:48:33 pm »
Quote
_obj = ["Ikarus","Lada1","Lada1_TK_CIV_EP1","BAF_Offroad_W","Old_moto_TK_Civ_EP1","SkodaRed","TT650_Civ","UAZ_CDF","LandRover_TK_CIV_EP1","UAZ_Unarmed_TK_CIV_EP1","Volha_2_TK_CIV_EP1","hilux1_civil_3_open_EP1","UH1H_DZ","Fishing_Boat","Smallboat_1","PBX","ATV_CZ_EP1";]
= _objects allMissionObjects _obj;
_lbl = "";
_count = 1;
{
   _marker = Format["%1Markers%2",_count,_obj];
   createMarkerLocal [_marker,position _x];
   _marker setMarkerTypeLocal "dot";
   _marker setMarkerColorLocal "ColorBlue";
   _marker setMarkerSizeLocal [1,1];
   _lbl = Format["%1 [%2]",_obj,_count];
   _marker setMarkerTextLocal _lbl;
   _count = _count + 1;
} forEach _objects;

Not work

Not syntax.

daleeb

  • Intentional Cheater
  • **
  • Posts: 45
    • View Profile
Re: General help for newbie
« Reply #52 on: June 07, 2012, 11:49:19 am »
Still struggling a bit with getting spawned vehicles to register on the server and not kill user on entry. Its my understanding that commands stored in setVehicleInit are executed over the network rather than locally when processInitCommands is called, so I tried spawning a vehicle using that with the following code with the hope that since its sent over the network and not locally the server will recognize the vehicle as being valid:

Code: [Select]
playa = name (vehicle player);
publicVariable "playa";
init="if (name (vehicle player) == playa) then {_obj = createVehicle['M1030', getPos player, [], 0, 'CAN_COLLIDE']; _obj setVariable ['ObjectID', 654132, true];};";
publicVariable "init";
player setVehicleInit init;sleep 0.1;hintsilent "";processInitCommands;sleep 0.1;hintsilent "";clearVehicleInit player;

I'm able to spawn a vehicle this way, but I still die on entry.  Is this because this code is somehow executing only locally still even though setvehicleinit commands are sent over the network? or is there some variable somewhere i'm forgetting to set that the server is checking for?   Is this not a proper method for executing code remotely?  :icon_confused2

I use this to fix it (I know its not the proper way but it works).
Look at the vehicle then run this script and you can drive the vehicle safely.
Code: [Select]
_veh = cursorTarget;
hint format ["%1", _veh];
_veh setVariable ["ObjectID", 1337, true];

dayzSetFuel = [_veh,1];
dayzSetFuel spawn local_sefFuel;

_veh setDamage 0;

failulator

  • Cheater Apprentice
  • *
  • Posts: 11
    • View Profile
Re: General help for newbie
« Reply #53 on: June 07, 2012, 12:22:35 pm »
Still struggling a bit with getting spawned vehicles to register on the server and not kill user on entry. Its my understanding that commands stored in setVehicleInit are executed over the network rather than locally when processInitCommands is called, so I tried spawning a vehicle using that with the following code with the hope that since its sent over the network and not locally the server will recognize the vehicle as being valid:

Code: [Select]
playa = name (vehicle player);
publicVariable "playa";
init="if (name (vehicle player) == playa) then {_obj = createVehicle['M1030', getPos player, [], 0, 'CAN_COLLIDE']; _obj setVariable ['ObjectID', 654132, true];};";
publicVariable "init";
player setVehicleInit init;sleep 0.1;hintsilent "";processInitCommands;sleep 0.1;hintsilent "";clearVehicleInit player;

I'm able to spawn a vehicle this way, but I still die on entry.  Is this because this code is somehow executing only locally still even though setvehicleinit commands are sent over the network? or is there some variable somewhere i'm forgetting to set that the server is checking for?   Is this not a proper method for executing code remotely?  :icon_confused2

I use this to fix it (I know its not the proper way but it works).
Look at the vehicle then run this script and you can drive the vehicle safely.
Code: [Select]
_veh = cursorTarget;
hint format ["%1", _veh];
_veh setVariable ["ObjectID", 1337, true];

dayzSetFuel = [_veh,1];
dayzSetFuel spawn local_sefFuel;

_veh setDamage 0;

Hmm, I tried spawning a vehicle just now with the code
Code: [Select]
_location = (position player);
_className = "Tractor";
_vehi = createVehicle [_className, _location, [], 0, "CAN_COLLIDE"];
_vehi setVariable ["ObjectID", 1557, true];
_vehi setdammage 0;
_vehi setfuel 1;
dayzSetFuel = [_vehi,1];
dayzSetFuel spawn "\z\addons\dayz_code\compile\local_setFuel.sqf";

Which is essentially the same thing your doing there, and it still exploded when I got in it.  Also, I glanced at local_setFuel's code...and all it does is call setFuel on the vehicle, which I have been doing already anyway, so I don't think this is the solution unless I'm doing something wrong.  Are you sure there isn't something else responsible in your code for making vehicles work? This doesn't seem like it would be it :S

MrMedic

  • MasstKer
  • ********
  • Posts: 8900
  • programmer/dev/software engineer
    • View Profile
Re: General help for newbie
« Reply #54 on: June 07, 2012, 05:46:45 pm »
Quote
_obj = ["Ikarus","Lada1","Lada1_TK_CIV_EP1","BAF_Offroad_W","Old_moto_TK_Civ_EP1","SkodaRed","TT650_Civ","UAZ_CDF","LandRover_TK_CIV_EP1","UAZ_Unarmed_TK_CIV_EP1","Volha_2_TK_CIV_EP1","hilux1_civil_3_open_EP1","UH1H_DZ","Fishing_Boat","Smallboat_1","PBX","ATV_CZ_EP1";]
= _objects allMissionObjects _obj;
_lbl = "";
_count = 1;
{
   _marker = Format["%1Markers%2",_count,_obj];
   createMarkerLocal [_marker,position _x];
   _marker setMarkerTypeLocal "dot";
   _marker setMarkerColorLocal "ColorBlue";
   _marker setMarkerSizeLocal [1,1];
   _lbl = Format["%1 [%2]",_obj,_count];
   _marker setMarkerTextLocal _lbl;
   _count = _count + 1;
} forEach _objects;

Not work

Tip :  nearestObjects
EnCoded Message: i3iy9yl8kr2xf3g2Txs3pr6ye3ya7jg5ty2z

https://www.youtube.com/watch?v=62_7-AYfdkQ
you need a paypal account for the private versions.

Website:
http://bit.ly/medic101

Teamspeak 3: 85.236.101.5:10157