Skip to content
  • 0 Unread 0
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Collapse

Plutonium

  1. Home
  2. WAW Modding Releases & Resources
  3. Timer for Power-Ups

Timer for Power-Ups

Scheduled Pinned Locked Moved WAW Modding Releases & Resources
1 Posts 1 Posters 118 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Darkness105undefined Offline
    Darkness105undefined Offline
    Darkness105
    wrote last edited by
    #1
    #include maps\_utility;
    #include common_scripts\utility;
    #include maps\_zombiemode_utility;
    
    init()
    {
        map_name = getdvar("mapname");
        
        if(map_name != "nazi_zombie_prototype")
        {
            thread powerup_timer_overlay();
            iprintln("Powerup timers enabled on: " + map_name);
        }
        else
        {
            iprintln("Powerup timers disabled on Nacht der Untoten");
        }
    }
    
    powerup_timer_overlay()
    {
        level.powerup_timer_hud = [];
        level endon ("disconnect");
    
        for(i = 0; i < 2; i++)
        {
            level.powerup_timer_hud[i] = create_simple_hud();
            level.powerup_timer_hud[i].foreground = true; 
            level.powerup_timer_hud[i].sort = 3; 
            level.powerup_timer_hud[i].hidewheninmenu = false; 
            level.powerup_timer_hud[i].alignX = "center"; 
            level.powerup_timer_hud[i].alignY = "bottom";
            level.powerup_timer_hud[i].horzAlign = "center"; 
            level.powerup_timer_hud[i].vertAlign = "bottom";
            level.powerup_timer_hud[i].x = -32 + (i * 15); 
            level.powerup_timer_hud[i].y = level.powerup_timer_hud[i].y - 20; 
            level.powerup_timer_hud[i].alpha = 1;
            level.powerup_timer_hud[i].fontscale = 1.2;
            level.powerup_timer_hud[i].glowcolor = (1, 1, 1);
            level.powerup_timer_hud[i].glowalpha = 0.8;
            level.powerup_timer_hud[i].archived = true;
            level.powerup_timer_hud[i].alpha = 0;
        }
    
        while(true)
        {
            if(level.zombie_vars["zombie_powerup_point_doubler_on"] == true)
            {
                time_left = int(level.zombie_vars["zombie_powerup_point_doubler_time"] + 0.5);
                level.powerup_timer_hud[0] SetValue(time_left);
                level.powerup_timer_hud[0].alpha = 1;
            }
            else
            {
                level.powerup_timer_hud[0].alpha = 0;
            }
    
            if(level.zombie_vars["zombie_powerup_insta_kill_on"] == true)
            {
                time_left = int(level.zombie_vars["zombie_powerup_insta_kill_time"] + 0.5);
                level.powerup_timer_hud[1] SetValue(time_left);
                level.powerup_timer_hud[1].alpha = 1;
            }
            else
            {
                level.powerup_timer_hud[1].alpha = 0;
            }
    
            if(level.zombie_vars["zombie_powerup_point_doubler_on"] == true && level.zombie_vars["zombie_powerup_insta_kill_on"] == true)
            {
                level.powerup_timer_hud[0].x = -24;
                level.powerup_timer_hud[1].x = 24;
            }
            else if(level.zombie_vars["zombie_powerup_point_doubler_on"] == true && level.zombie_vars["zombie_powerup_insta_kill_on"] == false)
            {
                level.powerup_timer_hud[0].x = 0;
            }
            else if(level.zombie_vars["zombie_powerup_insta_kill_on"] == true && level.zombie_vars["zombie_powerup_point_doubler_on"] == false)
            { 
                level.powerup_timer_hud[1].x = 0;
            }
    
            wait(0.05);
        }
    }
    

    This code adds a timer to the bonus if you need to know exactly what time it ends.

    (only Insta-kill and Double Points are displayed.)

    (All maps will display a timer, except Nacht der Untoten, because it already includes)

    Tutorial

    1. Go to the plutonium folder C:\Users\YOU_NAME\AppData\Local\Plutonium\storage\t4\raw\scripts\sp
    2. Create a text document and name it whatever you want, but replace the extension of this .txt with this .gsc
    3. We enter my code in the notepad
    4. And go in and check it's done
    1 Reply Last reply
    0

    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

    With your input, this post could be even better 💗

    Register Login
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

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