#define in YCMD
#1

Hi guys,

Is possible to use DEFINE for YCMD commands?

#DEFINE ADMIN "makeadmin"

Code:
YCMD:ADMIN(playerid,params[],help)
So it need to be ycmd:makeadmin .. (I know that this don't will work,but is there any way to do it..)
Reply
#2

Quote:
Originally Posted by Y_Less
View Post
No, but why would you want to? What does that gain you over naming the command normally?
I use one script on two different server.For example:

Code:
#define CROATIA 1
#define BOSNIA 0

#if CROATIA == 1
#define ADMIN "makeadmin"
#else 
#define ADMIN "adminmake"
#endif
(It's just example,so when i compile with #define Croatia 1 i get different command names then #define bosnia 1...)
Reply
#3

Quote:
Originally Posted by Y_Less
View Post
Then:

#define @yC_ADMIN @yC_realname

Iirc
Thank you very much!

I have last question abotu define.
Is possible to use define in define

For example

Code:
#define TEST "are"
#define MESSAGE "How  "#TEST" you ?"
printf(MESSAGE);
need to give:
How are you?
Reply
#4

PHP Code:
#define ADMIN_CMD(%1) YCMD:makeadmin(%1)
ADMIN_CMD(playeridparams[]) {
    return 
1;

Reply
#5

Quote:
Originally Posted by Gammix
View Post
PHP Code:
#define ADMIN_CMD(%1) YCMD:makeadmin(%1)
ADMIN_CMD(playeridparams[]) {
    return 
1;

Thank you very much Gammix,this works

Y_Less method also work,but with one define...When i make more defines my script don't want compile(I don't get any errors,just it don't want to compile..)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)