you are not supposed to use "init line" you put for that what you would want their int line to be:
ex. you could call the script again from the new unit to give him a respawn:
[white1, SoldierLAW, {[white1, SoldierLAW, ""] exec "LimitedRespawn.sqs"} ] exec "LimitedRespawn.sqs"
that will give him a second respawn
you'll notice i use {} instead of "". that is so the game doesn't get confused about which quote is for what
and the unit will respawn as many times as you put that into the next units init line, like so:
[white1, SoldierLAW, {[white1, SoldierLAW, {[white1, SoldierLAW, {[white1, SoldierLAW, ""] exec "LimitedRespawn.sqs"}] exec "LimitedRespawn.sqs"}] exec "LimitedRespawn.sqs"} ] exec "LimitedRespawn.sqs"
that would give him 4 respawns
if you want nothing in their init line just leave it blank
yes its very confusing, and it would work a lot better if i made the number of respawns defined by the editor through the arguments, but that would take a while, and i don't think you will be giving them many respawns
as for the marker thing, the script needs to be changed for that:
_player = _this select 0
_marker = _this select 1
_UnitType = _this select 2
_init = _this select 3
_group = group _player
?_init = null:_init = ""
?_UnitType = null:goto "default"
#CheckDead
@!(alive _player):_UnitType createUnit [getmarkerpos _marker, _group, _init]
exit
#default
?side _player = west:_UnitType = "SoldierWB";goto "CheckDead"
?side _player = east:_UnitType = "SoldierEB";goto "CheckDead"
?side _player = resistance:_UnitType = "SoldierGB";goto "CheckDead"
;just put this here to insure that it goes back
goto "CheckDead"
now you need to call the script with:
[unitname,markername,unit type, init line] exec "limitedrespawn.sqs"