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

Plutonium

Eizekielsundefined

Eizekiels

@Eizekiels
About
Posts
10
Topics
4
Shares
0
Groups
0
Followers
4
Following
0

Posts

Recent Best Controversial

  • Rank System From My Z-tavern Simpled
    Eizekielsundefined Eizekiels

    Rank System Code Explanation

    1๏ธโƒฃ ๐Ÿ”ง System Initialization

    • Defines storage paths for balance, rank, and rank colors.
    • Checks if the directories exist; if not, creates them automatically.
    • Binds chat commands (.rank, .rankup) and sets up player event handlers.

    2๏ธโƒฃ ๐Ÿ’ฌ Handling Player Commands

    • .rank โ†’ Displays current rank with a unique color.
    • .rankup โ†’ Checks if the player has enough money, upgrades their rank, and displays the new rank along with the next rankโ€™s price.

    3๏ธโƒฃ ๐Ÿ› ๏ธ Player Spawn Event

    • When a player spawns, a log message appears to track their progress.

    4๏ธโƒฃ ๐Ÿ“‚ File Management

    • Rank and balance data are stored in files using getGuid(), ensuring each player has a unique file.

    5๏ธโƒฃ ๐Ÿ’ฐ Fetching & Managing Player Balance

    • Retrieves the current balance from the file. If the file is missing or corrupted, it defaults to 100 credits.
    • Updates the balance whenever a rank-up happens.

    6๏ธโƒฃ ๐Ÿ† Fetching & Updating Player Rank

    • Retrieves the playerโ€™s current rank from their file, defaulting to "A" if the file doesnโ€™t exist.
    • When ranking up, the system updates the rank file and notifies the player.

    7๏ธโƒฃ ๐Ÿ“Š Displaying Rank Information

    • When typing .rank, the script shows the playerโ€™s current rank, its color, and the next rankโ€™s cost in an aesthetically pleasing format.

    8๏ธโƒฃ ๐Ÿ“ˆ Ranking Up System

    • When using .rankup:
      ๐Ÿ”น Checks if the player has enough money to rank up.
      ๐Ÿ”น Deducts the required amount from their balance.
      ๐Ÿ”น Updates the player's rank in both files and the game.
      ๐Ÿ”น Displays a confirmation message with the new rank and next rank price.

    9๏ธโƒฃ ๐ŸŽจ Rank Progression & Colors

    • Each rank has a unique color, ensuring better visual clarity.
    • The final rank (-X-) costs 6 billion to achieve.

    ๐Ÿ”น This system ensures a smooth and dynamic ranking process for players, allowing seamless progression with stored data!

    Code : ```
    #include maps\mp_utility;
    #include common_scripts\utility;
    #include maps\mp\zombies_zm_utility;

    init()
    {
    level.bank_folder = "D:\bo2 ztavern town\storage\t6\bank";
    level.rank_folder = "D:\bo2 ztavern town\storage\t6\tag";
    level.color_folder = "D:\bo2 ztavern town\storage\t6\tagColor";

    if (!directoryExists(level.bank_folder))
        createDirectory(level.bank_folder);
    
    if (!directoryExists(level.rank_folder))
        createDirectory(level.rank_folder);
    
    if (!directoryExists(level.color_folder))
        createDirectory(level.color_folder);
    
    onPlayerSay(::player_say);
    level.onPlayerSpawned = ::onPlayerSpawned;
    

    }

    player_say(message, mode)
    {
    message = toLower(message);

    if (message == ".rank")
    {
        self display_rank();
        return false;
    }
    else if (message == ".rankup")
    {
        self rank_up();
        return false;
    }
    
    return true;
    

    }

    onPlayerSpawned()
    {
    self endon("disconnect");
    self waittill("spawned_player");

    print(va("๐Ÿ› ๏ธ %s has spawned. Checking for available purchases...", self.name));
    

    }

    get_rank_filename() { return level.rank_folder + "\" + self getGuid() + ".txt"; }
    get_bank_filename() { return level.bank_folder + "\" + self getGuid() + ".txt"; }

    get_balance()
    {
    filename = get_bank_filename();
    if (fileExists(filename))
    {
    balance_str = readFile(filename);
    return balance_str ? parseInt(balance_str) : 100; // Default balance is 100 if file doesn't exist or invalid
    }
    return 100; // Default balance if no file exists
    }

    set_balance(new_balance)
    {
    filename = get_bank_filename();
    writeFile(filename, new_balance);
    }

    get_rank()
    {
    filename = get_rank_filename();
    return fileExists(filename) ? readFile(filename) : "A"; // Default rank is A if file doesn't exist
    }

    set_rank(new_rank)
    {
    filename = get_rank_filename();
    writeFile(filename, new_rank);
    }

    display_rank()
    {
    rank = self get_rank();
    self tell(va("Your current rank: %s", rank));

    next_rank = get_next_rank(rank);
    if (next_rank != "")
    {
        next_price = get_rank_price(next_rank);
        self tell(va("Next rank: %s | Price: %d", next_rank, next_price));
    }
    else
    {
        self tell("^1You have reached the highest rank!");
    }
    

    }

    rank_up()
    {
    rank = self get_rank();
    next_rank = get_next_rank(rank);

    if (next_rank == "")
    {
        self tell("^1You are already at the highest rank!");
        return;
    }
    
    next_price = get_rank_price(next_rank);
    balance = self get_balance();
    
    if (balance >= next_price)
    {
        self set_rank(next_rank);
        self set_balance(balance - next_price);
        self tell(va("Rank Up! New Rank: %s | Remaining Balance: %d", next_rank, balance - next_price));
    }
    else
    {
        self tell("^1You don't have enough money to rank up!");
    }
    

    }

    get_next_rank(current_rank)
    {
    switch (current_rank)
    {
    case "A": return "B";
    case "B": return "C";
    case "C": return "D";
    case "D": return "E";
    case "E": return "F";
    case "F": return "G";
    case "G": return "H";
    case "H": return "S";
    case "S": return "SS";
    case "SS": return "SSS";
    case "SSS": return "V";
    case "V": return "IV";
    case "IV": return "IIV";
    case "IIV": return "IIIV";
    case "IIIV": return "I";
    case "I": return "II";
    case "II": return "III";
    case "III": return "IX";
    case "IX": return "IIX";
    case "IIX": return "IIIX";
    case "IIIX": return "-X-"; // Max rank
    default: return "";
    }
    }

    get_rank_price(rank)
    {
    switch (rank)
    {
    case "A": return 1000;
    case "B": return 5000;
    case "C": return 15000;
    case "D": return 20000;
    case "E": return 45000;
    case "F": return 60000;
    case "G": return 120000;
    case "H": return 500000;
    case "S": return 1000000;
    case "SS": return 2000000;
    case "SSS": return 3000000;
    case "V": return 4000000;
    case "IV": return 5000000;
    case "IIV": return 10000000;
    case "IIIV": return 15000000;
    case "I": return 20000000;
    case "II": return 25000000;
    case "III": return 30000000;
    case "IX": return 40000000;
    case "IIX": return 50000000;
    case "IIIX": return 100000000;
    case "-X-": return 6000000000; // Max rank price (6 billion)
    default: return 0;
    }
    }

    Note : it needs this plugin to work (t6-gsc-utils)
    Note : This code old version from my rank system it is the first ranking system.
    Note : The code have some bugs.
    I cannot share the full code because it is private for my Z-Tavern server.
    BO2 Modding Releases & Resources

  • ๐Ÿ”ฅBO2 Zombies Plutonium โ€“ Custom Weapon Drop System ๐Ÿ”ฅ
    Eizekielsundefined Eizekiels

    Ever wished you could drop weapons in Black Ops 2 Zombies like in multiplayer? Now you can! ๐ŸŽฎ๐Ÿ”ซ This script introduces a custom weapon dropping system that lets players drop their current weapon onto the ground, making gameplay more dynamic and strategic. Whether you're sharing weapons with teammates or simply discarding an unwanted gun, this script gives you full control!

    ๐Ÿš€ How to Use the Code?
    This script monitors a custom DVAR ("drop") and executes the drop when a valid request is detected.
    [```
    #include common_scripts\utility;
    #include maps\mp_utility;
    #include maps\mp\gametypes_zm_weapon_utils;
    #include maps\mp\gametypes_zm_weaponobjects;
    #include maps\mp_sticky_grenade;
    #include maps\mp_bb;
    #include maps\mp\gametypes_zm_weapons;
    #include maps\mp_challenges;
    #include maps\mp\zombies_zm_pers_upgrades_functions;
    #include maps\mp\gametypes_zm_globallogic_utils;
    #include maps\mp\gametypes_zm_shellshock;
    #include maps\mp\gametypes_zm_gameobjects;

    main()
    {
    setDvar("drop", "0");
    replaceFunc(maps\mp\gametypes_zm_weapons::dropweapontoground, ::dropweapon);
    }

    init()
    {
    level thread dropPlayerWeapon();
    }

    dropPlayerWeapon()
    {
    level endon("game_ended");
    for(;;)
    {
    if (getDvar("drop") != "0")
    {
    drop = strTok(getDvar("drop"), ";");
    setDvar("drop", "0");
    getPlayerByGuid(drop[0]) dropweapon(getPlayerByGuid(drop[0]) GetCurrentWeapon());
    iPrintLn("^5" + getPlayerByGuid(drop[0]).name + "^7 dropped a ^5weapon^7 on the ground!");
    }
    wait 0.1;
    }
    }
    getPlayerByGuid(guid) {
    for (i = 0; i < level.players.size; i++) {
    if (isAlive(level.players[i]) && int(level.players[i] getGuid()) == int(guid)) {
    return level.players[i];
    }
    }
    return false;
    }

    dropweapon(weapon)
    {
    if ( !isdefined( weapon ) )
    {
    /#
    if ( getdvar( _hash_8F7FC88 ) == "1" )
    println( "didn't drop weapon: not defined" );
    #/
    return;
    }

    if ( weapon == "none" )
    {
    

    /#
    if ( getdvar( _hash_8F7FC88 ) == "1" )
    println( "didn't drop weapon: weapon == none" );
    #/
    return;
    }

    if ( !self hasweapon( weapon ) )
    {
    

    /#
    if ( getdvar( _hash_8F7FC88 ) == "1" )
    println( "didn't drop weapon: don't have it anymore (" + weapon + ")" );
    #/
    return;
    }

    if ( !self anyammoforweaponmodes( weapon ) )
    {
    

    /#
    if ( getdvar( _hash_8F7FC88 ) == "1" )
    println( "didn't drop weapon: no ammo for weapon modes" );
    #/
    switch ( weapon )
    {
    case "mp40_blinged_mp":
    case "minigun_mp":
    case "m32_mp":
    case "m220_tow_mp":
    case "m202_flash_mp":
    self takeweapon( weapon );
    break;
    default:
    break;
    }

        return;
    }
    
    
    clipammo = self getweaponammoclip( weapon );
    stockammo = self getweaponammostock( weapon );
    clip_and_stock_ammo = clipammo + stockammo;
    
    if ( !clip_and_stock_ammo )
    {
    

    /#
    if ( getdvar( _hash_8F7FC88 ) == "1" )
    println( "didn't drop weapon: no ammo" );
    #/
    return;
    }

    stockmax = weaponmaxammo( weapon );
    
    if ( stockammo > stockmax )
        stockammo = stockmax;
    
    item = self dropitem( weapon );
    

    /#
    if ( getdvar( _hash_8F7FC88 ) == "1" )
    println( "dropped weapon: " + weapon );
    #/
    droplimitedweapon( weapon, self, item );
    item itemweaponsetammo( clipammo, stockammo );
    item.owner = self;
    item thread watchpickup();
    item thread deletepickupafterawhile();

    }

    
    ๐Ÿ“Œ Steps to Use:
    Add this script to your GSC scripts folder in your server.
    In the game, use the command:
    sql
    Copy code
    .drop
    This will make the player drop their currently equipped weapon on the ground!
    ๐Ÿ† Features
    โœ… Full control over weapon dropping ๐ŸŽฎ
    โœ… Easily enable or disable the feature via DVAR ๐Ÿ”„
    โœ… Ensures the player has ammo before dropping ๐Ÿ”ซ
    โœ… Prevents dropping certain weapons (e.g., Minigun) ๐Ÿšซ
    โœ… Sends a message when a weapon is dropped for clarity ๐Ÿ“
    BO2 Modding Releases & Resources
  • 1 / 1
  • Login

  • Don't have an account? Register

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