Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Donate
Collapse

Plutonium

  1. Home
  2. BO2 Modding Support & Discussion
  3. help figure out whats wrong with my script code.

help figure out whats wrong with my script code.

Scheduled Pinned Locked Moved BO2 Modding Support & Discussion
3 Posts 3 Posters 640 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • LordCurtisundefined Offline
    LordCurtisundefined Offline
    LordCurtis
    wrote on last edited by LordCurtis
    #1

    everything is fine upto starting the server. can anyone look through the code and fix it or tell me how to myself?
    I get -
    "**** 2 script error(s):
    **** Unresolved external : "is_classic" with 0 parameters in "main" at line 1 ****
    **** Unresolved external : "give_start_weapon" with 1 parameters in "main" at line 1 ****
    "

    code_text
    /*
    *
    *    Creator : lordcurtis
    *    Project : zombies combo
    *    Mode : Zombies
    *     Date : 02:49:02 AM
    *
    */
    
    #include maps\mp_utility;
    #include common_scripts\utility;
    #include maps\mp\zombies_zm;
    #include maps\mp\zombies_zm_utility;
    #include maps\mp\gametypes_zm\_hud_util;
    #include maps\mp\gametypes_zm\_hud_message;
    #include maps\mp\_utility;
    
    init()
    {
    level.clientid = 0;
    level.perk_purchase_limit = 9;
    level thread onplayerconnect();
    level.givecustomloadout = ::givecustomloadout;
    thread gscrestart();
        thread setplayerstospectator();
        for(;;)
        {
            level waittill("connected", player);
            player thread [[level.givecustomcharacters]]();
        }
    }
    
    /*
        Name: gscrestart
        Namespace: _clientids
        Checksum: 0x9442E6E
        Offset: 0x204
        Size: 0x15
        Parameters: 0
        Flags: None
    */
    gscrestart()
    {
        level waittill("end_game");
        wait(20);
        map_restart(0);
    }
    
    /*
        Name: setplayerstospectator
        Namespace: _clientids
        Checksum: 0x68E1137B
        Offset: 0x21A
        Size: 0x57
        Parameters: 0
        Flags: None
    */
    setplayerstospectator()
    {
        level.no_end_game_check = 1;
        wait(3);
        players = get_players();
        for(i = 0; i < players.size; i++)
        {
            if(i == 0)
            {
                i++;
            }
            players[i] settospectator();
        }
        wait(5);
        spawnallplayers();
    }
    
    /*
        Name: settospectator
        Namespace: _clientids
        Checksum: 0x4E4AB9C1
        Offset: 0x272
        Size: 0x19
        Parameters: 0
        Flags: None
    */
    settospectator()
    {
        self.sessionstate = "spectator";
        if(isdefined(self.is_playing))
        {
            self.is_playing = 0;
        }
    }
       
    /*
        Name: spawnallplayers
        Namespace: _clientids
        Checksum: 0xB04EFB4B
        Offset: 0x28C
        Size: 0x8B
        Parameters: 0
        Flags: None
    */
    spawnallplayers()
    {
        players = get_players();
        for(i = 0; i < players.size; i++)
        {
            if(players[i].sessionstate == "spectator" && isdefined(players[i].spectator_respawn))
            {
                players[i] [[level.spawnplayer]]();
                if(level.script != "zm_tomb" || level.script != "zm_prison" || !is_classic())
                {
                    thread maps/mp/zombies/_zm::refresh_player_navcard_hud();
                }
            }
        }
        level.no_end_game_check = 0;
    }
    
    givecustomloadout( takeallweapons, alreadyspawned )
    {
        self giveweapon( "knife_zm" );
        self give_start_weapon(1);
        if ( level.round_number >= 5 && level.round_number < 10)
        {
            self giveWeapon( "fiveseven_zm" );
        }
        else if ( level.round_number >= 10 && level.round_number < 15)
        {
            self giveweapon( "tazer_knuckles_zm" );
            self giveWeapon( "ak74u_zm" );
        }
        else if ( level.round_number >= 15 && level.round_number < 20)
        {
            self giveweapon( "tazer_knuckles_zm" );
            self giveWeapon( "srm1216_upgraded_zm" );
            self maps/mp/zombies/_zm_perks::give_perk( "specialty_armorvest" );
        }
        else if ( level.round_number >= 20 && level.round_number < 25)
        {
            self giveweapon( "tazer_knuckles_zm" );
            self giveWeapon( "galil_zm" );
            self maps/mp/zombies/_zm_perks::give_perk( "specialty_armorvest" );    
        }
        else if ( level.round_number >= 25)
        {
            self giveweapon( "tazer_knuckles_zm" );
            self giveWeapon( "hamr_upgraded_zm" );
            self maps/mp/zombies/_zm_perks::give_perk( "specialty_armorvest" );
        }
    }
    
    onplayerconnect()
    {
    for ( ;; )
    {
    level waittill( "connecting", player );
    player.clientid = level.clientid;
    player thread onplayerspawned();
    level.clientid++;
    }
    }
    
    onplayerspawned()
    {
    level endon( "game_ended" );
    self endon( "disconnect" );
    
    for(;;)
    {
    self welcome();
    }
    }
    
    welcome()
    {
    self waittill( "spawned_player" );
    self maps/mp/zombies/_zm_perks::give_perk( "specialty_armorvest" );
    wait 7;
    self iprintln("^2" +self.name + "^7 , your perk limit has been removed");
    }
    
    JezuzLizardundefined 1 Reply Last reply
    0
    • Dss0undefined Offline
      Dss0undefined Offline
      Dss0 Plutonium Staff
      wrote on last edited by
      #2

      You made mistakes in your includes, there is no zombies_zm.gsc in maps/mp, it's in maps/mp/zombies, maps\mp_utility also doesn't exist.

      #include common_scripts\utility;
      #include maps\mp\zombies\_zm;
      #include maps\mp\zombies\_zm_utility;
      #include maps\mp\gametypes_zm\_hud_util;
      #include maps\mp\gametypes_zm\_hud_message;
      #include maps\mp\_utility;
      
      1 Reply Last reply
      0
      • JezuzLizardundefined Offline
        JezuzLizardundefined Offline
        JezuzLizard Plutonium Staff
        replied to LordCurtis on last edited by
        #3

        LordCurtis Another error is #include maps\mp\zombies_zm_utility; doesn't exist either its actually #include maps\mp\zombies\_zm_utility; both of your errors are caused by this include missing.

        Also it would appear you have used a decompiler to obtain some of my code even though its fully open sourced: https://github.com/JezuzLizard/Public-BO2-Mods/tree/master/MapRestartWorkaround

        Perhaps for future reference don't copy paste code without also double checking it and also try and see if you can find the original source for any given project since many projects posted on the forums generally include full source.

        1 Reply Last reply
        1

        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Donate