return is used to exit the current function. You can optionally include a value that can be stored for later use.
Code:
aFunction()
{
return 25;
}
public plugin_init()
{
new aVariable = 19;
client_print(0, print_console, "%i", aVariable);
aFunction(); //in this case does nothing useful - return value is discarded
client_print(0, print_console, "%i", aVariable);
aVariable = aFunction();
client_print(0, print_console, "%i", aVariable);
}
Code:
Output to every player's console:
19
19
25
Boolean variables are used as flags - that is they can only have one of two states: on or off. For example:
Code:
new bool:isDead;
if(is_user_alive(id)) isDead = false else isDead = true;