to achive what you want, you have 2 systems available
In all cases you will need to run a "Killed" eventhandler on each player.
This is easily done by placing the following line in the init.sqs
INIT.SQS?(local Player):player addEventHandler ["killed", {_this exec "playerkilled.sqs"}]
as for the respawn type, you have 2 choices
Group RespawnNormal pvp respawn eg respawn = 3
and the best repsawndelay to set in the description.ext is 1 second
For group respawn to work, you need each player in their own group
and at least 1 ai for them to respawn into.
You can place this ai out of harms way and simply setpos yourself back into the game area when you respawn.
Additionally when you respawn you need to create a "Spare" Ai to respawn into when you next die
NB>> you must have an AI alive before you die for this system to work, it wont work by creating the ai that you will spawn into, on your death
The other system is normal respawn, eg respawn = 3 where you simply respawnj into your old self after death
You cannot alter the respawn delay, but what you can do is place the unit/player in a cutscene for a simulated delay, this you can alter as much as you want and also limit the number of respawns by simply not allowing the unit to escape its cutscene.
the following is a very basic example of a simple playerkilled script, run from the Killed eventhandler
firstly initialise some variables in the INIT.sqs
INIT.sqs;;; following gives the player 5 lives
tx_respawns = 5
;;; following is the amount of time the cutscene will be run for
tx_respawndelay = 20
MISSION EDITOR1) Create something for the camera to look at, eg a medic tent, name it medic1
2) create your respawn marker and place it somewhere safe and out of harms way
3) create another marker, place it where you want the player to rejoin the game, name this "tx_spawnmarker"
Playerkilled.sqsplayer removeAllEventHandlers "Killed"
;; following saves the units loadout on death, so you can rearm him with the same weapons on spawn
_weapArray = weapons player
_magArray = magazines player
_primarywep = primaryweapon player
Player setcaptive true
enableradio false
#KILLCOUNT
;;; this bit checks how many times the unit has died, and if its too many, stops the player taking any further part
?(tx_respawns <=0): goto "DEAD"
tx_respawns = tx_respawns - 1
@alive player
Player setcaptive true
removeallweapons player
player addEventHandler ["killed", {_this exec "playerkilled.sqs"}]
#CUTSCENE
cutText ["","Black out",0.01]
titletext[format["%1\nYou will be returned to the game shortly", name player],"PLAIN"]
_CamPos = getpos medic1
showcinemaborder true
_camera = "camera" camCreate _CamPos
_camera cameraEffect ["internal", "back"]
_camera camSetTarget medic1
_camera camSetRelPos [1,5,3.25]
_camera camCommit 0
@camCommitted _camera
~5
;;; loop for simulated respawn delay
_loopcount = tx_respawndelay
;;;tx_respawndelay = tx_respawndelay + 20
#Loop
titletext[format["Respawning in %1 secs", _loopcount],"PLAIN"]
_loopcount =_loopcount - 1
?(_loopcount <= 0):goto "SPAWN"
goto "Loop"
#SPAWN
player switchCamera "INTERNAL"
player cameraeffect ["terminate","back"]
camDestroy _camera
showcinemaborder false
cutText ["","Black in",2]
enableradio true
#REARM
{player addMagazine _x} forEach _magArray
{player addWeapon _x} forEach _weapArray
;;;;;;;;;; BIS Standard
?(_primarywep == "M16GrenadeLauncher"): _primarywep = "M16Muzzle"
?(_primarywep == "Ak74GrenadeLauncher"): _primarywep = "AK74Muzzle"
?(_primarywep == "Ak47GrenadeLauncher"): _primarywep = "AK47Muzzle"
#SETPOS
player setpos (getmarkerpos "tx_spawnmarker")
~1
Player setcaptive false
exit
#DEAD
cutText ["","Black out",1]
~1
titletext[format["%1\nYou are K.I.A\n\nWars Over Dude!", name player],"PLAIN"]
[player] join grpnull
Player setcaptive true
removeallweapons player
player removeAllEventHandlers "Killed"
_CamPos = getpos medic1
showcinemaborder true
_camera = "camera" camCreate _RsCamPos
_camera cameraEffect ["internal", "back"]
_camera camSetTarget medic1
_camera camSetRelPos [1,5,3.25]
_camera camCommit 0
@camCommitted _camera
exit
Rather than have a boring camera cutscene, you can initiate kegety's spectator script, this however rerquires more work, as you need to update the spectate script deathcamarray, every time you respawn a player.
other things you can do, is dynamically increase the respawn delay time, by adding the line highlighted in red
The above system would be the same for group respawn, apart freom that you would add a
"createunit" command after the
@ alive condiotion