Define variable
#1

Hi, i have question how to define variable, i give example what i want

#define VER "getdate()"

Of course i have error and PAWNO crashes... I want make in define variable with date, it possible to do it?
Reply
#2

pawn Код:
#define VER getdate
try this =)

pawn Код:
VER(Year, Month, Day);
Reply
#3

pawn Код:
stock getDateEx() {
    new year, d, mon;
    getdate(year, d, mon);
    return year,d,mon;
}

//
#define VER getdate

// Example:

#define SCM SendClientMessage
// With params

#define SCM(%0, %1, %2) SendClientMessage(%0, %1, %2) // playerid, color, message
// #define VER(%0, %1, %2) getdate(%0, %1, %2)
Reply
#4

Iwant something in effect:

SetGameModeText("GM 2012:04:14");
But of course with variable
SetGameModeText(""VER"");

i have like i too write define

#define VER "GM getdate()"
Reply
#5

new string[64];
new d, m, y;
getdate(d, m, y);
format(string, 64, "%d.%d.%d gm name", d, m, y);
SetGameModeText(string);


Sorry, I'm using q cellphone for wriing this
Reply
#6

Thanks, is possibility to make this in define? Because i use def in other places too,
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)