#1

pawn Код:
new Year, Month, Day;
getdate(Year, Month, Day);
printf("%02d/%02d/%d", Day, Month, Year);
Sorry for the influx of questions, I do usually work it out for myself but I'm real stuck.

How would I get this into text (SendClientMessage)? I tried but failed, because it was a bunch of random numbers.
Reply
#2

pawn Код:
new Year, Month, Day,string[124];
getdate(Year, Month, Day);
format(string,sizeof(string),"%02d/%02d/%d", Day, Month, Year);
SendClientMessage(playerid,-1,string);
Reply
#3

Quote:
Originally Posted by tyler12
Посмотреть сообщение
pawn Код:
new Year, Month, Day,string[124];
getdate(Year, Month, Day);
format(string,sizeof(string),"%02d/%02d/%d", Day, Month, Year);
SendClientMessage(playerid,-1,string);
You're awesome. It works sound now. Thanks a bunch. Will rep. Can you explain to me how the -1 works here? Although the code works, I'd like to understand it fully.
Reply
#4

Quote:
Originally Posted by ConnorP
Посмотреть сообщение
You're awesome. It works sound now. Thanks a bunch. Will rep. Can you explain to me how the -1 works here? Although the code works, I'd like to understand it fully.
It's a color. -1 is white.
Reply
#5

Quote:
Originally Posted by tyler12
Посмотреть сообщение
It's a color. -1 is white.
Very helpful thanks.
I know you've done your fair share of helping but I'm also having issues trying to put the date on the same line as "Date:" text. If you could help me, I would appreciate it.

So, like: Date: [scripted date here]
Reply
#6

Put it in the formatted string.
pawn Код:
format(string,sizeof(string),"Date: %02d/%02d/%d", Day, Month, Year);
Reply
#7

Yeah, I suck.

Thanks for the help, one day I might be helping people. Sometimes my problem is that I merely overcomplicate things.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)