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

[HELP] Get gametime in Chat


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 05-16-2014 , 18:42   [HELP] Get gametime in Chat
Reply With Quote #1

Trash!

Last edited by Fuck For Fun; 05-20-2014 at 16:21.
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
Backstabnoob
Veteran Member
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 05-16-2014 , 18:54   Re: [HELP] Get gametime in Chat
Reply With Quote #2

Gametime is the time passed since start of the map.

Afaik it's a float so it should be new Float: timeleft, new Float: minutes, new Float: seconds
Backstabnoob is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 05-16-2014 , 18:54   Re: [HELP] Get gametime in Chat
Reply With Quote #3

get_gametime returns a Float and it is the number of seconds since the map started
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 05-16-2014 , 19:07   Re: [HELP] Get gametime in Chat
Reply With Quote #4

Okay ..
But you can at least do it in my code, I know the next time?
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
Backstabnoob
Veteran Member
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 05-16-2014 , 19:55   Re: [HELP] Get gametime in Chat
Reply With Quote #5

No, I told you what to do.
Backstabnoob is offline
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 05-16-2014 , 20:00   Re: [HELP] Get gametime in Chat
Reply With Quote #6

Quote:
Originally Posted by Backstabnoob View Post
No, I told you what to do.
i did, but it show me that: (8.2222:8)
PHP Code:
new Floattimeleftminutesseconds;

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd"say /open""CmdOpen" );
}

public 
CmdOpenclient )
{
    
    new 
ent = -1szName32 ];
    
    new 
timeleft get_gametime();
    
    
minutes timeleft 60;
         
seconds timeleft 60;
    
    if ( 
client get_user_nameclientszNamecharsmaxszName ) );
    
    while ( ( 
ent fm_find_ent_by_classent"func_door" ) ) ) 
        
dllfuncDLLFunc_Useent);
    
    if ( 
client )    client_print(0print_chat"%s has opened the cells, at (%i:%i)"szNameminutesseconds );
    
    return 
1;


Last edited by Fuck For Fun; 05-20-2014 at 16:22.
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
Backstabnoob
Veteran Member
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 05-16-2014 , 20:09   Re: [HELP] Get gametime in Chat
Reply With Quote #7

That code wouldn't even compile so stop lying.

I just wonder how you managed to write the rest of that code when you have problems with a simple Float tag.

PHP Code:
new timeleft get_gametime();
minutes timeleft 60;
seconds timeleft 60
=>

PHP Code:
new Floattimeleft get_gametime();
new 
Floatminutes timeleft 60;
new 
Floatseconds timeleft 60

Last edited by Backstabnoob; 05-16-2014 at 20:11.
Backstabnoob is offline
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 05-17-2014 , 04:06   Re: [HELP] Get gametime in Chat
Reply With Quote #8

Okay I will use in float
But you did not explain well, I wrote what you told me over and it's what comes out:

Quote:
Error: Function "operator% (Float:, _ " is not implemented on line 7

Last edited by Fuck For Fun; 05-17-2014 at 04:19.
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 05-18-2014 , 04:30   Re: [HELP] Get gametime in Chat
Reply With Quote #9

It's because mod operator it is not integrated in floats. You can also use:

PHP Code:
new minutes floatround(timeleft 60);
new 
seconds floatround(timeleft) % 60
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 05-20-2014 , 14:10   Re: [HELP] Get gametime in Chat
Reply With Quote #10

Quote:
Originally Posted by meTaLiCroSS View Post
It's because mod operator it is not integrated in floats. You can also use:

PHP Code:
new minutes floatround(timeleft 60);
new 
seconds floatround(timeleft) % 60
've set up, what am I supposed to write in Public?
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
Reply


Thread Tools
Display Modes

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 21:25.


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