Jump to content
Sign in to follow this  
1para{god-father}

Help on script after removal of processInitCommands

Recommended Posts

...so the big problem is?

executing scripts on all clients... explained in this thread several times.

hehe yea that`s the problem, how to implement the given eksamples into the script, given ive bin reading most tutorials about scripting im still confused and a newb that`s why i turn to you guy`s :) eks: this is taken from "Editor based AI spawn script by trigger" maybe out of context but its where the given error is and im just not clever enough to figure it out.

// Set all the things common to the spawned unit

_spawnUnit setDir _unitDir;

_spawnUnit setSkill _unitSkill;

_spawnUnit setUnitRank _unitRank;

if (_spawntype == "once" OR _spawntype == "repeated") then {

_spawnUnit setVehicleVarName _unitName;

if (vehiclevarname _spawnUnit != "") then { _spawnUnit setVehicleInit format["%1=this;",_unitName]; processInitCommands; };

};

} forEach _unitArray;

////////////the first part is the first error before spawned given its filled whit removed commands.////////////////

} forEach _waypointsArray;

// Setting the leaders init and the groups body removal time

(vehicle (leader _newGroup)) setVehicleInit _initString; processInitCommands;

// Run the cleanup function for this group

[_newGroup, _bodyRemove] spawn _fnc_cleanGroup;

// Have to return the new group

_newGroup;

};

this part after spawn. first well its the name to remember given in editor second is the init field. any idea to implement so what i write in initfiled in editor is rememberd by the script?.

Edited by baloo666

Share this post


Link to post
Share on other sites

OK This works great on Local but not on Dedi ?

Any way to get this to work on a Dedi ?

init.sqf

fnc_unitinit= {_this addaction ['Capture', 'scripts\xxxxxxx.sqf', [],1,false,true,'','((side _this) == west)'];};

where you exec your createunit

_grp = createGroup WEST;

_pilot = _grp createUnit ["B_Helipilot_F", _pos, [], 0, "FORM"];

[_pilot, "fnc_unitinit", true, true] spawn BIS_fnc_MP;

Share this post


Link to post
Share on other sites

It should work regardless of dedi or non dedi. Where do you execute your unit creation script? One other thing I might think of is to try

[_pilot, "fnc_unitinit", nil, true] spawn BIS_fnc_MP; instead of [_pilot, "fnc_unitinit", true, true] spawn BIS_fnc_MP;

Share this post


Link to post
Share on other sites

hi all,

please someone can help me with that broken part of a Script ?

	_bomb = _this;
				_soundsource = "Land_HelipadEmpty_F" createVehicle position _bomb;
				WaitUntil{(position _bomb select 2)<30};
				_soundsource setPos position _bomb;
[color="#FF0000"]_soundsource setVehicleInit format["this say'bon_Shell_In_v0%1'",1,2,3,4,5,6,7] select round random 6];
				processInitCommands;[/color]
				sleep 5;
				deleteVehicle _soundsource;

thx in advance

Share this post


Link to post
Share on other sites

Can someone please fix this script for me im making a life mission but im not still learning how to script

[/color]]_vehinit = "_veh = this;_veh lock true;clearWeaponCargo _veh;clearMagazineCargo _veh;clearItemCargo _veh;clearBackpackCargo _veh;";

_copcarspawn = getMarkerPos "copcarspawn";

_civcarspawn = getMarkerPos "civcarspawn";getmymoney = player getVariable "mymoney";

if (player in list trgswatbase) then {

_copcarspawn = getMarkerPos "swatcarspawn";

};

if (player in list terrorbase) then {

_civcarspawn = getMarkerPos "terrorcarspawn";

};

if((player getVariable "driverlicense") >= 1) then

{

if(side player == west) then

{

_carspawn = _copcarspawn;

if((lbCurSel 11121) == 0) then

{

displayname = "Quad";

thisprice = 5000;

vehname = "B_Quadbike_F";

if((player getVariable "mymoney") >= thisprice) then

{

closeDialog 0;

player setVariable ['mymoney', getmymoney - thisprice];

hint format['You bought a %1 for %2$! You have %3 $ left!',displayname,thisprice,(player getVariable 'mymoney')];

_veh = vehname createVehicle (_carspawn);

vehiclelock = _veh addAction ['Unlock / Lock','vehiclelock\unlocklock.sqf',[],7,true,true,'','(_target distance _this) < 4'];

_veh setVehicleInit _vehinit;

processInitCommands;

}

else

{

Hint format ["you have %1$ and need %2$",(player getVariable 'mymoney'),(thisprice)];

};

};

RED - hopefully makes it easy to understand what what means.

Share this post


Link to post
Share on other sites
Thunder666;2411783']hi all' date='

[b']please[/b] someone can help me with that broken part of a Script ?

	_bomb = _this;
				_soundsource = "Land_HelipadEmpty_F" createVehicle position _bomb;
				WaitUntil{(position _bomb select 2)<30};
				_soundsource setPos position _bomb;
[color="#FF0000"]_soundsource setVehicleInit format["this say'bon_Shell_In_v0%1'",1,2,3,4,5,6,7] select round random 6];
				processInitCommands;[/color]
				sleep 5;
				deleteVehicle _soundsource;

thx in advance

init.sqf

fnc_say = {(_this select 0) say (_this select 1)};

	
_bomb = _this;
_soundsource = "Land_HelipadEmpty_F" createVehicle position _bomb;
WaitUntil{(position _bomb select 2)<30};
_soundsource setPos position _bomb;
_snd = format["this say'bon_Shell_In_v0%1'",1,2,3,4,5,6,7] select round random 6;
[_soundsource,_snd,true,false] spawn BIS_fnc_MP;
sleep 5;
deleteVehicle _soundsource;

---------- Post added at 10:11 AM ---------- Previous post was at 10:09 AM ----------

Can someone please fix this script for me im making a life mission but im not still learning how to script

code

RED - hopefully makes it easy to understand what what means.

change all of your clear cargo etc to the global variant.

clearWeaponCargoGlobal etc.

no need to use init for clearing cargo.

Share this post


Link to post
Share on other sites

---------- Post added at 10:11 AM ---------- Previous post was at 10:09 AM ----------

[/color]

change all of your clear cargo etc to the global variant.

clearWeaponCargoGlobal etc.

no need to use init for clearing cargo.

Thanks for the help but the vehicle will still not spawn

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×