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 */
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();
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( 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" ); }
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
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 pmI 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 */
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();
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 + "]";
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
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();
/*-------------------- 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" );
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
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 + "]";
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
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 + "]";
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 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