Quote: --- Original message by: jawa
Although that will say it to everyone I dont know if there is a way to say it to just the one player.
You can't really find out the local player on stock HCE. You'd basically want to have everyone as deathless if you wanted to correctly track it. With OS, you can get the current player number. Anyways, even if you knew the correct player number, at that point you'd want a cutscene title since sv_say can only be preformed on the host and would display to everyone.
Quote: --- Original message by: Dumb AI
Is there a way to display the name of the player?
No, sv_players is the closest you can get, but it doesn't return anything, nor allow you to put in an index.
Anyways, the script jawa posted, it warns them, but then it damages them regardless of whether they heed the warning or not. You should check if they are still out there.. but then there comes the problem, if the player numbers shifted. Someone could stay out there for ever if the numbers keep shifting. Anyways, I would recommend a constant and slow damage. it should be enough for them to realize they don't want to stay in wherever very long.
(global short number 0)
(script static unit player (unit (list_get (players) number)))
(script continuous kill_volumes
(if (volume_test_object <trigger_volume> (player)) (damage_object <damage> (player)))
;;Repeat above if statement for however many volumes you need, right here.
(if (< number 15) (set number (+ number 1)) (set number 0))
)
the 'damage' is the tag location of a damage effect, so a pistol bullet would be "weapons\pistol\bullet" since bullet.damage_effect resides there. Just make it a low amount of damage if you want them to have a chance to turn back alive. If its a death pit, then just make it instant kill by replacing the damage_object with (unit_kill (player))