12.05.2017, 03:03
Quote:
Код:
SomeFunction(maybe, some, parameters); { SendClientMessage(maybe, COLOR_SOME, "Text"); } Protip: Compile as much as you can! :P |
Код:
SomeFunction(maybe, some, parameters); { SendClientMessage(maybe, COLOR_SOME, "Text"); } Protip: Compile as much as you can! :P |
Код:
SomeFunction(maybe, some, parameters); { SendClientMessage(maybe, COLOR_SOME, "Text"); } Protip: Compile as much as you can! :P |
for (new i = 0; i != 10; i++)
for (new j = 0; j != 100; j++)
Function(i, j);
for (new j = 0; j != 100; j++)
for (new i = 0; i != 10; i++)
Function(i, j);
new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); //You may change x, y and z value according to your needs. //By the way you should also take a look at GetXYInFrontOfPlayer. Or change x,y,z according to your needs. CreateObject(modelid, x, y, z); //This object will be create on player's pos. CreateObject(modelid, 211 - 214 + x, 384 - 390 + y, 10 - 8 + z); //This will be created in its same pos as it was before. //211[1st object's x] 214 [2nd object's x] Similarly to y and z;
#include <a_samp>
#include <YSI_Coding\y_va2>
main()
{
MyFunc1("Hello", "there", "world");
}
MyFunc1(...)
{
MyFunc2(___);
}
MyFunc2(...)
{
printf("%s %s %s", ___);
}
Func1(Func2(___), ___);
Today I learned (or figured out) how to write a fully generic parameters passing library, so you can FINALLY do this:
PHP код:
In short, "___" calls a function that takes all the paramters from the parent function and duplicates them on the stack - it is actually quite simple in retrospect. There are some tricky bits to get right to support recursive calls, and nested calls like: PHP код:
|
I didn't learn this today but what the heck.
TIL: Instead of doing this: PHP Code:
PHP Code:
|