SA-MP Forums Archive
Possible to define/new a whole bit off code? - 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: Possible to define/new a whole bit off code? (/showthread.php?tid=487545)



Possible to define/new a whole bit off code? - Verth - 13.01.2014

As title states its the easiest way to explain it that way.

For example:

Код:
CMD:example(playerid, params[])
{
	SCMExampleAll
	return 1;
}
then SCMExampleAll should do: (like a define or new)

Код:
SendClientMessage(playerid, -1, "Example");
SendClientMessage(playerid, -1, "Example");
SendClientMessage(playerid, -1, "Example");
SendClientMessage(playerid, -1, "Example");
SendClientMessage(playerid, -1, "Example");
SendClientMessage(playerid, -1, "Example");
SendClientMessage(playerid, -1, "Example");
SendClientMessage(playerid, -1, "Example");
(The whole code not just one)

It needs to be allowed to use any kind of character. (examples: = && []())

If its SetIntVar etc, may I get an intruction?

Thank you for you time.


Re: Possible to define/new a whole bit off code? - iJumbo - 13.01.2014

You want to send to every player? or just the 8 functions in one?

use stock
https://sampwiki.blast.hk/wiki/Stocks


Re: Possible to define/new a whole bit off code? - Pottus - 13.01.2014

Just make it a function....

SCMExampleAll()
{


}


Re: Possible to define/new a whole bit off code? - Excelize - 13.01.2014

As Pottus said, make it into a function, but I think that making it into a stock would make it cleaner, and faster processed(I'm not sure about this)
Try a stock In my opinion