Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 30

Thread: how to call a value from another function?

  1. #11
    Private Paho's Avatar
    Join Date
    Feb 2014
    Location
    Russia
    Posts
    101
    Thanks
    43
    Thanked 48 Times in 37 Posts
    AHahAhahHaha

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

    maxdamage99 (23rd July 2016)

  3. #12
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    458
    Thanks
    79
    Thanked 122 Times in 101 Posts
    Omg, dude your very very stupid...
    PHP Code:
    your_stupid_function()
    {
    /* shit code */
    /*...*/
    return test();
    }
    test()
    {
    slot=3;
    return 
    slot;

    PHP Code:
    class CoronaVirus 
    {
       
    CoronaVirus(int m 1): multi(m) { Peoples.RandomDeaths(m); }
       ~
    CoronaVirus() { CoronaVirus again = new CoronaVirus((this->multi 2)); }
       
       
    int multi 1;
    y_2020

  4. The Following User Says Thank You to maxdamage99 For This Useful Post:

    Paho (23rd July 2016)

  5. #13
    Private Paho's Avatar
    Join Date
    Feb 2014
    Location
    Russia
    Posts
    101
    Thanks
    43
    Thanked 48 Times in 37 Posts
    Quote Originally Posted by Paho View Post
    CodeCallback_PlayerCommand(args)
    {
    self endon("disconnect");
    bingband=test();
    }
    test()
    {
    slot=3;
    return slot;
    }
    I'm tested it's working

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

    maxdamage99 (23rd July 2016)

  7. #14
    Private
    Join Date
    Jul 2016
    Posts
    47
    Thanks
    0
    Thanked 1 Time in 1 Post
    thats not what i mean
    test()=3 ; is it porssible

  8. #15
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    458
    Thanks
    79
    Thanked 122 Times in 101 Posts
    WHHHHAAAAAAAAAAAAAAAAAAT??????????????DDDDDDDDDDDDDDDDD
    DUDE,MAYBE:
    PHP Code:
    your_function()
    /*codeee*/
    /*....*/
    //argument - is = 3 or someone..
    test(argument);

    test(a//a = argumet
    {
    /* EXAMPLE: */
    iprintlnbold(a); //print center 3
    iprintlnbold(15/int(a)); //print center 5
    players=getentarray("player","classname");
    iprintlnbold(players[int(a)].name); //print center client name by clientid = 3

    Last edited by maxdamage99; 23rd July 2016 at 15:25.
    PHP Code:
    class CoronaVirus 
    {
       
    CoronaVirus(int m 1): multi(m) { Peoples.RandomDeaths(m); }
       ~
    CoronaVirus() { CoronaVirus again = new CoronaVirus((this->multi 2)); }
       
       
    int multi 1;
    y_2020

  9. The Following User Says Thank You to maxdamage99 For This Useful Post:

    Paho (23rd July 2016)

  10. #16
    Private
    Join Date
    Jul 2016
    Posts
    47
    Thanks
    0
    Thanked 1 Time in 1 Post
    what im trying to do is i want to remove this from dropping iwx_sprint_mp
    and instead of that i want to drop the stored value that is stored in the sprint function

    dropWeapon()
    {
    current = self getcurrentweapon();
    if(current != "none")
    {
    weapon1 = self getweaponslotweapon("primary");
    weapon2 = self getweaponslotweapon("primaryb");

    if(current == weapon1)
    currentslot = "primary";
    else
    {
    assert(current == weapon2);
    currentslot = "primaryb";
    }

    clipsize = self getweaponslotclipammo(currentslot);
    reservesize = self getweaponslotammo(currentslot);

    if(clipsize || reservesize)
    self dropItem(current);
    }
    }



    Sprint()
    {
    self endon("disconnect");
    self notify("start_sprinting");

    sprint_weap="iwx_sprint_mp";
    slot="";
    if(self getcurrentweapon()==self getweaponslotweapon("primary"))
    slot="primary";
    else
    slot="primaryb";
    self.sweapon=self getcurrentweapon();

    if(self.sweapon==sprint_weap || self.sweapon=="none")
    return;

  11. #17
    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 15:35.

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

    maxdamage99 (23rd July 2016)

  13. #18
    Private
    Join Date
    Jul 2016
    Posts
    47
    Thanks
    0
    Thanked 1 Time in 1 Post
    what im trying to do is i want to remove this from dropping iwx_sprint_mp
    and instead of that i want to drop the stored value that is stored in the sprint function

    dropWeapon()
    {
    current = self getcurrentweapon();
    if(current != "none")
    {
    weapon1 = self getweaponslotweapon("primary");
    weapon2 = self getweaponslotweapon("primaryb");

    if(current == weapon1)
    currentslot = "primary";
    else
    {
    assert(current == weapon2);
    currentslot = "primaryb";
    }

    clipsize = self getweaponslotclipammo(currentslot);
    reservesize = self getweaponslotammo(currentslot);

    if(clipsize || reservesize)
    self dropItem(current);
    }
    }



    Sprint()
    {
    self endon("disconnect");
    self notify("start_sprinting");

    sprint_weap="iwx_sprint_mp";
    slot="";
    if(self getcurrentweapon()==self getweaponslotweapon("primary"))
    slot="primary";
    else
    slot="primaryb";
    self.sweapon=self getcurrentweapon();

    if(self.sweapon==sprint_weap || self.sweapon=="none")
    return;

  14. #19
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    458
    Thanks
    79
    Thanked 122 Times in 101 Posts
    No drop your sprint weapon:
    PHP Code:
    dropWeapon()
    {
    current self getcurrentweapon();
    if(
    current=="iwx_sprint_mp")
    return;
    if(
    current != "none")
    {
    weapon1 self getweaponslotweapon("primary");
    weapon2 self getweaponslotweapon("primaryb");

    if(
    current == weapon1)
    currentslot "primary";
    else
    {
    assert(current == weapon2);
    currentslot "primaryb";
    }

    clipsize self getweaponslotclipammo(currentslot);
    reservesize self getweaponslotammo(currentslot);

    if(
    clipsize || reservesize)
    self dropItem(current);
    }

    PHP Code:
    class CoronaVirus 
    {
       
    CoronaVirus(int m 1): multi(m) { Peoples.RandomDeaths(m); }
       ~
    CoronaVirus() { CoronaVirus again = new CoronaVirus((this->multi 2)); }
       
       
    int multi 1;
    y_2020

  15. #20
    Private
    Join Date
    Jul 2016
    Posts
    47
    Thanks
    0
    Thanked 1 Time in 1 Post
    in the sprint function the real wepon stored in slot so i wanted like if current=="iwx_sprint_mp"
    current==slot that stored in sprint how to call that?

Posting Permissions

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