Jump to content
Sign in to follow this  
BlackCatSLO

Problems with some code

Recommended Posts

Hy, i have one big problem im writing script for repairing the vehicles but i did ran in to problems, i can not find out whats wrong with this code

the hint command is there just for testing and i dont think its the problem...

is empty trigger on the map repairshop_trig just for marking the location...

This script runs in the init.

The errors are: generic error somewere in for loop, mising {

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

#cnext

_alltypes = "Currently in repair zone:\n";

_i = 0

_objlist = position repairshop_trig nearObjects ["LandVehicle",15]

if ((count _objlist) >= 1) then {

for "_i" from 0 to ((count _objlist) - 1) do {

_obj = _objlist select _i;

_alltypes = format["%1\n %2",_alltypes , _obj];

_speed = sqrt(((_obj velocity select 0) * (_obj velocity select 0))+((_obj velocity select 1) * (_obj velocity select 1))+((_obj velocity select 2) * (_obj velocity select 2)));

if (_speed < 1) then {_obj setVehicleArmor 1;};

};

hint format["%1\n NUM OF REPAIRS: %2",_alltypes , count _objlist]

};

~1

goto "cnext"

tnx for help

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  

×