Home   Help Search Login Register  

Author Topic: Please Help with vehicle respawn script  (Read 1486 times)

0 Members and 1 Guest are viewing this topic.

thirdrm

  • Guest
Please Help with vehicle respawn script
« on: 25 Sep 2006, 13:40:28 »
Hi, i am using a respawn script by the name of vrs4.sqs, il post it at the bottom, My problem is that in my mission ATEF Aggression, on freya island, the planes that are respawned dont jsut respawn the one plane, but several others that block other planes lined up. This is not suposed to happen... and it never did this in any other mission ive used it in.


Code: [Select]
; Vehicle Respawn Script 4.0.
; By: Aftermath (Lithium).
; 06.26.06 - 4:50AM. -Updated 06.28.06
;-------------------------------------------|
; Change Log: ------------------------------|
; Now using Init line to get vehicle...     |
; --- variables.                            |
; Changed old vehicle recognization to...   |
; --- legacy.   |
; Changed Local Checking Method.            |
;-------------------------------------------|
; You Must specify the vehicles in the ---- |
; script if they are to use respawn init's! |
;-------------------------------------------|
; To Use, add a Game Logic to your mission..|
; named: "vehServer".                       |
;-------------------------                  |
; Place this line in any vehicles Init to.. |
; have it respawn.                          |
;-------------------------                  |
; varName = this; [this] exec "vrs4.sqs"    |
;-------------------------------------------|

; Define Variables.
_vehicle = _this select 0
_monitordelay = 10
_respawndelay = 10
_direction = Getdir _vehicle
_position = Getpos _vehicle

_type = typeOf _vehicle

#monitor
; Make sure that only the server respawns the
; --- vehicle.
?! (local vehServer) : EXIT
; Wait a specified time to check status of
; --- the vehicle.
~_monitordelay
? (alive _vehicle) : goto "monitor"
; If vehicle is not alive, wait a specified
; --- time to respawn the vehicle.
~_respawndelay
; Set vehicle as oldvehicle before changing
; --- variables.
_oldvehicle = _vehicle

#respawn
; Change variable to reflect the new vehicle,
; --- along with creating and setting its
; ---- new position.
_vehicle = _type createVehicle _position
_vehicle Setdir _direction
; Legacy old vehicle checking method below,
; --- Please use the method listed in the
; ---- instructions above as of v4.0.
;------------------------------------------
;?_oldvehicle == bas_mh60k : bas_mh60k = _vehicle; publicVariable (bas_mh60k)
;?_oldvehicle == SOPiper : SOPiper = _vehicle; publicVariable (SOPiper)
;?_oldvehicle == Cobra : Cobra = _vehicle; publicVariable (Cobra)
;------------------------------------------
; Take the oldvehicle and delete its destroyed
; --- mesh.
deleteVehicle _oldvehicle
; Return to monitor to start all over again :).
goto "monitor"

; End of File.

Offline Seven

  • Members
  • *
  • Am I a llama?
Re: Please Help with vehicle respawn script
« Reply #1 on: 26 Sep 2006, 00:40:29 »
Is it the first time you use it for a MPmission?
If so maybe you forgot to include the game logic named "vehServer"?
Although a simple game logic named "Server" should do when respawning vehicles for MP, you could loose the line ?! (local vehServer) : EXIT which prevents mulitple spawning and simply put at the top of the script ?(!local server):exit

thirdrm

  • Guest
Re: Please Help with vehicle respawn script
« Reply #2 on: 26 Sep 2006, 01:00:00 »
its actualy like the third time, and none of the other times has it given me trouble.

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: Please Help with vehicle respawn script
« Reply #3 on: 27 Sep 2006, 16:05:35 »
It soundslike you have forgotten to put the game logic named "vehServer" or have misnamed it.
urp!