AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   showip (https://forums.alliedmods.net/showthread.php?t=215776)

KuteManaal 05-12-2013 06:09

showip
 
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
            {
            }
}


Blizzard_87 05-12-2013 06:59

Re: showip
 
what do you want this plugin to do ?

KuteManaal 05-12-2013 07:06

Re: showip
 
when the players type /ip on chat the server ip will be shown to them

Blizzard_87 05-12-2013 07:13

Re: showip
 
ive tested the code.... seems to work by showing the server ip... whats wrong with it?

KuteManaal 05-12-2013 07:16

Re: showip
 
Quote:

Originally Posted by Blizzard_87 (Post 1950445)
ive tested the code.... seems to work by showing the server ip... whats wrong with it?

getting errors while i complie it,this aint my plugin a friend told me to fix it even i could not so im asking you guys we could't compile it.first it came that the include was missing then i compiled it with it then some crazy errors came

could not load out

YamiKaitou 05-12-2013 07:18

Re: showip
 
Assuming you are compiling it locally and with the colorchat include file, it compiles fine

Blizzard_87 05-12-2013 07:31

Re: showip
 
1 Attachment(s)
i edited your file and added my color stock to it so it will compile with the online compiler.

Egan 05-12-2013 07:56

Re: showip
 
yeah thanks for posting it for me bro i was too lazy to make a thread my self and the plugin works so

problem solved///close thread


All times are GMT -4. The time now is 16:15.

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