Quick question about definitions
#1

I'm trying to do something like this -

pawn Код:
#define     SCRIPT:VERSION      0.1
#define     SCRIPT:MODE         "Virtual DM"
However, I'm receiving errors

Quote:
Originally Posted by PAWNO
(6) : warning 201: redefinition of constant/macro (symbol "SCRIPT:MODE")
(16) : error 017: undefined symbol "VERSION"
Will this even work? And if so, is there a fix for these errors? I'd appreciate a quick response as this throws everything off, and I would really like to be able to code like that, as it's very organized.
Reply
#2

Dont use : on your defines or variables, do it like this:

SCRIPT_VERSION 0.1
SCRIPT_MODE "Vitual DM"
Reply
#3

Alright, so colons will not work in definitions. That's all I wanted to know; Thank you.
Reply
#4

Quote:
Originally Posted by Scarred
Посмотреть сообщение
Alright, so colons will not work in definitions. That's all I wanted to know; Thank you.
Incorrect.

Код:
(6) : warning 201: redefinition of constant/macro (symbol "SCRIPT:MODE")
'SCRIPT:MODE' has already been defined. This may be whether in an included directive, or somewhere within your script.
Reply
#5

Labels dont work with definitions
pawn Код:
#define Dialog:                 _:DIALOG_

enum DIALOG
    {
        Dialog:Empty    0,          Dialog:Register     1,  Dialog:Login       2,//And so on
    }


//Now you can use them as variables for example:
ShowPlayerDialog(playerid, Dialog:Login,.....
I learned these from Zh3r0 so credits goes to him
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)