Help me code this freeking thing to repair / re-ammo

Ask questions, discuss ideas, get answers
Post Reply
User avatar
fo0k
Posts: 1434
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

Help me code this freeking thing to repair / re-ammo

Post by fo0k »

I have a APC (interstate.. CSM)

It should repair and top up ammo nearby vehicles..

Currently it does repair vehicles on the same team but I have issues with the ammo.

Primary fire is the stratos 'thrusters' (a weapon..) and secondary is the nitro (a weapon..)

the APC will topup the primary but not secondary.. I think maybe I have over complicated the code anyway but its confusing me. I want this beast to just repair/reammo anything. do I have to add vehicle type or can I have it repair anything?

It should only work for vehicles on the same team.. although by adding a vehicle type I guess that does that anyway? (each team has an APC and the stratos vehicles.. thats it. but I have made 4 seperate vehicles.. a stratos for each team and an APC.. named stratosvigi, stratosking, suburban and suburban2.

code below is just for suburban. equivalent required for suburban2


Its not correct atm, thats for sure.

Too confused now looking at it.

Code: Select all

rem repair and ammo stuff ******************************
ObjectTemplate.addTemplate CarRepairpointvigi
ObjectTemplate.setPosition 3.3/0/0
ObjectTemplate.setRotation 0/0/0
ObjectTemplate.create SupplyDepot CarRepairpointvigi
ObjectTemplate.radius 10
ObjectTemplate.team 0
ObjectTemplate.addVehicleType stratosvigi -1 10 0
ObjectTemplate.AddAmmoType 0 -1 10 0
ObjectTemplate.workOnVehicles 1
ObjectTemplate.workOnSoldiers 0
ObjectTemplate.loadSoundScript ../../../Common/Sounds/SupplyDepot_vehicle.ssc

ObjectTemplate.addTemplate AmmoboxSupplyDepot
ObjectTemplate.setPosition 0/0/0
ObjectTemplate.setRotation 0/0/0
ObjectTemplate.addTemplate AmmoboxVehicleSupplyDepot
ObjectTemplate.setPosition 0/0/0
ObjectTemplate.setRotation 0/0/0

ObjectTemplate.create SupplyDepot AmmoboxSupplyDepot
ObjectTemplate.radius 10
ObjectTemplate.team 0
ObjectTemplate.setHealth 0 0 0
ObjectTemplate.addAmmoType 1 -1 15 0
ObjectTemplate.addAmmoType 2 -1 1.2 0
ObjectTemplate.addAmmoType 3 -1 1.2 0
ObjectTemplate.workOnVehicles 0
ObjectTemplate.workOnSoldiers 1
ObjectTemplate.loadSoundScript ../../../Common/Sounds/SupplyDepot.ssc

rem *** AmmoboxVehicleSupplyDepot ***
ObjectTemplate.create SupplyDepot AmmoboxVehicleSupplyDepot
ObjectTemplate.radius 10
ObjectTemplate.team 0
ObjectTemplate.setHealth 0 0 0
ObjectTemplate.addAmmoType 0 -1 20 0
ObjectTemplate.addAmmoType 1 -1 20 0
ObjectTemplate.addAmmoType 2 -1 20 0
ObjectTemplate.addAmmoType 3 -1 20 0
ObjectTemplate.workOnVehicles 1
ObjectTemplate.workOnSoldiers 0
ObjectTemplate.loadSoundScript ../../../Common/Sounds/SupplyDepot.ssc
freddy
Posts: 1267
Joined: Sun Oct 18, 2009 4:58 pm

Post by freddy »

fo0k wrote:do I have to add vehicle type or can I have it repair anything?
yeh man, just add the vehicles you want it to repair.

example from what i´m using, it only repairs when team 2 are in the seat.

Code: Select all

rem *** EnterpriseAirplaneSupplyDepot ***
ObjectTemplate.create SupplyDepot EnterpriseAirplaneSupplyDepot
ObjectTemplate.radius 35
ObjectTemplate.team 2
ObjectTemplate.setHealth -1 3 0
ObjectTemplate.addVehicleType corsair -1 4 0
ObjectTemplate.addVehicleType Spitfire -1 4 0
ObjectTemplate.addVehicleType SBD -1 6 0
ObjectTemplate.addVehicleType B17 -1 12 0
ObjectTemplate.addVehicleType Elco80 -1 8 0
ObjectTemplate.addAmmoType 1 -1 10 0
ObjectTemplate.addAmmoType 2 -1 4 0
ObjectTemplate.addAmmoType 3 -1 4 0
rem ObjectTemplate.addAmmoType 5 -1 0.5 0
ObjectTemplate.addAmmoType 10 -1 200 0
ObjectTemplate.addAmmoType 9 -1 10 0
ObjectTemplate.addAmmoType 14 -1 200 0
ObjectTemplate.addAmmoType 15 -1 10 0
ObjectTemplate.addAmmoType 19 -1 10 0
ObjectTemplate.addAmmoType 20 -1 200 0
ObjectTemplate.workOnVehicles 1
ObjectTemplate.workOnSoldiers 1
if you lock the vehicles to team 2 to, they will heal and reammo by them self, you dont have to sit in them
Post Reply