Posts: 76
Threads: 28
Joined: May 2011
Reputation:
0
Hello, could someone explain me how do returns work and when they are used? Right now I just put them randomly and sometimes that causes stuff below the code to stop working and I randomly fix it by removing it or adding it or changing a place and I have no idea why. :P
Posts: 1,849
Threads: 96
Joined: Apr 2010
Reputation:
0
returns are also used to return values in any function or code!
Like CreateVehicle returns the vehicle id of the vehicle just created , same with many callbacks!
Like GetPlayerVehicleID returns vehicle id which player is driving!
You can make custom callbacks tu return many kind of values and more functions also!
Functions can also return functions! returns can also be used to return true or false in a function!
Posts: 76
Threads: 28
Joined: May 2011
Reputation:
0
So for example I make a GUI list which has 3 options. Should I put a return after each option so the code wouldn't be read further? This would same some bandwitch right?
Posts: 1,849
Threads: 96
Joined: Apr 2010
Reputation:
0
Exactly. return 1 is used for it.