From cfddab52f588d78b0ca160cfab92373f8596d5ed Mon Sep 17 00:00:00 2001 From: Lyberta Date: Mon, 28 Aug 2017 09:40:07 +0300 Subject: [PATCH] Player templates: Updated to URS2. --- player-template-example.cfg | 2 +- qcsrc/server/playertemplates.qc | 25 +++++++++++++++++-------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/player-template-example.cfg b/player-template-example.cfg index b97e846110..408f18d695 100644 --- a/player-template-example.cfg +++ b/player-template-example.cfg @@ -31,7 +31,7 @@ set g_player_template_example_drop_weapons "default" "Whether the player can dro // Variables in this section define what happens during item pickup. // Player can get health, armor and/or ammo on top of or instead of an item. // The format of the value is: -// " [health] [armor] [shells] [bullets] [rockets] [cells]" +// " [health] [armor] [shells] [bullets] [rockets] [cells] [plasma] [fuel]" // For example "add 50" will give 50 health and the original item. // "override 0 0 5" will give 5 shells instead of the item. set g_player_template_example_pickup_health_small "default" "What items does player get when they pickup small health" diff --git a/qcsrc/server/playertemplates.qc b/qcsrc/server/playertemplates.qc index 865df42808..65dbf39ced 100644 --- a/qcsrc/server/playertemplates.qc +++ b/qcsrc/server/playertemplates.qc @@ -240,32 +240,42 @@ float PlayerTemplate_GivePlayerItem(entity player, string template, { case 1: { - GivePlayerHealth(player, stof(argv(i))); + GiveResource(player, RESOURCE_HEALTH, stof(argv(i))); break; } case 2: { - GivePlayerArmor(player, stof(argv(i))); + GiveResource(player, RESOURCE_ARMOR, stof(argv(i))); break; } case 3: { - GivePlayerResource(player, RESOURCE_SHELLS, stof(argv(i))); + GiveResource(player, RESOURCE_SHELLS, stof(argv(i))); break; } case 4: { - GivePlayerResource(player, RESOURCE_BULLETS, stof(argv(i))); + GiveResource(player, RESOURCE_BULLETS, stof(argv(i))); break; } case 5: { - GivePlayerResource(player, RESOURCE_ROCKETS, stof(argv(i))); + GiveResource(player, RESOURCE_ROCKETS, stof(argv(i))); break; } case 6: { - GivePlayerResource(player, RESOURCE_CELLS, stof(argv(i))); + GiveResource(player, RESOURCE_CELLS, stof(argv(i))); + break; + } + case 7: + { + GiveResource(player, RESOURCE_PLASMA, stof(argv(i))); + break; + } + case 8: + { + GiveResource(player, RESOURCE_FUEL, stof(argv(i))); break; } } @@ -344,8 +354,7 @@ void PlayerTemplateHook_PlayerSpawn(entity player, string template) } if (!warmup_stage) { - GivePlayerRandomWeapons(player, - PlayerTemplate_GetFloatValue(template, + GiveRandomWeapons(player, PlayerTemplate_GetFloatValue(template, "random_start_weapons_count"), PlayerTemplate_GetStringValue(template, "random_start_weapons"), PlayerTemplate_GetFloatValue(template, "random_start_shells"), -- 2.39.5