Home   Help Search Login Register  

Author Topic: veichle respawn  (Read 1164 times)

0 Members and 1 Guest are viewing this topic.

Jim666

  • Guest
veichle respawn
« on: 08 May 2004, 12:49:52 »
Okay, i got a respawn for cars and such, but when they blow to pieces and come back, you cant go back into them?.. which is a problem

Code: [Select]
?!(local Server): Goto "end"
_vcl = _this select 0
_respawndelay = 20
_dir=Getdir _vcl
_position=Getpos _vcl
_Vehicles=[]

_WTrucks=["Truck5tOpen","Truck5tRepair","Truck5tReammo","Truck5tRefuel","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","SkodaBlue","SkodaRed","SkodaGreen","Trabant"]
_Helos=["Cobra","AH64","CH47D","OH58","UH60MG","UH60","Mi24","Mi17"]
_Planes=["Cessna","A10LGB","A10","SU25"]
_WArmor=["M1Abrams","M60","Bradley","M113Ambul","Vulcan","M113","BoatW","M2StaticMG"]
_EArmor=["T80","T72","BMP2","BMPAmbul","BMP","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

#specialinits
?(_type=="cessna"):goto "cessna"
?(_type=="OH58"):goto "OH58"

#start
~2
?(Canmove _vcl):goto "start"
~_respawndelay
deleteVehicle _vcl
_vcl = _type createVehicle _position
_vcl setdir _dir

#specialrearming

?(_type=="cessna"):goto "cessna"
?(_type=="OH58"):goto "OH58"

Goto "start"

#cessna
_vcl addweapon "MaverickLauncher"
_vcl addweapon "MachineGun30A10"
_vcl addweapon "LaserGuidedBombLauncher"
_vcl addweapon "ZuniLauncher38"
_vcl removemagazines "MaverickLauncher"
_vcl removemagazines "MachineGun30A10"
_vcl removemagazines "LaserGuidedBombLauncher"
_vcl addmagazine "MaverickLauncher"
_vcl addmagazine "MachineGun30A10"
_vcl addmagazine "LaserGuidedBombLauncher"
_vcl addmagazine "ZuniLauncher38"
goto "start"

#OH58
_vcl removemagazine "LaserDesignatorOH"
_vcl removeweapon "LaserDesignatorOH"

goto "start"

#end
Exit

knowing me its probably messed up somewhere, any ideas?..

Offline Seven

  • Members
  • *
  • Am I a llama?
Re: veichle respawn
« Reply #1 on: 06 Aug 2006, 06:45:02 »
Know this is an oldy, but had too much time to browse this forum & hope you solved in meanwhile  ;D
But maybe someone else could use the answer:

Code: [Select]
_vcl lock False

for the respawning vehicle in ur script

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Re: veichle respawn
« Reply #2 on: 06 Aug 2006, 15:53:00 »
Hey Jim

I know some vehicle scripts do take a while to let you back in to the vehicle. If you play maps that use createvehicle (MFCTI , Crime City, Battlefield etc) you will notice there is a small wait before you can get into the vehicle.

How long do you wait until it lets you back into the vehicle?

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: veichle respawn
« Reply #3 on: 06 Aug 2006, 20:13:03 »
you need to reveal the vehicle to the player.

respawned vehicles or units, even stuff that's been setpos'd to another location, takes a while to show up on AI 'radar', hence the pause.

oh, and jimboob - change your avatar url. the link's broken.
« Last Edit: 06 Aug 2006, 20:14:50 by bedges »