AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] Get gametime in Chat (https://forums.alliedmods.net/showthread.php?t=240496)

Fuck For Fun 05-16-2014 18:42

[HELP] Get gametime in Chat
 
Trash!

Backstabnoob 05-16-2014 18:54

Re: [HELP] Get gametime in Chat
 
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

YamiKaitou 05-16-2014 18:54

Re: [HELP] Get gametime in Chat
 
get_gametime returns a Float and it is the number of seconds since the map started

Fuck For Fun 05-16-2014 19:07

Re: [HELP] Get gametime in Chat
 
Okay ..
But you can at least do it in my code, I know the next time?

Backstabnoob 05-16-2014 19:55

Re: [HELP] Get gametime in Chat
 
No, I told you what to do.

Fuck For Fun 05-16-2014 20:00

Re: [HELP] Get gametime in Chat
 
Quote:

Originally Posted by Backstabnoob (Post 2138780)
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;



Backstabnoob 05-16-2014 20:09

Re: [HELP] Get gametime in Chat
 
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


Fuck For Fun 05-17-2014 04:06

Re: [HELP] Get gametime in Chat
 
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

meTaLiCroSS 05-18-2014 04:30

Re: [HELP] Get gametime in Chat
 
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


Fuck For Fun 05-20-2014 14:10

Re: [HELP] Get gametime in Chat
 
Quote:

Originally Posted by meTaLiCroSS (Post 2139333)
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?


All times are GMT -4. The time now is 09:37.

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