Raised This Month: $51 Target: $400
 12% 

Get Time


Post New Thread Reply   
 
Thread Tools Display Modes
PurposeLessx
Senior Member
Join Date: Jun 2017
Old 06-19-2018 , 06:07   Re: Get Time
Reply With Quote #11

Quote:
Originally Posted by KliPPy View Post
Yes, that is correct and is probably the best way to retrieve the current time in h/m/s as integers.
Okay, thank you for this code. And I wanna ask you something too. How can I change time zone of server? For example;

Time is "13.06" (GMT + 3)
But in my server, time is "12.06" GMT + 2)

Last edited by PurposeLessx; 06-19-2018 at 06:12.
PurposeLessx is offline
maqi
Senior Member
Join Date: Apr 2017
Location: Serbia
Old 06-19-2018 , 06:10   Re: Get Time
Reply With Quote #12

You need to change the timezone of the server itself. You would need ssh access for that.
__________________
stuff
maqi is offline
PurposeLessx
Senior Member
Join Date: Jun 2017
Old 06-19-2018 , 06:12   Re: Get Time
Reply With Quote #13

Quote:
Originally Posted by maqi View Post
You need to change the timezone of the server itself. You would need ssh access for that.
So, it's impossible for me.

--
EDIT: What should I use here? Static or new?

Quote:
Originally Posted by PurposeLessx View Post
How I will use it?
It calls one time in a minutes ( set_task(1.0, "blabla", _, _, _, "b"); )

PHP Code:
//static ctime[3], btime[3];
new ctimebtime;
time(ctimebtime);

if(
ctime == 11//if hours are 11

if(btime == 0// if minute(s) is 0 

Last edited by PurposeLessx; 06-19-2018 at 06:12.
PurposeLessx is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 06-19-2018 , 06:13   Re: Get Time
Reply With Quote #14

Quote:
Originally Posted by PurposeLessx View Post
So, it's impossible for me.

--
EDIT: What should I use here? Static or new?
Ask your game server provider support then.

If you are unsure and it takes you a few seconds to think about it go for new, most of the time it doesn't matter and you won't notice any difference. Use static only if you absolutely know you want it (for file scope or large local arrays).
__________________

Last edited by klippy; 06-19-2018 at 06:15.
klippy is offline
PurposeLessx
Senior Member
Join Date: Jun 2017
Old 06-19-2018 , 06:15   Re: Get Time
Reply With Quote #15

Quote:
Originally Posted by KliPPy View Post
Ask your game server provider support then.
My game server provider support doesn't f with us. So, I said impossible
PurposeLessx is offline
maqi
Senior Member
Join Date: Apr 2017
Location: Serbia
Old 06-19-2018 , 06:18   Re: Get Time
Reply With Quote #16

What kind of a server hosting is that?
__________________
stuff
maqi is offline
PurposeLessx
Senior Member
Join Date: Jun 2017
Old 06-19-2018 , 06:19   Re: Get Time
Reply With Quote #17

652 arrays and calls one time in a minute. So I should use "new" but doesn't it create a lag for server? Calling time and if commands (one time in a min).

-Call task
-new hour, minute
-if blabla
-else if blabla
-else if blabla
not found stop
- Again call task
- Again same things
PurposeLessx is offline
maqi
Senior Member
Join Date: Apr 2017
Location: Serbia
Old 06-19-2018 , 06:21   Re: Get Time
Reply With Quote #18

I have no idea what i just read. Im gonna go to sleep. Night
__________________
stuff
maqi is offline
PurposeLessx
Senior Member
Join Date: Jun 2017
Old 06-19-2018 , 06:25   Re: Get Time
Reply With Quote #19

Whatever, I am going to use "switch" instead of if codes.
I guess it is more optimized instead of using if.

Is there any mistake?

Spoiler
PurposeLessx is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:24.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode