By looking at code.
Code:
/********************************************************************************
* Plugin name: Log stuff
* Made by: Dygear
* Modules required: Engine
* Warranties : This file is provided as is (no warranties).
********************************************************************************/
//These are include files, they take informaion from
// the include forlder and to find the syntax of that command.
// #include <%name%> will read from %name%.inc. For example,
// if you include amxmodx then it will read from amxmodx.inc
#include <amxmodx>
#include <engine>
public plugin_init() {
//Function is called just after server activation.
// This only registers the plugin with the server.
register_plugin("ServerUpTime","0.6a","Dygear")
}
public client_connect(id) {
//This is called when the client connects.
// This is going to log : Username and authid also
// get the Hour Minute and Second that the client connects.
new dyname[32], dyauthid[32], dyhours[6], dymins[6], dysecs[6]
get_user_name(id,dyname,31)
get_user_authid(id,dyauthid,31)
get_time("%H",dyhours,5)
get_time("%M",dymins,5)
get_time("%S",dysecs,5)
log_amx("Client : %s(%s) Connected on %H:%M:%S",dyname,dyauthid,dyhours,dymins,dysecs)
return PLUGIN_HANDLED
}
public plugin_end() {
//Function called before plugin unloading (server deactivation)
// The float dy_time get the time the server has been up SSS.SSSS
// This will not log the time if the server crashes.
new Float:dy_time = halflife_time();
log_amx("Server ended at : %f", dy_time);
return PLUGIN_HANDLED
}