Results 1 to 10 of 16

Thread: [CoD2] create functions in .menu-files!

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #16
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Basically created a simple && for menus (logical AND, in case if(a && b) set c 100)
    code:

    PHP Code:
                    execnow "set first_ok 0";
                    
    execnow "set second_ok 0";
                    
    execnowondvarintvalue first_check 100 "set first_ok 1";
                    
    execnowondvarintvalue second_check 200 "setfromdvar second_ok first_ok";
                    
    execnowondvarintvalue second_ok 1 "set result 10";
                    
    execnowondvarintvalue second_ok 0 "set result -10"
    which basically does this:
    PHP Code:
    first_ok false;
    second_ok false;
    if(
    first_check == 100)
            
    first_ok true;
    if(
    second_check == 200)
            
    second_ok first_ok;
    if(
    second_ok)
            
    result 10;
    else
            
    result = -10
    It is however not very possible that you can use this for a double &&, as the amount of execnow's and execnowondvarint's is limited per action. You'll need a second menu then.
    Last edited by IzNoGoD; 21st May 2015 at 18:22.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  2. The Following 2 Users Say Thank You to IzNoGoD For This Useful Post:

    kung foo man (21st May 2015),Mitch (21st May 2015)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •