1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Answered Trying to make a script that gives points when you press a button, having trouble printing a message

Discussion in 'Call of Duty: Black Ops 3 Answered Questions' started by Collie, Nov 17, 2016.

  1. Collie

    Collie Member

    9
    12
    3
    Credits:
    74
    So I'm trying to add a script that prints to the screen a message saying that you have to press a button to either accept 100,000 points or decline them, but no matter what I do I can't get the game to print my message. The button pressing works just fine, but here's the script:

    function points()
    {
    wait(15.0);
    iprintlnbold( "Press and hold [{+actionslot 3}] to accept 100,000 points" );
    wait(1.0);
    iprintlnbold( "Press and hold [{+actionslot 4}] to decline 100,000 points" );
    wait(1.0);
    for(;; ) //<-- no space there normally, this board just converts it to a winky face otherwise
    {
    if(self actionslotthreebuttonpressed())
    {
    self zm_score::add_to_player_score(49750);
    return;
    }
    else if(self actionslotfourbuttonpressed())
    {
    return;
    }
    wait(0.2);
    }

    I have the wait at the start because the script is supposed to start when the player connects, so I need to give it enough time for the screen to fade it. But it still doesn't print the message, even if I make it wait long after you can move around and see.
     
    VerTical likes this.
  2. VerTical

    VerTical Head Member Donator

    897
    1,167
    243
    Credits:
    2,574
    Hello, @Collie

    Hey Try This m8 :grinning:

    PHP:
    function points()
    {
        for(;; )
        {
                
    iprintlnbold"Press and hold [{+actionslot 3}] to accept 100,000 points" );
                
    iprintlnbold"Press and hold [{+actionslot 4}] to decline 100,000 points" );
      
            if(
    self actionslotthreebuttonpressed())
            {
                
    self zm_score::add_to_player_score(49750);
                break;
            }
            else if(
    self actionslotfourbuttonpressed())
            {
                break;
            }
        
    wait 0.2;
        }
    }
    regards,
    VerTical.
     
    Last edited: Nov 18, 2016
  3. SeriousHD-

    SeriousHD- Guest

    Credits:
    0
     
    Last edited by a moderator: Nov 18, 2016
    Patrick and VerTical like this.
  4. Patrick

    Patrick Guest

    Credits:
    0
    Dafuq is this **** dawg?
    Its utter nonsense lmao
     
    VerTical likes this.
  5. Collie

    Collie Member

    9
    12
    3
    Credits:
    74
    Thanks for trying VerTical, but that code crashes the server. It took a while, but I finally found a workaround. I'll post it here in case someone else runs into the same problem.

    PHP:
    function somethingthatcallscheck()
    {
        
    thread check();
    }

    function 
    points()
    {
        
    self iprintlnbold"Press [{+actionslot 3}] to accept 100,000 points" );
        
    self iprintlnbold"Press [{+actionslot 4}] to decline 100,000 points" );
        for(;;)
        {
            if(
    self actionslotthreebuttonpressed())
            {
                
    self zm_score::add_to_player_score(49750);
                
    self iprintlnbold"Points accepted" );
                return;
            }
            else if(
    self actionslotfourbuttonpressed())
            {
                
    self iprintlnbold"Points declined" );
                return;
            }
            
    wait(0.05);
        }
    }

    function 
    check()
    {
        for(;;)
        {
            if(
    self AdsButtonPressed())
            {
                
    self thread points();
                return;
            }
            else if(
    self AttackButtonPressed())
            {
                
    self thread points();
                return;
            }
            else if(
    self MeleeButtonPressed())
            {
                
    self thread points();
                return;
            }
            else if(
    self SprintButtonPressed())
            {
                
    self thread points();
                return;
            }
            else if(
    self JumpButtonPressed())
            {
                
    self thread points();
                return;
            }
            
    wait(0.05);
        }
    }
     
    SCP and CabCon like this.
  6. Chriskey23

    Chriskey23 Member

    8
    4
    3
    Credits:
    24
    So this is working and gives me Pointe in a mach?
     

Share This Page