Different types of functions - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Different types of functions (
/showthread.php?tid=402284)
Different types of functions -
JavoDiaz - 26.12.2012
Which is the difference between this types of functions?
pawn Код:
AddNumber(number1, number2)
{
new string[45];
format(string, 45, "Result: %d + %d = %d", number1, number2, number1+number2);
SendClientMessageToAll(-1, string);
return 1;
}
pawn Код:
stock AddNumber(number1, number2)
{
new string[45];
format(string, 45, "Result: %d + %d = %d", number1, number2, number1+number2);
SendClientMessageToAll(-1, string);
return 1;
}
pawn Код:
forward AddNumber(number1, number2);
public AddNumber(number1, number2)
{
new string[45];
format(string, 45, "Result: %d + %d = %d", number1, number2, number1+number2);
SendClientMessageToAll(-1, string);
return 1;
}
Thanks.
Re: Different types of functions -
SuperViper - 26.12.2012
https://sampforum.blast.hk/showthread.php?tid=341545
Re: Different types of functions -
JavoDiaz - 26.12.2012
This tutorial is complete? If I put a plain function in an include I can use it in a gamemode?
Re: Different types of functions -
SuperViper - 26.12.2012
It's recommended to use stock functions in includes so that you don't get a warning if the function is unused.
Re: Different types of functions -
JavoDiaz - 26.12.2012
Thanks.