Define Colors.
#1

Hey guys when i try to define those colors i get error
gamemodes\Blank.pwn(9) : error 049: invalid line continuation


Код:
//====|Colors|====\\
#define C_RED        "{FF0000}"
#define Blue           "{007CFF}"
#define Green         "{01FD23}"
#define Yellow        "{FDF901}"
#define Orange       "{FFD330}"
#define Purple        "{F630FF}"
#define Aqua          "{30FFF9}"
#define White         "{FFFFFF}"
//============================
Reply
#2

Remove \\ from the first line.
Reply
#3

Worked but why didnt work with it?
Reply
#4

Since you made those code lines a comment.
PHP код:
//====|Colors|====\\
#define C_RED        "{FF0000}"
#define Blue           "{007CFF}"
#define Green         "{01FD23}"
#define Yellow        "{FDF901}"
#define Orange       "{FFD330}"
#define Purple        "{F630FF}"
#define Aqua          "{30FFF9}"
#define White         "{FFFFFF}" 
this is fine for e.g
Reply
#5

Btw, you don't need to define hex colors, they work even if they're not defined.
Reply
#6

Quote:
Originally Posted by KeithCooper
Посмотреть сообщение
Btw, you don't need to define hex colors, they work even if they're not defined.
u mean i can remove them btw i want write letters its better for me
Reply
#7

Quote:
Originally Posted by FrAnKiN1
Посмотреть сообщение
Worked but why didnt work with it?
Backslash is used to "join" the code from the next line. Few examples:
PHP код:
new string[] = "This is some \
    string"

or
PHP код:
#define strcpy(%0,%1) \
    
strcat((%0[0] = EOS, %0), %1
So using it in your initial code somehow tries to continue the comment to the next line which is invalid.

Quote:
Originally Posted by KeithCooper
Посмотреть сообщение
Btw, you don't need to define hex colors, they work even if they're not defined.
Definitions are used to be more user-friendly instead of memorizing hexadecimals for each color.
Reply
#8

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Backslash is used to "join" the code from the next line. Few examples:
PHP код:
new string[] = "This is some \
    string"

or
PHP код:
#define strcpy(%0,%1) \
    
strcat((%0[0] = EOS, %0), %1
So using it in your initial code somehow tries to continue the comment to the next line which is invalid.



Definitions are used to be more user-friendly instead of memorizing hexadecimals for each color.
Okay that was helpful for me and thanks for helping.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)