>
any other ideasYes, a few...
You're using the script a bit wrong. Let me explain.
I'll assume you'd like three different respawn areas for west. Create the markers
respawn_west,
respawn_west1, and
respawn_west2. You need the good-old
respawn_west in case the random number generator returns zero.
Second, your triggers to respawn the players should all be activated with 3 as their second parameter, e.g.
[S1, 3] exec "respawn.sqs". This is because you have three different respawn zones. If you put 1 or 2 there then the first player will always respawn in
respawn_west, and the second will respawn in either
respawn_west or
respawn_west1, but never in
respawn_west2.
Now for the code that gives you the error:
_player setpos [(_pos select 0) + _randx, (_pos select 1) + _randy, (_pos select2)]
You're likely to run into this one again, so examining it a little and understanding it will help you solve it next time.
The code is trying to set the position (setpos) of the player (_player) to a specific x, y, z coordinate (and you thought you'd never find a use for that boring geometry
).
The x and y coordinates are determined by multiplying the x and y coordinates of the respawn marker by a random number, and the z coordinate (the height) is where the problem happens.
The variable
_pos is an array with three elements: x, y and z. You can fetch the value of each using the
select command.
_pos select 0 gets the x coordinate,
_pos select 1 gets the y coordinate, and
_pos select 2 gets the z coordinate. So all you're missing in your code is a space between
select and
2.
However, (this is for Backoff) instead of putting
_pos select 2, I think you could put
0 (zero) there - the player is supposed to respawn at ground-level, isn't he?
Hopefully this solves your problem,
Pope Zog