Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: NeskWriter on January 04, 2013, 01:56:08 pm

Title: I don't understand returns
Post by: NeskWriter 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  :-[
Title: Re: I don't understand returns
Post by: heekz.shadow 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]
Title: Re: I don't understand returns
Post by: NeskWriter on January 04, 2013, 08:40:17 pm
hmm...
Title: Re: I don't understand returns
Post by: heekz.shadow 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;
Title: Re: I don't understand returns
Post by: NeskWriter 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)