Results 1 to 10 of 30

Thread: how to call a value from another function?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Private Paho's Avatar
    Join Date
    Feb 2014
    Location
    Russia
    Posts
    101
    Thanks
    43
    Thanked 48 Times in 37 Posts
    Quote Originally Posted by xulikav View Post
    thats not what i mean
    test()=3 ; is it porssible
    Quote Originally Posted by Paho View Post
    CodeCallback_PlayerCommand(args)
    {
    self endon("disconnect");
    bingband=test();
    }
    test()
    {
    slot=3;
    return slot;
    }
    Quote Originally Posted by Paho View Post
    This visible within a given function
    Use level or self or return;
    return slot;
    Code:
    test()
    {
    //... use if()
    slot="kot";
    //... use if()
    slot="pog";
    //... use if()
    slot="";
    //...
    return slot;
    }
    Code:
    CodeCallback_PlayerCommand(args)
    {
    self endon("disconnect");
    //...
    if(args[0]=="test")
    {
    iprintlnbold(test());//output: kot |or| pog |or| "" - using if()
    return;
    }
    //...
    }
    test()
    {
    slot="kot";
    return slot;
    }
    if(args[0]=="test")
    {
    iprintlnbold(test());//output: kot
    return;
    }
    I'm tested it's working
    Last edited by Paho; 23rd July 2016 at 14:35.

  2. The Following User Says Thank You to Paho For This Useful Post:

    maxdamage99 (23rd July 2016)

Posting Permissions

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