Thread: [DELETED]
View Single Post
PartialCloning
Senior Member
Join Date: Dec 2015
Old 02-25-2019 , 14:46   Re: Server say /uptime
Reply With Quote #2

PHP Code:
#include <amxmodx>
#pragma semicolon 1

new g_MaxClients;

public 
plugin_init()
{
    
register_concmd("say /uptime""Command_Time");
    
g_MaxClients get_maxplayers();
}

public 
Command_Time(client)
{
    new 
Float:theTime get_gametime();
    new 
days          floatround(theTime 86400floatround_tozero);
    new 
hours         floatround( (theTime-days) / 3600floatround_tozero);
    new 
minutes       floatround( (theTime-days-hours)/60floatround_tozero);
    new 
seconds       floatround(theTime days hours minutesfloatround_tozero);
    new 
milli         floatround( (theTime days hours minutes seconds) * 1000floatround_tozero);

    if(
client && client <= g_MaxClients && is_user_connected(client))
    {
        
client_print(clientprint_chat"Uptime: %d days %d hours %d minutes %d seconds and %d milliseconds"dayshoursminutessecondsmilli);
    }
    else if(
client == 0)
    {
        
server_print("Uptime: %d days %d hours %d minutes %d seconds and %d milliseconds"dayshoursminutessecondsmilli);
    }

    return 
PLUGIN_HANDLED;


Last edited by PartialCloning; 02-25-2019 at 14:48.
PartialCloning is offline