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

Plutonium

  1. Home
  2. BO2 Modding Support & Discussion
  3. can someone please help me with this?

can someone please help me with this?

Scheduled Pinned Locked Moved BO2 Modding Support & Discussion
12 Posts 3 Posters 267 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.
  • AutoTopGRundefined Offline
    AutoTopGRundefined Offline
    AutoTopGR
    wrote on last edited by
    #1

    #include "maps/mp/_utility";
    #include "maps/mp/_hud_util";
    #include "maps/mp/_createfx";

    init()
    {
    level thread OnPlayerConnected();
    }

    OnPlayerConnected()
    {
    for(;;)
    {
    level waittill("connected", player);

        if (isDefined(player.pers["isBot"]) && player.pers["isBot"])
        {
            continue;
        }
    
        player thread DisplayKillPoints();
    }
    

    }

    DisplayKillPoints()
    {
    self endon ("disconnect");
    level endon("game_ended");

    for(;;)
    {
        player waittill("killed_zombie");
        if(player.killed_zombie_by_headshot)
        {
            createFx( "blood_splash_headshot", player.origin, player.angles, player );
            createFontString( "objective", "hudsmall", 2.2, player.origin + (0,0,80), (1,1,0) ) + "+150";
            hudSetElementText( player, "objective", "+150" );
        }
        else
        {
            createFx( "blood_splash_zombie", player.origin, player.angles );
            createFontString( "objective", "hudsmall", 2.2, player.origin + (0,0,80), (1,1,0) ) + "+100";
            hudSetElementText( player, "objective", "+100" );
        }
    }
    

    }

    JezuzLizardundefined 1 Reply Last reply
    0
    • AutoTopGRundefined Offline
      AutoTopGRundefined Offline
      AutoTopGR
      wrote on last edited by
      #2

      it gives me an error in an unrelated line when i try to compile it and i don;t understand why

      chicken emojiundefined 1 Reply Last reply
      0
      • AutoTopGRundefined AutoTopGR

        it gives me an error in an unrelated line when i try to compile it and i don;t understand why

        chicken emojiundefined Offline
        chicken emojiundefined Offline
        chicken emoji
        wrote on last edited by
        #3

        AutoTopGR the path of the included files isnt supposed to be a string thats why you probably get error in line 0 or do you get another error?

        AutoTopGRundefined 1 Reply Last reply
        0
        • chicken emojiundefined chicken emoji

          AutoTopGR the path of the included files isnt supposed to be a string thats why you probably get error in line 0 or do you get another error?

          AutoTopGRundefined Offline
          AutoTopGRundefined Offline
          AutoTopGR
          wrote on last edited by
          #4

          chicken emoji so i have to remove #symbol?

          chicken emojiundefined 1 Reply Last reply
          0
          • AutoTopGRundefined AutoTopGR

            chicken emoji so i have to remove #symbol?

            chicken emojiundefined Offline
            chicken emojiundefined Offline
            chicken emoji
            wrote on last edited by chicken emoji
            #5

            AutoTopGR what i mean is without the " so instead of

            #include "maps/mp/_utility";
            

            try

            #include maps/mp/_utility;
            
            AutoTopGRundefined 1 Reply Last reply
            0
            • chicken emojiundefined chicken emoji

              AutoTopGR what i mean is without the " so instead of

              #include "maps/mp/_utility";
              

              try

              #include maps/mp/_utility;
              
              AutoTopGRundefined Offline
              AutoTopGRundefined Offline
              AutoTopGR
              wrote on last edited by
              #6

              chicken emoji thanks it fixed the compiling problem but when i try to start a zombies map i get these **** Unresolved external : "createfx" with 4 parameters in "main" at line 1 ****
              **** Unresolved external : "createfontstring" with 5 parameters in "main" at lines 1,1 ****
              **** Unresolved external : "hudsetelementtext" with 3 parameters in "main" at l any ideas?

              chicken emojiundefined 1 Reply Last reply
              0
              • AutoTopGRundefined AutoTopGR

                chicken emoji thanks it fixed the compiling problem but when i try to start a zombies map i get these **** Unresolved external : "createfx" with 4 parameters in "main" at line 1 ****
                **** Unresolved external : "createfontstring" with 5 parameters in "main" at lines 1,1 ****
                **** Unresolved external : "hudsetelementtext" with 3 parameters in "main" at l any ideas?

                chicken emojiundefined Offline
                chicken emojiundefined Offline
                chicken emoji
                wrote on last edited by chicken emoji
                #7

                AutoTopGR To use createfontstring you have to include maps/mp/gametypes_zm/_hud_util. For hudsetelementtext i cant find a definition where do you have it from or did you make it yourself and what is it supposed to do?

                AutoTopGRundefined 1 Reply Last reply
                0
                • chicken emojiundefined chicken emoji

                  AutoTopGR To use createfontstring you have to include maps/mp/gametypes_zm/_hud_util. For hudsetelementtext i cant find a definition where do you have it from or did you make it yourself and what is it supposed to do?

                  AutoTopGRundefined Offline
                  AutoTopGRundefined Offline
                  AutoTopGR
                  wrote on last edited by
                  #8

                  chicken emoji i made it my self and it supposed to write in the center of the screen +100 if i kill a zombie and +150 if i kill it with headshot

                  chicken emojiundefined 1 Reply Last reply
                  0
                  • AutoTopGRundefined AutoTopGR

                    chicken emoji i made it my self and it supposed to write in the center of the screen +100 if i kill a zombie and +150 if i kill it with headshot

                    chicken emojiundefined Offline
                    chicken emojiundefined Offline
                    chicken emoji
                    wrote on last edited by
                    #9

                    AutoTopGR then you have to write the definition in this file or include the file that has the definitio

                    AutoTopGRundefined 1 Reply Last reply
                    0
                    • chicken emojiundefined chicken emoji

                      AutoTopGR then you have to write the definition in this file or include the file that has the definitio

                      AutoTopGRundefined Offline
                      AutoTopGRundefined Offline
                      AutoTopGR
                      wrote on last edited by
                      #10

                      chicken emoji what do you mean when you say definition?

                      chicken emojiundefined 1 Reply Last reply
                      0
                      • AutoTopGRundefined AutoTopGR

                        chicken emoji what do you mean when you say definition?

                        chicken emojiundefined Offline
                        chicken emojiundefined Offline
                        chicken emoji
                        wrote on last edited by chicken emoji
                        #11

                        AutoTopGR The same thing you did with DisplayKillPoints is you define the function which is this part

                        DisplayKillPoints()
                        {
                        self endon ("disconnect");
                        level endon("game_ended");
                        
                        for(;;)
                        {
                            player waittill("killed_zombie");
                            if(player.killed_zombie_by_headshot)
                            {
                                createFx( "blood_splash_headshot", player.origin, player.angles, player );
                                createFontString( "objective", "hudsmall", 2.2, player.origin + (0,0,80), (1,1,0) ) + "+150";
                                hudSetElementText( player, "objective", "+150" );
                            }
                            else
                            {
                                createFx( "blood_splash_zombie", player.origin, player.angles );
                                createFontString( "objective", "hudsmall", 2.2, player.origin + (0,0,80), (1,1,0) ) + "+100";
                                hudSetElementText( player, "objective", "+100" );
                            }
                        }
                        
                        

                        and then you execute it like this

                        player thread DisplayKillPoints();
                        

                        with hudsetelementtext you try to execute it like this

                        hudSetElementText( player, "objective", "+100" );
                        

                        but there is no definition like this

                        hudSetElementText(){
                            //Things this function is supposed to do
                        }
                        

                        also createFontString only uses 2 parameters which are font and scale so you should change it to createFontString( "objective", "hudsmall" );.

                        if you want to change the position or what it dispalys you can do this

                        killpointshud = createFontString( "objective", "hudsmall" );
                        

                        instead of just

                        createFontString( "objective", "hudsmall" );
                        

                        and then change the position of the hud element like this

                        killpointshud setpoint( "CENTER", "CENTER", 0, 0 );
                        

                        or set what it displays using

                        killpointshud setText(text);
                        

                        or

                        killpointshud setValue(value);
                        

                        You should also change all the player in DisplayKillPoints to self because player is undefined in this context what i mean is for example change this

                        player waittill("killed_zombie");
                        

                        to

                        self waittill("killed_zombie");
                        

                        but only do this in the DisplayKillPoints function

                        1 Reply Last reply
                        0
                        • AutoTopGRundefined AutoTopGR

                          #include "maps/mp/_utility";
                          #include "maps/mp/_hud_util";
                          #include "maps/mp/_createfx";

                          init()
                          {
                          level thread OnPlayerConnected();
                          }

                          OnPlayerConnected()
                          {
                          for(;;)
                          {
                          level waittill("connected", player);

                              if (isDefined(player.pers["isBot"]) && player.pers["isBot"])
                              {
                                  continue;
                              }
                          
                              player thread DisplayKillPoints();
                          }
                          

                          }

                          DisplayKillPoints()
                          {
                          self endon ("disconnect");
                          level endon("game_ended");

                          for(;;)
                          {
                              player waittill("killed_zombie");
                              if(player.killed_zombie_by_headshot)
                              {
                                  createFx( "blood_splash_headshot", player.origin, player.angles, player );
                                  createFontString( "objective", "hudsmall", 2.2, player.origin + (0,0,80), (1,1,0) ) + "+150";
                                  hudSetElementText( player, "objective", "+150" );
                              }
                              else
                              {
                                  createFx( "blood_splash_zombie", player.origin, player.angles );
                                  createFontString( "objective", "hudsmall", 2.2, player.origin + (0,0,80), (1,1,0) ) + "+100";
                                  hudSetElementText( player, "objective", "+100" );
                              }
                          }
                          

                          }

                          JezuzLizardundefined Offline
                          JezuzLizardundefined Offline
                          JezuzLizard
                          Plutonium Staff
                          wrote on last edited by
                          #12

                          AutoTopGR ChatGPT moment.

                          1 Reply Last reply
                          0
                          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
                          • Recent
                          • Tags
                          • Popular
                          • Users
                          • Groups
                          • Donate