UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

getting bad syntax

broken avatar :(
Created 8 years ago
by supercush
0 Members and 1 Guest are viewing this topic.
3,405 views
broken avatar :(
×
broken avatar :(
Location: gbUnited Kingdom
Date Registered: 3 January 2015
Last active: 7 years ago
Posts
10
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
supercush's Groups
supercush's Contact & Social Links
Ive looked online at how to add functions and followed them and still i keep getting the bad syntax error. there isnt any lines that are wrong from the console just bad syntax

I only started mapping 2 days ago so the scripting part is new to me, sorry to be a pain but im here for help.

Code Snippet
Plaintext
/*
   Der Frost / Nazi Zombie Sniperbolt Tutorial Version 2.0
      Scripter: Sparks
      Tutorial: Sniperbolt

   Version 1.0 (9/24/2009 7:51:18 PM)
      -- Initial Release Of Source Files
*/

// Tutorial From Sniperbolt!

// Utilities
#include common_scripts\utility;
#include maps\_utility;
#include maps\_zombiemode_utility;
#include maps\_zombiemode_zone_manager;
#include maps\_music;

// DLC3 Utilities
#include maps\dlc3_code;
#include maps\dlc3_teleporter;

main()
{
   level.DLC3 = spawnStruct(); // Leave This Line Or Else It Breaks Everything
   
   // Must Change These To Your Maps
   level.DLC3.createArt = maps\createart\nazi_zombie_123_art::main;
   level.DLC3.createFX = maps\createfx\nazi_zombie_123_fx::main;
   // level.DLC3.myFX = ::preCacheMyFX;
   
   /*--------------------
    FX
   ----------------------*/
   DLC3_FX();
   
   /*--------------------
    LEVEL VARIABLES
   ----------------------*/   
   
   // Variable Containing Helpful Text For Modders -- Don't Remove
   level.modderHelpText = [];
   
   //
   // Change Or Tweak All Of These LEVEL.DLC3 Variables Below For Your Level If You Wish
   //
   
   // Edit The Value In Mod.STR For Your Level Introscreen Place
   level.DLC3.introString = &"nazi zombie tes";
   
   // Weapons. Pointer function automatically loads weapons used in Der Riese.
   level.DLC3.weapons = maps\dlc3_code::include_weapons;
   
   // Power Ups. Pointer function automatically loads power ups used in Der Riese.
   level.DLC3.powerUps =  maps\dlc3_code::include_powerups;
   
   // Adjusts how much melee damage a player with the perk will do, needs only be set once. Stock is 1000.
   level.DLC3.perk_altMeleeDamage = 1000;
   
   // Adjusts barrier search override. Stock is 400.
   level.DLC3.barrierSearchOverride = 400;
   
   // Adjusts power up drop max per round. Stock is 3.
   level.DLC3.powerUpDropMax = 3;
   
   // _loadout Variables
   level.DLC3.useCoopHeroes = true;
   
   // Bridge Feature
   level.DLC3.useBridge = false;
   
   // Hell Hounds
   level.DLC3.useHellHounds = true;
   
   // Mixed Rounds
   level.DLC3.useMixedRounds = true;
   
   // Magic Boxes -- The Script_Noteworthy Value Names On Purchase Trigger In Radiant
   boxArray = [];
   boxArray[ boxArray.size ] = "start_chest";
   boxArray[ boxArray.size ] = "chest1";
   boxArray[ boxArray.size ] = "chest2";
   boxArray[ boxArray.size ] = "chest3";
   boxArray[ boxArray.size ] = "chest4";
   boxArray[ boxArray.size ] = "chest5";
   level.DLC3.PandoraBoxes = boxArray;
   
   // Initial Zone(s) -- Zone(s) You Want Activated At Map Start
   zones = [];
   zones[ zones.size ] = "start_zone";
   level.DLC3.initialZones = zones;
   
   // Electricity Switch -- If False Map Will Start With Power On
   level.DLC3.useElectricSwitch = true;
   
   // Electric Traps
   level.DLC3.useElectricTraps = true;
   
   // _zombiemode_weapons Variables
   level.DLC3.usePandoraBoxLight = true;
   level.DLC3.useChestPulls = true;
   level.DLC3.useChestMoves = true;
   level.DLC3.useWeaponSpawn = true;
   level.DLC3.useGiveWeapon = true;
   
   // _zombiemode_spawner Varibles
   level.DLC3.riserZombiesGoToDoorsFirst = true;
   level.DLC3.riserZombiesInActiveZonesOnly = true;
   level.DLC3.assureNodes = true;
   
   // _zombiemode_perks Variables
   level.DLC3.perksNeedPowerOn = true;
   
   // _zombiemode_devgui Variables
   level.DLC3.powerSwitch = true;

   level.give_ammo = 0;
   ammo_trigs = getentarray("give_ammo","targetname");
   array_thread(ammo_trigs,::give_ammo);
   
   /*--------------------
    FUNCTION CALLS - PRE _Load
   ----------------------*/
   level thread DLC3_threadCalls();   
   
   /*--------------------
    ZOMBIE MODE
   ----------------------*/
   [[level.DLC3.weapons]]();
   [[level.DLC3.powerUps]]();
   maps\_zombiemode::main();
   
   /*--------------------
    FUNCTION CALLS - POST _Load
   ----------------------*/
   level.zone_manager_init_func = ::dlc3_zone_init;
   level thread DLC3_threadCalls2();
   give_ammo();
   {
   while(1)
   
      who = undefined;
      cost  = 1500;

      string = "Press &&1 to buy ammo [Cost: " + cost + "]";

      self sethintstring( string );
      self SetCursorHint( "HINT_NOICON" );
      self UseTriggerRequireLookAt();
      self waittill( "trigger", who );

      weapon = who GetCurrentWeapon();
      ammocount = who getammocount(weapon);
      clipcount = who getweaponammoclip(weapon);
      maxammo = weaponmaxammo(weapon);

      // UNCOMMENT TO MAKE RAY GUN & WUNDERWAFFE AMMO UNBUYABLE
      //if( weapon == "tesla_gun" || weapon == "ray_gun" )
      //{
      //   who iprintln( "You cannot buy ammo for this weapon" );
      //   level.give_ammo = 0;
      //}
      // UNCOMMENT TO MAKE RAY GUN & WUNDERWAFFE AMMO UNBUYABLE

      if( maxammo <= ammocount - clipcount )
      {
         continue;
      }

      if ( weapon != "fraggrenade" && weapon!= "stielhandgranate" && weapon != "molotov" && weapon != "mine_bouncing_betty" && weapon != "mortar_round" && weapon != "satchel_charge_new")
      {
         if( who.score > cost )
         {
            level.give_ammo = 1;
         }
         else
         {
            level.give_ammo = 0;
         }
      }

      if( level.give_ammo > 0 )
      {
         who givemaxammo( who GetCurrentWeapon() );
         who maps\_zombiemode_score::minus_to_player_score( cost );
         who playsound( "cha_ching" );
      }     
      else
      {
         who playsound( "no_cha_ching" );
      }
      wait(0.05);
 
}

dlc3_zone_init()
{

   add_adjacent_zone( "initial_zone", "zone1", "enter_zone1" );
   add_adjacent_zone( "zone1", "zone2", "enter_zone2" );
   /*
   =============
   ///ScriptDocBegin
   "Name: add_adjacent_zone( <zone_1>, <zone_2>, <flag>, <one_way> )"
   "Summary: Sets up adjacent zones."
   "MandatoryArg: <zone_1>: Name of first Info_Volume"
   "MandatoryArg: <zone_2>: Name of second Info_Volume"
   "MandatoryArg: <flag>: Flag to be set to initiate zones"
   "OptionalArg: <one_way>: Make <zone_1> adjacent to <zone_2>. Defaults to false."
   "Example: add_adjacent_zone( "receiver_zone",      "outside_east_zone",   "enter_outside_east" );"
   ///ScriptDocEnd
   =============
   */

   // Outside East Door
   //add_adjacent_zone( "receiver_zone",      "outside_east_zone",   "enter_outside_east" );
}
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
Signature
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
first line,

Code Snippet
Plaintext
   give_ammo();
{


should be

Code Snippet
Plaintext
   give_ammo()
{


if there's more, it's usefull you mention what the error ( line nr ) is
Last Edit: July 06, 2016, 05:26:09 pm by BluntStuffy
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
Signature
×
MakeCents's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
I think that his { is in the wrong place:

Code Snippet
Plaintext
 give_ammo();
   {
   while(1)
   

Should be:
Code Snippet
Plaintext
 give_ammo();
   while(1)
   {

or he put what you said inside another function? and all this should be moved and fixed. None of this appears to belong here.
Code Snippet
Plaintext
give_ammo();
   {
   while(1)
   
      who = undefined;
      cost  = 1500;

      string = "Press &&1 to buy ammo [Cost: " + cost + "]";

      self sethintstring( string );
      self SetCursorHint( "HINT_NOICON" );
      self UseTriggerRequireLookAt();
      self waittill( "trigger", who );

      weapon = who GetCurrentWeapon();
      ammocount = who getammocount(weapon);
      clipcount = who getweaponammoclip(weapon);
      maxammo = weaponmaxammo(weapon);

      // UNCOMMENT TO MAKE RAY GUN & WUNDERWAFFE AMMO UNBUYABLE
      //if( weapon == "tesla_gun" || weapon == "ray_gun" )
      //{
      //   who iprintln( "You cannot buy ammo for this weapon" );
      //   level.give_ammo = 0;
      //}
      // UNCOMMENT TO MAKE RAY GUN & WUNDERWAFFE AMMO UNBUYABLE

      if( maxammo <= ammocount - clipcount )
      {
         continue;
      }

      if ( weapon != "fraggrenade" && weapon!= "stielhandgranate" && weapon != "molotov" && weapon != "mine_bouncing_betty" && weapon != "mortar_round" && weapon != "satchel_charge_new")
      {
         if( who.score > cost )
         {
            level.give_ammo = 1;
         }
         else
         {
            level.give_ammo = 0;
         }
      }

      if( level.give_ammo > 0 )
      {
         who givemaxammo( who GetCurrentWeapon() );
         who maps\_zombiemode_score::minus_to_player_score( cost );
         who playsound( "cha_ching" );
      }     
      else
      {
         who playsound( "no_cha_ching" );
      }
      wait(0.05);
Last Edit: July 06, 2016, 05:40:21 pm by MakeCents
broken avatar :(
×
broken avatar :(
Location: gbUnited Kingdom
Date Registered: 3 January 2015
Last active: 7 years ago
Posts
10
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
supercush's Groups
supercush's Contact & Social Links
first line,

Code Snippet
Plaintext
   give_ammo();
{


should be

Code Snippet
Plaintext
   give_ammo()
{


if there's more, it's usefull you mention what the error ( line nr ) is

I added the ; myself to see if it would fix my error, it doesnt give a line number thats why im confussed.
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
Oh, lol. It's actually inside the main() function i didn't even notice..


So yeh, remove that one ; and move the new function to outside of the main() (or any other) function

Double Post Merge: July 06, 2016, 06:08:37 pm
I think that his { is in the wrong place:

Code Snippet
Plaintext
 give_ammo();
   {
   while(1)
   

Should be:
Code Snippet
Plaintext
 give_ammo();
   while(1)
   {

there's allready a call from the triggers a bit above, so it looks like this should be a new function all together:
Code Snippet
Plaintext
   level.give_ammo = 0;
   ammo_trigs = getentarray("give_ammo","targetname");
   array_thread(ammo_trigs,::give_ammo);


Double Post Merge: July 06, 2016, 06:09:52 pm
I added the ; myself to see if it would fix my error, it doesnt give a line number thats why im confussed.

first enable 'developer 1' in the console, and then load with 'devmap mapname'. Then it should give a better explanation

Double Post Merge: July 06, 2016, 06:11:37 pm
I think you mean to do this:

Code Snippet
Plaintext
/*
   Der Frost / Nazi Zombie Sniperbolt Tutorial Version 2.0
      Scripter: Sparks
      Tutorial: Sniperbolt

   Version 1.0 (9/24/2009 7:51:18 PM)
      -- Initial Release Of Source Files
*/

// Tutorial From Sniperbolt!

// Utilities
#include common_scripts\utility;
#include maps\_utility;
#include maps\_zombiemode_utility;
#include maps\_zombiemode_zone_manager;
#include maps\_music;

// DLC3 Utilities
#include maps\dlc3_code;
#include maps\dlc3_teleporter;

main()
{
   level.DLC3 = spawnStruct(); // Leave This Line Or Else It Breaks Everything
   
   // Must Change These To Your Maps
   level.DLC3.createArt = maps\createart\nazi_zombie_123_art::main;
   level.DLC3.createFX = maps\createfx\nazi_zombie_123_fx::main;
   // level.DLC3.myFX = ::preCacheMyFX;
   
   /*--------------------
    FX
   ----------------------*/
   DLC3_FX();
   
   /*--------------------
    LEVEL VARIABLES
   ----------------------*/   
   
   // Variable Containing Helpful Text For Modders -- Don't Remove
   level.modderHelpText = [];
   
   //
   // Change Or Tweak All Of These LEVEL.DLC3 Variables Below For Your Level If You Wish
   //
   
   // Edit The Value In Mod.STR For Your Level Introscreen Place
   level.DLC3.introString = &"nazi zombie tes";
   
   // Weapons. Pointer function automatically loads weapons used in Der Riese.
   level.DLC3.weapons = maps\dlc3_code::include_weapons;
   
   // Power Ups. Pointer function automatically loads power ups used in Der Riese.
   level.DLC3.powerUps =  maps\dlc3_code::include_powerups;
   
   // Adjusts how much melee damage a player with the perk will do, needs only be set once. Stock is 1000.
   level.DLC3.perk_altMeleeDamage = 1000;
   
   // Adjusts barrier search override. Stock is 400.
   level.DLC3.barrierSearchOverride = 400;
   
   // Adjusts power up drop max per round. Stock is 3.
   level.DLC3.powerUpDropMax = 3;
   
   // _loadout Variables
   level.DLC3.useCoopHeroes = true;
   
   // Bridge Feature
   level.DLC3.useBridge = false;
   
   // Hell Hounds
   level.DLC3.useHellHounds = true;
   
   // Mixed Rounds
   level.DLC3.useMixedRounds = true;
   
   // Magic Boxes -- The Script_Noteworthy Value Names On Purchase Trigger In Radiant
   boxArray = [];
   boxArray[ boxArray.size ] = "start_chest";
   boxArray[ boxArray.size ] = "chest1";
   boxArray[ boxArray.size ] = "chest2";
   boxArray[ boxArray.size ] = "chest3";
   boxArray[ boxArray.size ] = "chest4";
   boxArray[ boxArray.size ] = "chest5";
   level.DLC3.PandoraBoxes = boxArray;
   
   // Initial Zone(s) -- Zone(s) You Want Activated At Map Start
   zones = [];
   zones[ zones.size ] = "start_zone";
   level.DLC3.initialZones = zones;
   
   // Electricity Switch -- If False Map Will Start With Power On
   level.DLC3.useElectricSwitch = true;
   
   // Electric Traps
   level.DLC3.useElectricTraps = true;
   
   // _zombiemode_weapons Variables
   level.DLC3.usePandoraBoxLight = true;
   level.DLC3.useChestPulls = true;
   level.DLC3.useChestMoves = true;
   level.DLC3.useWeaponSpawn = true;
   level.DLC3.useGiveWeapon = true;
   
   // _zombiemode_spawner Varibles
   level.DLC3.riserZombiesGoToDoorsFirst = true;
   level.DLC3.riserZombiesInActiveZonesOnly = true;
   level.DLC3.assureNodes = true;
   
   // _zombiemode_perks Variables
   level.DLC3.perksNeedPowerOn = true;
   
   // _zombiemode_devgui Variables
   level.DLC3.powerSwitch = true;

   /*--------------------
    FUNCTION CALLS - PRE _Load
   ----------------------*/
   level thread DLC3_threadCalls();   
   
   /*--------------------
    ZOMBIE MODE
   ----------------------*/
   [[level.DLC3.weapons]]();
   [[level.DLC3.powerUps]]();
   maps\_zombiemode::main();
   
   /*--------------------
    FUNCTION CALLS - POST _Load
   ----------------------*/
   level.zone_manager_init_func = ::dlc3_zone_init;
   level thread DLC3_threadCalls2();


   level.give_ammo = 0;
   ammo_trigs = getentarray("give_ammo","targetname");
   array_thread(ammo_trigs,::give_ammo);
}

dlc3_zone_init()
{

   add_adjacent_zone( "initial_zone", "zone1", "enter_zone1" );
   add_adjacent_zone( "zone1", "zone2", "enter_zone2" );
   /*
   =============
   ///ScriptDocBegin
   "Name: add_adjacent_zone( <zone_1>, <zone_2>, <flag>, <one_way> )"
   "Summary: Sets up adjacent zones."
   "MandatoryArg: <zone_1>: Name of first Info_Volume"
   "MandatoryArg: <zone_2>: Name of second Info_Volume"
   "MandatoryArg: <flag>: Flag to be set to initiate zones"
   "OptionalArg: <one_way>: Make <zone_1> adjacent to <zone_2>. Defaults to false."
   "Example: add_adjacent_zone( "receiver_zone",      "outside_east_zone",   "enter_outside_east" );"
   ///ScriptDocEnd
   =============
   */

   // Outside East Door
   //add_adjacent_zone( "receiver_zone",      "outside_east_zone",   "enter_outside_east" );
}

give_ammo()
{
   while(1)
   {
      who = undefined;
      cost  = 1500;

      string = "Press &&1 to buy ammo [Cost: " + cost + "]";

      self sethintstring( string );
      self SetCursorHint( "HINT_NOICON" );
      self UseTriggerRequireLookAt();
      self waittill( "trigger", who );

      weapon = who GetCurrentWeapon();
      ammocount = who getammocount(weapon);
      clipcount = who getweaponammoclip(weapon);
      maxammo = weaponmaxammo(weapon);

      // UNCOMMENT TO MAKE RAY GUN & WUNDERWAFFE AMMO UNBUYABLE
      //if( weapon == "tesla_gun" || weapon == "ray_gun" )
      //{
      //   who iprintln( "You cannot buy ammo for this weapon" );
      //   level.give_ammo = 0;
      //}
      // UNCOMMENT TO MAKE RAY GUN & WUNDERWAFFE AMMO UNBUYABLE

      if( maxammo <= ammocount - clipcount )
      {
         continue;
      }

      if ( weapon != "fraggrenade" && weapon!= "stielhandgranate" && weapon != "molotov" && weapon != "mine_bouncing_betty" && weapon != "mortar_round" && weapon != "satchel_charge_new")
      {
         if( who.score > cost )
         {
            level.give_ammo = 1;
         }
         else
         {
            level.give_ammo = 0;
         }
      }

      if( level.give_ammo > 0 )
      {
         who givemaxammo( who GetCurrentWeapon() );
         who maps\_zombiemode_score::minus_to_player_score( cost );
         who playsound( "cha_ching" );
      }     
      else
      {
         who playsound( "no_cha_ching" );
      }
      wait(0.05);
  }
}
Last Edit: July 06, 2016, 06:13:15 pm by BluntStuffy
broken avatar :(
×
broken avatar :(
Location: gbUnited Kingdom
Date Registered: 3 January 2015
Last active: 7 years ago
Posts
10
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
supercush's Groups
supercush's Contact & Social Links
So ive moved some things around and i now get this




Which line 192 is the "continue;"



all i done with the code is copied it from a Tutorial on a forum but obviously i placed it wrong or something lol sorry.


Code Snippet
Plaintext
/*
Der Frost / Nazi Zombie Sniperbolt Tutorial Version 2.0
Scripter: Sparks
Tutorial: Sniperbolt

Version 1.0 (9/24/2009 7:51:18 PM)
-- Initial Release Of Source Files
*/

// Tutorial From Sniperbolt!

// Utilities
#include common_scripts\utility;
#include maps\_utility;
#include maps\_zombiemode_utility;
#include maps\_zombiemode_zone_manager;
#include maps\_music;

// DLC3 Utilities
#include maps\dlc3_code;
#include maps\dlc3_teleporter;

main()
{
level.DLC3 = spawnStruct(); // Leave This Line Or Else It Breaks Everything

// Must Change These To Your Maps
level.DLC3.createArt = maps\createart\nazi_zombie_213_art::main;
level.DLC3.createFX = maps\createfx\nazi_zombie_213_fx::main;
// level.DLC3.myFX = ::preCacheMyFX;

/*--------------------
FX
----------------------*/
DLC3_FX();

/*--------------------
LEVEL VARIABLES
----------------------*/

// Variable Containing Helpful Text For Modders -- Don't Remove
level.modderHelpText = [];

//
// Change Or Tweak All Of These LEVEL.DLC3 Variables Below For Your Level If You Wish
//

// Edit The Value In Mod.STR For Your Level Introscreen Place
level.DLC3.introString = &"nazi zombie tes";

// Weapons. Pointer function automatically loads weapons used in Der Riese.
level.DLC3.weapons = maps\dlc3_code::include_weapons;

// Power Ups. Pointer function automatically loads power ups used in Der Riese.
level.DLC3.powerUps =  maps\dlc3_code::include_powerups;

// Adjusts how much melee damage a player with the perk will do, needs only be set once. Stock is 1000.
level.DLC3.perk_altMeleeDamage = 1000;

// Adjusts barrier search override. Stock is 400.
level.DLC3.barrierSearchOverride = 400;

// Adjusts power up drop max per round. Stock is 3.
level.DLC3.powerUpDropMax = 3;

// _loadout Variables
level.DLC3.useCoopHeroes = true;

// Bridge Feature
level.DLC3.useBridge = false;

// Hell Hounds
level.DLC3.useHellHounds = true;

// Mixed Rounds
level.DLC3.useMixedRounds = true;

// Magic Boxes -- The Script_Noteworthy Value Names On Purchase Trigger In Radiant
boxArray = [];
boxArray[ boxArray.size ] = "start_chest";
boxArray[ boxArray.size ] = "chest1";
boxArray[ boxArray.size ] = "chest2";
boxArray[ boxArray.size ] = "chest3";
boxArray[ boxArray.size ] = "chest4";
boxArray[ boxArray.size ] = "chest5";
level.DLC3.PandoraBoxes = boxArray;

// Initial Zone(s) -- Zone(s) You Want Activated At Map Start
zones = [];
zones[ zones.size ] = "start_zone";
level.DLC3.initialZones = zones;

// Electricity Switch -- If False Map Will Start With Power On
level.DLC3.useElectricSwitch = true;

// Electric Traps
level.DLC3.useElectricTraps = true;

// _zombiemode_weapons Variables
level.DLC3.usePandoraBoxLight = true;
level.DLC3.useChestPulls = true;
level.DLC3.useChestMoves = true;
level.DLC3.useWeaponSpawn = true;
level.DLC3.useGiveWeapon = true;

// _zombiemode_spawner Varibles
level.DLC3.riserZombiesGoToDoorsFirst = true;
level.DLC3.riserZombiesInActiveZonesOnly = true;
level.DLC3.assureNodes = true;

// _zombiemode_perks Variables
level.DLC3.perksNeedPowerOn = true;

// _zombiemode_devgui Variables
level.DLC3.powerSwitch = true;


/*--------------------
FUNCTION CALLS - PRE _Load
----------------------*/
level thread DLC3_threadCalls();

/*--------------------
ZOMBIE MODE
----------------------*/
[[level.DLC3.weapons]]();
[[level.DLC3.powerUps]]();
maps\_zombiemode::main();

/*--------------------
FUNCTION CALLS - POST _Load
----------------------*/
level.zone_manager_init_func = ::dlc3_zone_init;
level thread DLC3_threadCalls2();
}

dlc3_zone_init()
{

add_adjacent_zone( "initial_zone", "zone1", "enter_zone1" );
add_adjacent_zone( "zone1", "zone2", "enter_zone2" );
/*
=============
///ScriptDocBegin
"Name: add_adjacent_zone( <zone_1>, <zone_2>, <flag>, <one_way> )"
"Summary: Sets up adjacent zones."
"MandatoryArg: <zone_1>: Name of first Info_Volume"
"MandatoryArg: <zone_2>: Name of second Info_Volume"
"MandatoryArg: <flag>: Flag to be set to initiate zones"
"OptionalArg: <one_way>: Make <zone_1> adjacent to <zone_2>. Defaults to false."
"Example: add_adjacent_zone( "receiver_zone", "outside_east_zone", "enter_outside_east" );"
///ScriptDocEnd
=============
*/

// Outside East Door
//add_adjacent_zone( "receiver_zone", "outside_east_zone", "enter_outside_east" );

level.give_ammo = 0;
ammo_trigs = getentarray("give_ammo","targetname");
array_thread(ammo_trigs,::give_ammo);
}



give_ammo()
   {
   while(1)
   
   
      who = undefined;
      cost  = 1500;

      string = "Press &&1 to buy ammo [Cost: " + cost + "]";

      self sethintstring( string );
      self SetCursorHint( "HINT_NOICON" );
      self UseTriggerRequireLookAt();
      self waittill( "trigger", who );

      weapon = who GetCurrentWeapon();
      ammocount = who getammocount(weapon);
      clipcount = who getweaponammoclip(weapon);
      maxammo = weaponmaxammo(weapon);

      // UNCOMMENT TO MAKE RAY GUN & WUNDERWAFFE AMMO UNBUYABLE
      //if( weapon == "tesla_gun" || weapon == "ray_gun" )
      //{
      //   who iprintln( "You cannot buy ammo for this weapon" );
      //   level.give_ammo = 0;
      //}
      // UNCOMMENT TO MAKE RAY GUN & WUNDERWAFFE AMMO UNBUYABLE

      if( maxammo <= ammocount - clipcount )
      {
  continue;
      }

      if ( weapon != "fraggrenade" && weapon!= "stielhandgranate" && weapon != "molotov" && weapon != "mine_bouncing_betty" && weapon != "mortar_round" && weapon != "satchel_charge_new")
      {
         if( who.score > cost )
         {
            level.give_ammo = 1;
         }
         else
         {
            level.give_ammo = 0;
         }
      }

      if( level.give_ammo > 0 )
      {
         who givemaxammo( who GetCurrentWeapon() );
         who maps\_zombiemode_score::minus_to_player_score( cost );
         who playsound( "cha_ching" );
      }     
      else
      {
         who playsound( "no_cha_ching" );
      }
      wait(0.05);
  }
 
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
I forgot an opening bracket after the while() loop, the continue statement needs to be inside a loop, and the game does not recognise the loop. I allready changed the code in my post above, but i guess you copied it before that.

Use this function and it should work:

Code Snippet
Plaintext
give_ammo()
{
   while(1)
   {                                          //  <---- forgot this one
      who = undefined;
      cost  = 1500;

      string = "Press &&1 to buy ammo [Cost: " + cost + "]";

      self sethintstring( string );
      self SetCursorHint( "HINT_NOICON" );
      self UseTriggerRequireLookAt();
      self waittill( "trigger", who );

      weapon = who GetCurrentWeapon();
      ammocount = who getammocount(weapon);
      clipcount = who getweaponammoclip(weapon);
      maxammo = weaponmaxammo(weapon);

      // UNCOMMENT TO MAKE RAY GUN & WUNDERWAFFE AMMO UNBUYABLE
      //if( weapon == "tesla_gun" || weapon == "ray_gun" )
      //{
      //   who iprintln( "You cannot buy ammo for this weapon" );
      //   level.give_ammo = 0;
      //}
      // UNCOMMENT TO MAKE RAY GUN & WUNDERWAFFE AMMO UNBUYABLE

      if( maxammo <= ammocount - clipcount )
      {
         wait 0.05;
         continue;
      }

      if ( weapon != "fraggrenade" && weapon!= "stielhandgranate" && weapon != "molotov" && weapon != "mine_bouncing_betty" && weapon != "mortar_round" && weapon != "satchel_charge_new")
      {
         if( who.score > cost )
         {
            level.give_ammo = 1;
         }
         else
         {
            level.give_ammo = 0;
         }
      }

      if( level.give_ammo > 0 )
      {
         who givemaxammo( who GetCurrentWeapon() );
         who maps\_zombiemode_score::minus_to_player_score( cost );
         who playsound( "cha_ching" );
      }     
      else
      {
         who playsound( "no_cha_ching" );
      }
      wait(0.05);
  }
}
broken avatar :(
×
broken avatar :(
Location: gbUnited Kingdom
Date Registered: 3 January 2015
Last active: 7 years ago
Posts
10
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
supercush's Groups
supercush's Contact & Social Links
I forgot an opening bracket after the while() loop, the continue statement needs to be inside a loop, and the game does not recognise the loop. I allready changed the code in my post above, but i guess you copied it before that.

Use this function and it should work:

Code Snippet
Plaintext
give_ammo()
{
   while(1)
   {                                          //  <---- forgot this one
      who = undefined;
      cost  = 1500;

      string = "Press &&1 to buy ammo [Cost: " + cost + "]";

      self sethintstring( string );
      self SetCursorHint( "HINT_NOICON" );
      self UseTriggerRequireLookAt();
      self waittill( "trigger", who );

      weapon = who GetCurrentWeapon();
      ammocount = who getammocount(weapon);
      clipcount = who getweaponammoclip(weapon);
      maxammo = weaponmaxammo(weapon);

      // UNCOMMENT TO MAKE RAY GUN & WUNDERWAFFE AMMO UNBUYABLE
      //if( weapon == "tesla_gun" || weapon == "ray_gun" )
      //{
      //   who iprintln( "You cannot buy ammo for this weapon" );
      //   level.give_ammo = 0;
      //}
      // UNCOMMENT TO MAKE RAY GUN & WUNDERWAFFE AMMO UNBUYABLE

      if( maxammo <= ammocount - clipcount )
      {
         wait 0.05;
         continue;
      }

      if ( weapon != "fraggrenade" && weapon!= "stielhandgranate" && weapon != "molotov" && weapon != "mine_bouncing_betty" && weapon != "mortar_round" && weapon != "satchel_charge_new")
      {
         if( who.score > cost )
         {
            level.give_ammo = 1;
         }
         else
         {
            level.give_ammo = 0;
         }
      }

      if( level.give_ammo > 0 )
      {
         who givemaxammo( who GetCurrentWeapon() );
         who maps\_zombiemode_score::minus_to_player_score( cost );
         who playsound( "cha_ching" );
      }     
      else
      {
         who playsound( "no_cha_ching" );
      }
      wait(0.05);
  }
}

getting another error, which on the line 196 is the "Continue;"  any ideas?


broken avatar :(
×
broken avatar :(
Location: it
Date Registered: 5 September 2014
Last active: 3 years ago
Posts
282
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
My Contact & Social Links
More
Personal Quote
I belive purple is getting me...
×
IperBreach86's Groups
IperBreach86's Contact & Social LinksIperBreach86
getting another error, which on the line 196 is the "Continue;"  any ideas?



Try replacing "continue;" with a "return;"
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
getting another error, which on the line 196 is the "Continue;"  any ideas?




You should copy blunts function and replace yours. Your also missing another end bracket at the end of your function that you posted.

Try replacing "continue;" with a "return;"

He does not want to return. That will leave the function, which is not thread again.
Last Edit: July 06, 2016, 09:23:53 pm by MakeCents
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Signature
If you want scripts / features made for you, then contact me by PM or email / skype etc
it will cost you tho so if you have no intention of reciprocating don't even waste my time ;)
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
He also had the function itself inside another function rather than the "call" to the function
broken avatar :(
×
broken avatar :(
Location: gbUnited Kingdom
Date Registered: 3 January 2015
Last active: 7 years ago
Posts
10
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
supercush's Groups
supercush's Contact & Social Links
You should copy blunts function and replace yours. Your also missing another end bracket at the end of your function that you posted.

He does not want to return. That will leave the function, which is not thread again.

Yeah I did copy and it gave me a error with the continue;

 
Loading ...