Jump to content
Sign in to follow this  
BigRed

Bas vehicle repawn script

Recommended Posts

Ok here is the problem guys I tried using this script and tried adding BAS units to it but it kicks me out of the game any ideas?

;;BEGIN vrs.sqs

;;

;;VehicleType Loop by Sefe

;;Original script by Backoff

;;IMPORTANT: ADD A GAMELOGIC NAMED Server

;;to the mission to prevent multispawn

?!(local Server): Goto "end"

_vcl = _this select 0

_respawndelay = 5

_dir=Getdir _vcl

_position=Getpos _vcl

_Vehicles=[]

_WTrucks=["Truck5tOpen","Truck5tRepair","Truck5tReammo","Truck5t

Refuel","Truck5t"]

_ETrucks=["UralRepair","UralReammo","UralReFuel","Ural"]

_CivTrucks=["TruckV3SGCivil","TruckV3SGRefuel","TruckV3SGRepair","

TruckV3SGReammo","TruckV3SG"]

_Jeeps=["JeepMG","GJeep","HMMWV","UAZ","SGUAZG"

,"UAZG","Jeep"]

_Cars=["Tractor","Rapid","RapidY","Skoda","SkodaBlu

e","SkodaRed","SkodaGreen","Trabant"]

_Helos=["Cobra","AH64","CH47D","UH60MG","UH60",

"Mi24","Mi17","bas_kiowawarrior5"]<------------------HERE

_Planes=["Cessna","A10LGB","A10","SU25"]

_WArmor=["M1Abrams","M60","Bradley","M113Ambul","Vulc

an","M113","BoatW","M2StaticMG"]

_EArmor=["T80","T72","BMP2","BMPAmbul","BMP",&am

p;qu

ot;BRDM","BoatE","ZSU","T55G"]

_Other=["Mash"]

_Vehicles=_WTrucks+_ETrucks+_CivTrucks+_Jeeps+_Cars+_Helos+_Planes+_WArmor+_EArmor+_Other

_i = 0

#Loop

? (_i > (Count _Vehicles)) : Goto "Skip"

_VehicleType = _Vehicles Select _i

_VehicleTypeDoesMatch = ((_VehicleType CountType _this) == 1)

? _VehicleTypeDoesMatch : _type = _VehicleType

? _VehicleTypeDoesMatch : Goto "Skip"

_i = _i + 1

Goto "Loop"

#Skip

#start

~2

?(Canmove _vcl):goto "start"

~_respawndelay

deleteVehicle _vcl

_vcl = _type createVehicle _position

_vcl setdir _dir

goto "start"

#end

Exit

;;END vrs.sqs

Share this post


Link to post
Share on other sites

I am not sure why it does that but if you have version 1.91 this will work no problem i am using it in a mission that uses all BAS units for the west:

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">_obj = _this select 0

? not local Server : exit

_pos = getPos _obj

_dir = getDir _obj

;_type = "UAZ"

_type = typeOf _obj

#clear

_t = 0

#alive

~3

? not alive _obj : _delay = 60; goto "notalive"

? fuel _obj == 1 : goto "clear"

? count crew _obj != 0 : goto "clear"

? _t == 0 : _t = _time + 60

? _t > _time : goto "alive"

"_obj removeMagazine _x" forEach magazines _obj

_obj setFuel 0

_obj setDamage 1

_delay = 10

#notalive

~_delay

deleteVehicle _obj

~1

_obj = _type createVehicle _pos

_obj setDir _dir

goto "clear"

<span id='postcolor'>

Just give the script a name like vrs.sqs make a game logic and call it "server" and in the init field of any unit you want to use the script put:

[this] exec "vrs.sqs"

and your set, hope this helps  biggrin.gif

Share this post


Link to post
Share on other sites

hmm I seem to of found out that for the Littlebirds it works fine but the KiowaWarroirs it shuts down OFP so I am not sure. I wonder if it has to due with the Warrior scripts that make the dust fly not sure. confused.gif

Share this post


Link to post
Share on other sites
Guest jacobaby

this was posted a similar thing in the kiowas thread. You need to wait long enough for one of the effects to finish, I cant remember which now...check the release thread for the kiowas.

TJ

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  

×