How to get the day as a non-numeric?
#1

Well for the 'worldtime' in the server query, I wanted it to show the day of the week, I know this is possible, I've seen it on Crazybob's

Here's what I mean, If you still don't understand.



I tried getting the date using getdate(...) and using the minute variable as a string, but I get something weird like this



So does anyone know how I can get the date as a none numerical character?
Reply
#2

There's a plugin that allows you to change those 'rules' in the samp panel. check out ******' YSF, it can do that.
Reply
#3

Quote:
Originally Posted by SilentHuntR
There's a plugin that allows you to change those 'rules' in the samp panel. check out ******' YSF, it can do that.
I know that, I'm using it, but I need a way to update it using a timer, SetServerRule can only be called on OnGameModeInit, so I can't change that. Is it even possible to get the date using getdate(...) as a non numeric character?
Reply
#4

Quote:
Originally Posted by SilentHuntR
There's a plugin that allows you to change those 'rules' in the samp panel. check out ******' YSF, it can do that.
I think he knows how to change it, he just doesn't know how to make it come out as days in a string. Is it showing the real days or server days? You could use an array to store the day/month names.

Reply
#5

Quote:
Originally Posted by backwardsman97
Quote:
Originally Posted by SilentHuntR
There's a plugin that allows you to change those 'rules' in the samp panel. check out ******' YSF, it can do that.
I think he knows how to change it, he just doesn't know how to make it come out as days in a string. Is it showing the real days or server days?

Server days obviously, using getdate() :P

Could you be more specific?
Reply
#6

getdate stores the actual days in the real world. I meant maybe the script is using some kind of variable to store their current days.
Reply
#7

well once you get it so the day displays successfully, you'll need to make it so when the clock reaches 0:00, the day will change to the correct day.
Reply
#8

Use getdate() and an enum with the day names.
Reply
#9

Quote:
Originally Posted by 0xF29323
Quote:
Originally Posted by SilentHuntR
There's a plugin that allows you to change those 'rules' in the samp panel. check out ******' YSF, it can do that.
I know that, I'm using it, but I need a way to update it using a timer, SetServerRule can only be called on OnGameModeInit, so I can't change that. Is it even possible to get the date using getdate(...) as a non numeric character?
SetServerRule can be called whenever.

you could change this to fit for days
pawn Code:
GetMonthName(name[])
{
    new tmp,month;
    getdate(tmp,month,tmp);
    if(month==1)format(name,3,"JAN");
    if(month==2)format(name,3,"FEB");
    if(month==3)format(name,3,"MAR");
    if(month==4)format(name,3,"APR");
    if(month==5)format(name,3,"MAY");
    if(month==6)format(name,3,"JUN");
    if(month==7)format(name,3,"JUL");
    if(month==8)format(name,3,"AUG");
    if(month==9)format(name,3,"SEP");
    if(month==10)format(name,3,"OCT");
    if(month==11)format(name,3,"NOV");
    if(month==12)format(name,3,"DEC");
}
Reply
#10

Well days would be a bit harder.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)