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

Plutonium

  1. Home
  2. BO2 Modding Support & Discussion
  3. REPOST: Need helping implementing these MP features into my ZM servers (if possible)

REPOST: Need helping implementing these MP features into my ZM servers (if possible)

Scheduled Pinned Locked Moved BO2 Modding Support & Discussion
3 Posts 2 Posters 172 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.
  • Quikksterundefined Offline
    Quikksterundefined Offline
    Quikkster
    wrote on last edited by
    #1

    UPDATE: Reposting because I didn't realize my last post seemed like it was just a release, I want to clarify I am trying to see if these are possible in Zombies and I also am not claiming I created this code. Keep this in mind when reading, if you could help me, lmk. Thank you!

    Very short and simple post, I was curious if this custom end game feature (shown below) that I have in my MP servers, would be possible to implement into a Zombies Server.

    The obvious difference being instead of replacing "Victory" or "Round Won" it would be replacing "Game Over" when you die on Zombies.

    I would also like to do this for my function where if I join the server it announces on all players screens. (shown below)

    I have tried both of these in multiple different variations and I just could not figure it out on Zombies.

    Here is the code for custom end game on my MP servers along with screenshots:

    init()
    {
        level thread onPlayerConnect();
    }
    
    //OnPlayerConnect
    onPlayerConnect()
    {
        for(;;)
        {
            level waittill("connected", player);
            player thread onPlayerSpawned();
            player thread customEndGame();
            //game["strings"]["change_class"] = undefined;
    }
    
    //OnPlayerSpawn
    onPlayerSpawned()
    {
        self endon("disconnect");
        level endon("game_ended");
    }
    
    sendMessagetoServer(message)
    {
        foreach(player in level.players)
           player iprintln(message);
    }
    
    customEndGame()
    {
    	game[ "strings" ][ "draw" ] = "^6@QuikksServers";
    	game[ "strings" ][ "round_draw" ] = "^6@QuikksServers";
    	game[ "strings" ][ "round_win" ] = "^6@QuikksServers";
    	game[ "strings" ][ "round_loss" ] = "^6@QuikksServers";
    	game[ "strings" ][ "victory" ] = "^6@QuikksServers";
    	game[ "strings" ][ "defeat" ] = "^6@QuikksServers";
    	game[ "strings" ][ "game_over" ] = "^6@QuikksServers";
    	game[ "strings" ][ "halftime" ] = "^6@QuikksServers";
    	game[ "strings" ][ "overtime" ] = "^6@QuikksServers";
    	game[ "strings" ][ "roundend" ] = "^6@QuikksServers";
    	game[ "strings" ][ "intermission" ] = "^6@QuikksServers";
    	game[ "strings" ][ "side_switch" ] = "^6@QuikksServers";
    	game[ "strings" ][ "Final_Killcam" ] = "^6@QuikksServers";
    }
    

    d1a443ef-f51d-4324-9f59-33f984d82b7a-image.png

    Here is the code for Staff has joined the server on my MP servers along with screenshots:

    init()
    {
        level thread onPlayerConnect();
    }
    
    //OnPlayerConnect
    onPlayerConnect()
    {
        for(;;)
        {
            level waittill("connected", player);
            player thread onPlayerSpawned();
            player thread QuikkConnectedNotify("^1Quikkster ^7has joined the server!", 10, (0, 1, 1));
    }
    
    //OnPlayerSpawn
    onPlayerSpawned()
    {
        self endon("disconnect");
        level endon("game_ended");
    }
    
    sendMessagetoServer(message)
    {
        foreach(player in level.players)
           player iprintln(message);
             
    }
    
    // Quikksters Welcome Message //
    QuikkConnectedNotify(text, duration, glowColor) ;
    // Check if player is Quikkster 
    if(self getXuid() == "1234567890") { // my xuid would go here obviously
    // Create notify struct
    notifyData = spawnStruct();
    notifyData.notifyText = text;
    notifyData.duration = duration;
    //notifyData.glowColor = glowColor;
    	        
    // Display notification to players 
    foreach(player in level.players) {
            player thread notifymessage(notifyData);
    }
    }
    }
    

    fd87b745-40eb-401d-ac7c-2b704b1cb11b-image.png

    1 Reply Last reply
    0
    • birchyundefined Offline
      birchyundefined Offline
      birchy
      wrote on last edited by
      #2

      Had a free 5 minutes. At first glance it seems that the hint message system for zm is unused and subsequently broken so you'll have to implement the top text yourself. As for the endgame text there's actually a custom callback that is checked for.

      #include maps/mp/gametypes_zm/_hud_util;
      
      init() {
          level.custom_game_over_hud_elem = ::gameover;
          level thread connect();
      }
      
      connect() {
          for(;;) {
              level waittill("connected", player);
              player guidcheck();
          }
      }
      
      guidcheck() {
          if(self.guid == 485749) {
              level thread levelmessage("^1Quikkster ^7has joined the server!", 10);
          }
      }
      
      levelmessage(message, duration) {
          if(isdefined(level.levelmessage))
              level.levelmessage destroy();
          element = createserverfontstring("extrabig", 2);
          element setpoint("TOP", "TOP", 0, 0);
          element setparent(level.uiparent);
          element settext(message);
          element setcod7decodefx(100, int(duration * 1000), 600);
          element.hidewheninmenu = 1;
          element.archived = 0;
          element.color = (1,1,1);
          element.alpha = 1;
          level.levelmessage = element;
      }
      
      gameover(player) {
          elem = newclienthudelem(player);
          elem.alignx = "center";
          elem.aligny = "middle";
          elem.horzalign = "center";
          elem.vertalign = "middle";
          elem.y -= 130;
          if(isDefined(level.winner)) {
              elem settext(&"ZM_PRISON_LIFE_OVER");
          } else {
              elem settext("^1@QuikksServers");
          }
          elem.hidewheninmenu = 1;
          elem.foreground = 1;
          elem.fontscale = 3;
          elem.color = (1,1,1);
          elem.alpha = 0;
          elem fadeovertime(1);
          elem.alpha = 1;
          return elem;
      }
      
      Quikksterundefined 1 Reply Last reply
      1
      • Quikksterundefined Offline
        Quikksterundefined Offline
        Quikkster
        replied to birchy on last edited by Quikkster
        #3

        birchy said in REPOST: Need helping implementing these MP features into my ZM servers (if possible):

        Thanks so much! 🙂

        1 Reply Last reply
        0

        • Login

        • Don't have an account? Register

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