From 2e353139b73df75aba30a250309b867f4022a9b6 Mon Sep 17 00:00:00 2001 From: div0 Date: Wed, 10 Jun 2009 07:15:32 +0000 Subject: [PATCH] restricted spawnpoints (1 = bot only, 2 = human only) git-svn-id: svn://svn.icculus.org/nexuiz/trunk@6954 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/qcsrc/server/cl_client.qc | 12 ++++++++++++ data/scripts/entities.def | 8 ++++++++ 2 files changed, 20 insertions(+) diff --git a/data/qcsrc/server/cl_client.qc b/data/qcsrc/server/cl_client.qc index 57a084c65..cd2ff9cd6 100644 --- a/data/qcsrc/server/cl_client.qc +++ b/data/qcsrc/server/cl_client.qc @@ -1,6 +1,7 @@ .float spectatee_status; .float zoomstate; .float bloodloss_timer; +.float restriction; .entity clientdata; float ClientData_Send(entity to, float sf) @@ -118,6 +119,17 @@ float Spawn_Score(entity spot, entity playerlist, float teamcheck) if(race_spawns) if(spot.target == "") return -1; + + if(clienttype(self) == CLIENTTYPE_REAL) + { + if(spot.restriction == 1) + return -1; + } + else + { + if(spot.restriction == 2) + return -1; + } // filter out spots for assault if(spot.target != "") { diff --git a/data/scripts/entities.def b/data/scripts/entities.def index f02079e49..518fb9112 100644 --- a/data/scripts/entities.def +++ b/data/scripts/entities.def @@ -281,6 +281,7 @@ Attacking team's player spawning location in Assault. Should touch the floor, bu target: this should point to a target_objective to decide when this spawning point is active. target2: trigger all entities with this targetname when someone spawns cnt: weight of spawn point for random selection. Set to a lower value if you have many spawn points close together. Default value is 1. +restriction: when 1, only bots can spawn here; when 2, only humans can spawn here (be careful with these, or the game will crash because someone cannot spawn) */ /*QUAKED info_player_deathmatch (0 1 0) (-16 -16 -24) (16 16 45) @@ -289,6 +290,7 @@ Normal player spawning location in game types without team spawns. Should touch cnt: weight of spawn point for random selection. Set to a lower value if you have many spawn points close together. Default value is 1. target: trigger all entities with this targetname when someone spawns targetname: when targeted by a func_button, pressing the button will assign the spawn point to the team of the activator as an additional spawn point, or reassign it if it was already assigned. Also used to assign spawn points to Onslaught control points. +restriction: when 1, only bots can spawn here; when 2, only humans can spawn here (be careful with these, or the game will crash because someone cannot spawn) */ /*QUAKED info_player_defender (.5 .5 .5) (-16 -16 -24) (16 16 45) @@ -297,6 +299,7 @@ Defending team's player spawning location in Assault. Should touch the floor, bu target: this should point to a target_objective to decide when this spawning point is active. target2: trigger all entities with this targetname when someone spawns cnt: weight of spawn point for random selection. Set to a lower value if you have many spawn points close together. Default value is 1. +restriction: when 1, only bots can spawn here; when 2, only humans can spawn here (be careful with these, or the game will crash because someone cannot spawn) */ /*QUAKED info_player_team1 (1 0 0) (-16 -16 -24) (16 16 45) @@ -305,6 +308,7 @@ Red team's player spawning location in e.g. CTF and Onslaught. Should touch the cnt: weight of spawn point for random selection. Set to a lower value if you have many spawn points close together. Default value is 1. target: trigger all entities with this targetname when someone spawns targetname: when targeted by a func_button, pressing the button will reassign the spawn point to the team of the activator. If a team has no more spawn point left, it immediately loses. +restriction: when 1, only bots can spawn here; when 2, only humans can spawn here (be careful with these, or the game will crash because someone cannot spawn) */ /*QUAKED info_player_team2 (0 0 1) (-16 -16 -24) (16 16 45) @@ -313,6 +317,7 @@ Blue team's player spawning location in e.g. CTF and Onslaught. Should touch the cnt: weight of spawn point for random selection. Set to a lower value if you have many spawn points close together. Default value is 1. target: trigger all entities with this targetname when someone spawns targetname: when targeted by a func_button, pressing the button will reassign the spawn point to the team of the activator. If a team has no more spawn point left, it immediately loses. +restriction: when 1, only bots can spawn here; when 2, only humans can spawn here (be careful with these, or the game will crash because someone cannot spawn) */ /*QUAKED info_player_team3 (1 1 0) (-16 -16 -24) (16 16 45) @@ -321,6 +326,7 @@ Yellow team's player spawning location, but there is no game mode to use this ye cnt: weight of spawn point for random selection. Set to a lower value if you have many spawn points close together. Default value is 1. target: trigger all entities with this targetname when someone spawns targetname: when targeted by a func_button, pressing the button will reassign the spawn point to the team of the activator. If a team has no more spawn point left, it immediately loses. +restriction: when 1, only bots can spawn here; when 2, only humans can spawn here (be careful with these, or the game will crash because someone cannot spawn) */ /*QUAKED info_player_team4 (1 0 1) (-16 -16 -24) (16 16 45) @@ -329,6 +335,7 @@ Pink team's player spawning location, but there is no game mode to use this yet. cnt: weight of spawn point for random selection. Set to a lower value if you have many spawn points close together. Default value is 1. target: trigger all entities with this targetname when someone spawns targetname: when targeted by a func_button, pressing the button will reassign the spawn point to the team of the activator. If a team has no more spawn point left, it immediately loses. +restriction: when 1, only bots can spawn here; when 2, only humans can spawn here (be careful with these, or the game will crash because someone cannot spawn) */ /*QUAKED item_armor_large (.4 .8 .4) (-30 -30 0) (30 30 32) FLOATING @@ -1234,6 +1241,7 @@ target: this should point to a trigger_race_checkpoint to decide when this spawn target2: trigger all entities with this targetname when someone spawns cnt: weight of spawn point for random selection. Set to a lower value if you have many spawn points close together. Default value is 1. race_place: if target points to the trigger_race_checkpoint with cnt 0 (finish line), this sets which place the spawn corresponds to; the special value 0 stands for spawns for players who come in later (have to be behind the ones with race_place set to an actual place), and -1 marks the spawnpoint for qualifying mode only +restriction: when 1, only bots can spawn here; when 2, only humans can spawn here (be careful with these, or the game will crash because someone cannot spawn) */ /*QUAKED func_pointparticles (.5 .5 .5) ? START_ON IMPULSE -- 2.39.2