01.11.2014, 02:53
For the callbacks, just read the given documentation (https://sampwiki.blast.hk/wiki/Scripting_Callbacks)
For the functions, it's just like in C. If you need to return something useful in a function, then return it.
Else, just don't return anything anywhere (using "return;" returns also nothing).
At last but not least : once you used "return" somewhere in your code, if this "return" is accessed run-time, then the program won't go forward.
For example :
For the functions, it's just like in C. If you need to return something useful in a function, then return it.
Else, just don't return anything anywhere (using "return;" returns also nothing).
At last but not least : once you used "return" somewhere in your code, if this "return" is accessed run-time, then the program won't go forward.
For example :
pawn Код:
myFunc(...)
{
if(numargs() == 0) // If no arguments passed
return; // Exit the function
if(getarg(0) == 13) // If the first argument's value is 13 (we can do it because we are sure the user have entered at least an argument with the condition above.
printf("The first argument is 13 !"); // print a message
}