How to create own function
#2

First, forward it:
pawn Код:
forward FunctionName(parameters);
The parameters are just variable names that you use. Treat them the same as other variables:
pawn Код:
FunctionName (id, message[], Float:radius) //first one is an integer, then string, then a floating point number
Second, declare it:
pawn Код:
public FunctionName(parameters) //Must match the forward line EXACTLY
{
     return 1;
}
Then use it. Make a function for repeated tasks throughout the script to save time.
Reply


Messages In This Thread
How to create own function - by ajwar - 18.06.2011, 16:15
Re: How to create own function - by randomkid88 - 18.06.2011, 16:17
Re: How to create own function - by ajwar - 18.06.2011, 17:19
Re: How to create own function - by ajwar - 18.06.2011, 18:40
Re: How to create own function - by Macluawn - 18.06.2011, 18:58

Forum Jump:


Users browsing this thread: 2 Guest(s)