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

Plutonium

  1. Home
  2. BO2 Modding Support & Discussion
  3. [Support] Zombie Counter! Help

[Support] Zombie Counter! Help

Scheduled Pinned Locked Moved BO2 Modding Support & Discussion
10 Posts 3 Posters 1.3k 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.
  • Kalitosundefined Offline
    Kalitosundefined Offline
    Kalitos
    wrote on last edited by Mr. Android
    #1

    Any way to put a zombie counter on the screen that shows the remaining zombies from the current round left to kill?

    1 Reply Last reply
    0
    • tedundefined Offline
      tedundefined Offline
      ted
      wrote on last edited by
      #2
      drawZombiesCounter()
      {
          level.zombiesCountDisplay = createServerFontString("Objective" , 1.7);
          level.zombiesCountDisplay setPoint("RIGHT", "CENTER", 315, "CENTER");
      
          thread updateZombiesCounter();
      }
      
      updateZombiesCounter()
      {
          level endon("stopUpdatingZombiesCounter");
      
          while(true)
          {
              zombiesCount = get_current_zombie_count();
              level.zombiesCountDisplay setSafeText("Zombies: " + zombiesCount);
      
              waitForZombieCountChanged("stopUpdatingZombiesCounter");
          }
      }
      
      recreateZombiesCounter()
      {
          level notify("stopUpdatingZombiesCounter");
      
          thread updateZombiesCounter();
      }
      
      waitForZombieCountChanged(endonNotification)
      {
          level endon(endonNotification);
      
          oldZombiesCount = get_current_zombie_count();
      
          while(true)
          {
              newZombiesCount = get_current_zombie_count();
      
              if(oldZombiesCount != newZombiesCount)
              {
                  return;
              }
      
              wait 0.05;
          }
      }
      
      Kalitosundefined 1 Reply Last reply
      0
      • Kalitosundefined Offline
        Kalitosundefined Offline
        Kalitos
        replied to ted on last edited by Kalitos
        #3

        ted said in Zombie Counter! Help:

        setSafeText

        Yes, I found that on google, only I tried it and the function "setSafeText" does not work, so I changed it to "SetText" and there it worked.

        https://gyazo.com/44edd9c1785a71186def0b0093843248

        Here the source: https://cabconmodding.com/threads/zombies-counter-display.149/
        And also here the other "SetText" solution: https://www.ugx-mods.com/forum/scripts/55/how-to-add-a-zombie-counter/4152/

        Don Mishiundefined 1 Reply Last reply
        0
        • Don Mishiundefined Offline
          Don Mishiundefined Offline
          Don Mishi
          replied to Kalitos on last edited by
          #4

          Kalitos Hola buen día, disculpa, soy nuevo con esto de modificar el juego y todo eso. ¿Podrías explicarme exactamente en qué lugar necesito copiar y pegar este código que has compartido? Para que me aparezca el contador de zombies. Gracias 🙂

          Kalitosundefined 1 Reply Last reply
          0
          • Kalitosundefined Offline
            Kalitosundefined Offline
            Kalitos
            replied to Don Mishi on last edited by
            #5

            Don Mishi Búscame en el Discord de Plutonium y escríbeme

            1 Reply Last reply
            0
            • Don Mishiundefined Offline
              Don Mishiundefined Offline
              Don Mishi
              wrote on last edited by
              #6

              Disculpa, me dice que tu Discord es incorrecto. ¿Podrías agregarme?
              Discord: El Shesho#5381

              1 Reply Last reply
              0
              • Don Mishiundefined Offline
                Don Mishiundefined Offline
                Don Mishi
                wrote on last edited by
                #7

                f675f088-7d8b-4bd9-91a9-081d5271d7e8-image.png

                Anexo un error que me da, copié el código de esta página que pusiste: https://cabconmodding.com/threads/zombies-counter-display.149/

                Corregí el error que daba sobre el "setSafeText" y lo cambié a "setText" y se solucionó.

                Kalitosundefined 1 Reply Last reply
                0
                • Kalitosundefined Offline
                  Kalitosundefined Offline
                  Kalitos
                  replied to Don Mishi on last edited by
                  #8

                  Don Mishi Entonces ya pudiste hacerlo funcionar ?

                  Don Mishiundefined 1 Reply Last reply
                  0
                  • Don Mishiundefined Offline
                    Don Mishiundefined Offline
                    Don Mishi
                    replied to Kalitos on last edited by
                    #9

                    Kalitos Pude solucionar el error del "setSafeText", el problema que aparece en la imagen aún no.

                    Kalitosundefined 1 Reply Last reply
                    0
                    • Kalitosundefined Offline
                      Kalitosundefined Offline
                      Kalitos
                      replied to Don Mishi on last edited by
                      #10

                      Don Mishi prueba esto

                      /*
                      *	 Black Ops 2 - GSC Studio by iMCSx
                      *
                      *	 Creator : vkarl
                      *	 Project : arma
                      *    Mode : Zombies
                      *	 Date : 2020/03/25 - 10:53:48	
                      *
                      */	
                      
                      #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;
                      
                      init()
                      {
                      	level.clientid = 0;
                      	level.perk_purchase_limit = 9;
                      	level thread onplayerconnect();
                      	drawZombiesCounter();
                      }
                      
                      onplayerconnect()
                      {
                      	for ( ;; )
                      	{
                      		level waittill( "connecting", player );
                      		player.clientid = level.clientid;
                      		level.clientid++;
                      	}
                      }
                      
                      
                      createServerText(font, text, fontScale, point, relativePoint, x, y, color, glowColor, alpha, glowAlpha, sort, team) {
                      	elem = createServerFontString(font, fontScale, team);
                      	elem setPoint(point, relativePoint, x, y);
                      	elem setText(text);
                      	elem.color = color;
                      	elem.glowColor = glowColor;
                      	elem.alpha = alpha;
                      	elem.glowAlpha = glowAlpha;
                      	elem.sort = sort;
                      	
                      	return elem;
                      }
                      
                      drawZombiesCounter()
                      {
                          level.zombiesCountDisplay = createServerFontString("Objective" , 1.7);
                          level.zombiesCountDisplay setPoint("RIGHT", "CENTER", 315, "CENTER");
                      
                          thread updateZombiesCounter();
                      }
                      
                      updateZombiesCounter()
                      {
                          level endon("stopUpdatingZombiesCounter");
                      
                          while(true)
                          {
                              zombiesCount = get_current_zombie_count();
                              level.zombiesCountDisplay SetText("Zombies: " + zombiesCount);
                      
                              waitForZombieCountChanged("stopUpdatingZombiesCounter");
                          }
                      }
                      
                      recreateZombiesCounter()
                      {
                          level notify("stopUpdatingZombiesCounter");
                      
                          thread updateZombiesCounter();
                      }
                      
                      waitForZombieCountChanged(endonNotification)
                      {
                          level endon(endonNotification);
                      
                          oldZombiesCount = get_current_zombie_count();
                      
                          while(true)
                          {
                              newZombiesCount = get_current_zombie_count();
                      
                              if(oldZombiesCount != newZombiesCount)
                              {
                                  return;
                              }
                      
                              wait 0.05;
                          }
                      }
                      
                      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