Author Topic: I don't understand returns  (Read 2848 times)

0 Members and 2 Guests are viewing this topic.

Offline NeskWriter

  • Crime Boss
  • ****
  • Posts: 355
    • View Profile
I don't understand returns
« on: January 04, 2013, 01:56:08 pm »
I am really ashamed by posting that, but I don't understand what returns mean and what to write after return (1/0). I need someone's help, cuz I didn't find any help in internet.
Sorry  :-[


-Funniest quotes-

Quote from: asad3man
i cant able to understand

Offline heekz.shadow

  • LU testers
  • Made Man
  • *
  • Posts: 249
    • View Profile
Re: I don't understand returns
« Reply #1 on: January 04, 2013, 08:28:34 pm »
If you want the public to return something, you use return, for example:

[pawn]public IsHeThere( playerid )
{
      if( strcmp( IsHe(playerid), "Yes", 0 ) )
     {
         DoSomething();
      }
}

public IsHe(playerid)
{
       if( IsThere( playerid ) ) return "Yes";
      else return "No";
}[/pawn]
Code: [Select]
[20:23] <habi> later only i heard that lu chatbox is customizable. On my first visit, it appeared ugly.
[20:23] <habi> May be that also be the reason why lu has no players

Offline NeskWriter

  • Crime Boss
  • ****
  • Posts: 355
    • View Profile
Re: I don't understand returns
« Reply #2 on: January 04, 2013, 08:40:17 pm »
hmm...


-Funniest quotes-

Quote from: asad3man
i cant able to understand

Offline heekz.shadow

  • LU testers
  • Made Man
  • *
  • Posts: 249
    • View Profile
Re: I don't understand returns
« Reply #3 on: January 05, 2013, 01:16:38 am »
...

for example, you want to know if a player is online, so you do something like

Code: [Select]
if( IsPlayerOnline(playerid) == 1 )
You won't get 1 if there'd be no return 1;
Code: [Select]
[20:23] <habi> later only i heard that lu chatbox is customizable. On my first visit, it appeared ugly.
[20:23] <habi> May be that also be the reason why lu has no players

Offline NeskWriter

  • Crime Boss
  • ****
  • Posts: 355
    • View Profile
Re: I don't understand returns
« Reply #4 on: January 18, 2013, 05:25:31 pm »
...

for example, you want to know if a player is online, so you do something like

Code: [Select]
if( IsPlayerOnline(playerid) == 1 )
You won't get 1 if there'd be no return 1;

Oh thank you! Now I understand it better! yeah! 8)


-Funniest quotes-

Quote from: asad3man
i cant able to understand