so i was working on a plugin for my server i dont know if its made already can you please point out wht is wrong ?
Code:
#include <amxmodx>
#include <colorchat>
new gp_Hudinfo, gp_Colorinfo, gp_Chatinfo, gp_Loginfo
#define PLUGIN "[T-W] IP command"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "[T-W] Egan"
#define HUD 0, 255, 255, -1.0, 0.20, 1, 0.0, 0.0, 0.1, 20.0
public plugin_init()
{
register_plugin(PLUGIN, PLUGIN_VERSION, PLUGIN_AUTHOR)
register_clcmd("say /ip", "show_ip")
register_clcmd("say_team /ip", "show_ip")
register_clcmd("ip", "show_ip")
gp_Hudinfo = register_cvar("ips_hud", "2")
gp_Colorinfo = register_cvar("ips_color", "1")
gp_Chatinfo = register_cvar("ips_chat", "2")
gp_Loginfo = register_cvar("ips_log", "1")
}
public show_ip(id)
{
new ip[33], user[32]
get_user_ip(0, ip, 32, 0)
get_user_name(id, user, 31)
if(get_pcvar_num(gp_Colorinfo) == 1)
{
ColorChat(id, BLUE, "^x04IP:^x01 %s", ip)
}
else
{
}
if(get_pcvar_num(gp_Hudinfo) == 1)
{
set_hudmessage(HUD)
show_hudmessage(id, "IP: %s", ip)
}
else
{
}
if(get_pcvar_num(gp_Chatinfo) == 1)
{
client_print(id, print_chat, "IP: %s", ip)
}
else
{
}
if(get_pcvar_num(gp_Loginfo) == 1)
{
log_amx("[T-W] %s typed in the chat /ip", user)
}
else
{
}
}
__________________