SA-MP Forums Archive
How to get the day as a non-numeric? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to get the day as a non-numeric? (/showthread.php?tid=78126)



How to get the day as a non-numeric? - Danny_Costelo - 17.05.2009

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?


Re: How to get the day as a non-numeric? - Joe Staff - 17.05.2009

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


Re: How to get the day as a non-numeric? - Danny_Costelo - 17.05.2009

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?


Re: How to get the day as a non-numeric? - Backwardsman97 - 17.05.2009

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.




Re: How to get the day as a non-numeric? - Danny_Costelo - 17.05.2009

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?


Re: How to get the day as a non-numeric? - Backwardsman97 - 17.05.2009

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.


Re: How to get the day as a non-numeric? - Badger(new) - 17.05.2009

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.


Re: How to get the day as a non-numeric? - ICECOLDKILLAK8 - 17.05.2009

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


Re: How to get the day as a non-numeric? - Joe Staff - 17.05.2009

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");
}



Re: How to get the day as a non-numeric? - Backwardsman97 - 17.05.2009

Well days would be a bit harder.