Raised This Month: $32 Target: $400
 8% 

Map Time elapsed ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Awesome_man
Senior Member
Join Date: May 2014
Location: singapore
Old 01-19-2017 , 23:32   Map Time elapsed ?
Reply With Quote #1

How to get time elapsed after starting of any new map
Awesome_man is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 01-20-2017 , 00:06   Re: Map Time elapsed ?
Reply With Quote #2

https://www.amxmodx.org/api/amxmodx/get_gametime
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
Old 01-20-2017, 00:49
Awesome_man
This message has been deleted by Awesome_man.
Awesome_man
Senior Member
Join Date: May 2014
Location: singapore
Old 01-20-2017 , 00:53   Re: Map Time elapsed ?
Reply With Quote #3

Quote:
Originally Posted by EFFx View Post
Thanks
Awesome_man is offline
Awesome_man
Senior Member
Join Date: May 2014
Location: singapore
Old 01-20-2017 , 01:48   Re: Map Time elapsed ?
Reply With Quote #4

How to reduce decimal place like this is my output : 34.220508 Minutes

How to make it 34:22 minutes also when i'm using integer it's showing very big value like 1256456744 etc
Awesome_man is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 01-20-2017 , 02:04   Re: Map Time elapsed ?
Reply With Quote #5

What are u trying to do? Show the remaining time for map change?
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 01-20-2017 at 02:05.
EFFx is offline
Awesome_man
Senior Member
Join Date: May 2014
Location: singapore
Old 01-20-2017 , 02:48   Re: Map Time elapsed ?
Reply With Quote #6

Quote:
Originally Posted by EFFx View Post
What are u trying to do? Show the remaining time for map change?
get_gametime()/60;


I'm trying to get the time elapsed since map change and it's working fine except it's changing to minutes after 0.99 instead of 0.60 for eg: time should change to 2 min after 1:59 but it's changing after 1:99 why so ?

Last edited by Awesome_man; 01-20-2017 at 02:50.
Awesome_man is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 01-20-2017 , 03:34   Re: Map Time elapsed ?
Reply With Quote #7

Edit: i would do something like that:
PHP Code:
client_printid print_chat"Minutes passed from map start: %i" ,  floatround get_gametime( ) / 60.0 ) ); 
But is not weel because the zecimals wont be calculated until .60 , more than 100.

So a minute will mean 100 seconds based on my tests.

You can trick people like that or you can make your own Count with a variable.

Btw , another trick to calculate the TIMELEFT - Current time passed.
__________________
Project: Among Us

Last edited by Craxor; 01-20-2017 at 03:55.
Craxor is offline
Send a message via ICQ to Craxor
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-20-2017 , 08:38   Re: Map Time elapsed ?
Reply With Quote #8

Quote:
Originally Posted by Awesome_man View Post
How to reduce decimal place like this is my output : 34.220508 Minutes

How to make it 34:22 minutes also when i'm using integer it's showing very big value like 1256456744 etc
.220508 doesn't mean 22 seconds. That's basic math:

PHP Code:
34.220508 100 60 57.03418 seconds
floatround
(57.03418) = 57 seconds 
Make your code according to that formula.
__________________

Last edited by OciXCrom; 01-20-2017 at 08:39.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-20-2017 , 18:29   Re: Map Time elapsed ?
Reply With Quote #9

Quote:
Originally Posted by Awesome_man View Post
How to make it 34:22 minutes also when i'm using integer it's showing very big value like 1256456744 etc
34:22 is a string.
__________________
edon1337 is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 01-21-2017 , 04:00   Re: Map Time elapsed ?
Reply With Quote #10

Code:
#include <amxmodx> static iMinutes, iSeconds; public plugin_init( ) {     register_clcmd( "say /test" , "test" )     set_task( 1.0 , "UpTime" ); } public UpTime( ) {     new iGetGameTime = floatround( get_gametime( ) );     iMinutes = iGetGameTime / 60;     iSeconds = iGetGameTime % 60;     set_task( 1.0 , "UpTime" )} public test( id ) {     client_print( id , print_chat, "Time passed: %d:%d ", iMinutes, iSeconds );     return PLUGIN_HANDLED;  }
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
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 02:57.


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