Results 1 to 3 of 3

Thread: endon, notify

  1. #1
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    458
    Thanks
    79
    Thanked 122 Times in 101 Posts

    endon, notify

    What do the function?
    self/level endon("");
    self/level notify("");
    self/level waittill("");
    ps:ty

  2. #2
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    Notify means it gives a warning that something happened.
    Endon means that it will stop the function if that thing happened
    Waittill means that the function wait till that thing happened.

    Correct me if im wrong

  3. #3
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by Ni3ls View Post
    Notify means it gives a warning that something happened.
    Endon means that it will stop the function if that thing happened
    Waittill means that the function wait till that thing happened.

    Correct me if im wrong
    You are only wrong in that there isn't a warning, as such. That is the wrong word to use. But other than that, you are correct: notify(), waittill(), and endon() are all linked together: a waittill() is a wait function. But instead of a stated time, it waits indefinitely for a notification. Hence:

    Code:
    self waittill( "time_to_end" );
    Code:
    self notify( "time_to_end" );
    Go together - a thread will not proceed past the waittill( "time_to_end" ). It sits there waiting for the notification - notify( "time_to_end" ). If it doesn't get the notification, it will wait indefinitely.

    As to endon(), you will see things like endon( "disconnect" ) at the top of a loop function, which only ends when the player leaves. And if you look at the callback_playerDisconnect() function, you will see:

    Code:
    self notify( "disconnect" );
    This signals all the threads which are waiting for the player to disconnect to end. So, the purpose of endon() is to Kill the thread or function.
    Last edited by Tally; 3rd September 2015 at 16:07.

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

    kung foo man (3rd September 2015),maxdamage99 (4th September 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
  •