assasination script in MP
Posted: Tue Jan 14, 2003 1:13 pm
I am trying to combine a random spawn script with the assassination script in a MP map. I did add the following script to my mymap.scr
The manon (a request from JV_map
) is spawned randomly in the map (that is : at several places in the map are script_origin 's with targetname= spawn1) That part is working fine. But whenever I add the SECOND CODE (target) the manon won't spawn anymore...
What am I doing wrong?
Code: Select all
spawn_random_leader local.num:
// find a spawnpoint
local.spawnpoints = $("spawn" + local.num)
// local.spawnpoints is now the list of available spawnpoints
// find a random index
local.index = randomint (local.spawnpoints.size - 1) + 1
// randomint <max> returns a number between o and max
// so randomint <size - 1> returns a number between o and
// the number of spawnpoints - 1
// after +1 local.index is a number between 1 and
//the number of spawnpoints.
local.spawnpoint = local.spawnpoints[local.index]
// ordinary spawn code here, e.g.
local.enemy = spawn models/human/allied_misc_manon.tik
local.enemy.origin = local.spawnpoint.origin
local.enemy.angles = local.spawnpoint.angles
local.enemy.targetname = "leader"
local.enemy.health = 200
thread target
end
Code: Select all
target:
If(IsAlive $leader)
$leader waittill death // if the leader is killed, then the mission will complete
thread theend
end
Code: Select all
theend:
iprintIn "The resistance leader has been killed. Mission completed!"
waitframe
teamwin axis
end
What am I doing wrong?