My first plugin,i didn't tested it out,but i wan't some comments ...
Code:
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Announce + Client info"
#define VERSION "1.0"
#define AUTHOR "Broertje"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /myinfo","mi",ADMIN_ALL,"Shows Clients Information")
}
public client_putinserver(id)
{
new name[33]
get_user_name(id,name,32)
if(is_user_admin(id))
{
set_hudmessage(255, 0, 0, -1.0, 0.0, 0, 6.0, 12.0)
show_hudmessage(0, "%s has joined the n00bs",name)
return PLUGIN_HANDLED
}
set_hudmessage(85, 255, 0, 0.00, -1.0, 0, 6.0, 12.0)
show_hudmessage(0,"Welcome %s. Have fun here!",name)
return PLUGIN_HANDLED
}
public client_disconnect(id)
{
new name[33]
get_user_name(id,name,32)
if(is_user_admin(id))
{
set_hudmessage(255, 0, 0, -1.0, 0.0, 0, 6.0, 12.0)
show_hudmessage(0, "%s has left the house",name)
return PLUGIN_HANDLED
}
set_hudmessage(85, 255, 0, 0.00, -1.0, 0, 6.0, 12.0)
show_hudmessage(0,"%s has left. Goodbye!",name)
return PLUGIN_HANDLED
}
public mi(id)
{
new ping, loss, curtime
get_user_ping(id,ping, loss)
get_user_time(id,curtime)
if(is_user_alive(id))
if(is_user_connected(id))
{
client_print(id, print_chat, "Your ping is: %s , You've been playing: %s on server.",ping,curtime)
}
}