View Single Post
Old 22/11/2017, 11:38 PM   #13
Dayrion
High-roller
 
Dayrion's Avatar
 
Join Date: Jan 2016
Location: France
Posts: 1,556
Reputation: 160
Default Re: [Macro] Mutliple macros in one

Quote:
Originally Posted by Y_Less View Post
I explained both those things in the posts I linked.
Okei. I understand after like 10 re-reading but I still don't understand (and that making errors), how this things can works:
PHP Code:
u@(u[_0]);
u@(u[_:c_l@1:c_l@20]); etc 
It's ouside the function so why it should work?

PHP Code:
main()
{
    (
CUSTOM_S_ACTUAL_STATE CUSTOM_S_ALL);

    
u@(u[_:c_l@1:c_l@20]);PrintZ(C_E_A#TEST, "path",  "message");
    
u@(u[_:c_l@1:c_l@20]);PrintZ(C_E_A#TEST, "path",  "message & args: %i", 99);
    
u@(u[_:c_l@1:c_l@20]);PrintZ(C_E_A#TEST, "General",  "message");
    
u@(u[_:c_l@1:c_l@20]);PrintZ(C_E_A#TEST, "General",  "message & args: %i", 99);

Code:
(78) : error 004: function "u@" is not implemented
(78) : warning 221: label name "_" shadows tag name
(78) : warning 215: expression has no effect
(78) : error 001: expected token: ";", but found "]"
(78) : error 029: invalid expression, assumed zero
(78) : fatal error 107: too many error messages on one line
Your code (which is outside any functions or whatever) actually works (of course lol) and doesn't trigger the compiler about u@u(...)
PHP Code:
u@(u[_:CMD_1:CMD_20]);cmd_my_command(playeridparams[])
{
    return 
1;
}

u@(u[_0]);cmd_my_command(playeridparams[]) <cmd_statehelp>
{
    return 
1;
}

u@(u[_:CMD_10]);cmd_ban(playeridparams[]) if (IsAdmin(playerid))
{
    return 
1;

EDIT: It was a brilliant idea you got. So impressive
__________________
Sometimes you might be lucky enough to bump into the one person
you wanna spend the rest of your life with, and that is love.
Oscar
Dayrion is offline   Reply With Quote