AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help with a amx_showip (https://forums.alliedmods.net/showthread.php?t=223956)

hpservers 08-18-2013 18:22

Help with a amx_showip
 
I tried to rebuild foreign plugin to try because I've never dealt with these things and you just try, I began to read articles and tutorials on scripting, but still fall short of the errors do not appear to understand, I would like tell me where is my mistake in this case, and if you can hang himself how to fix it, with a short, clear and precise explanation.

Here's the code:
PHP Code:

#include <amxmodx>

public plugin_init()
{
    
register_plugin("ShowIP""1.0""****")
    
register_concmd("amx_showip""cmd_showip"ADMIN_ALL); 
}

public 
cmd_showip(id)
{
    new 
players[32], numnumber;
    
get_players(playersnum)
    
console_print(id,"----------------------Clients on server----------------------")
    
console_print(id" # NickName    IP    STEAM ID      Frags   Deaths Ping   Team")
    
    for(
number number num number++)
    {
        new 
name[32], ip[32], authid[32], frags[0], deaths[0], ping[1], team[2];
        
get_user_name(players[number], namecharsmax(name))
        
get_user_ip(players[number], ipcharsmax(ip), 1)
        
get_user_authid(players[number], authid charsmax(authid))
        
get_user_frags(frags)
        
get_user_deaths(deaths)
        
get_user_ping(ping10)
        
get_user_team(teamteam[]=""charsmax(team))
        
console_print(id"%d  %s    %s"number+1nameip)
    }
    
console_print(id,"----------------------Clients on server----------------------")
    
console_print(id"The total number of players in the server is currently: %d"num)
    

    return 
PLUGIN_HANDLED


Author of the plugin I have not hid to copy, replacement and the like so I found it in another site!

I Altered only part of the plugin:
PHP Code:

    console_print(id,"----------------------Clients on server----------------------")
    
console_print(id" # NickName    IP    STEAM ID      Frags   Deaths Ping   Team")
    
    for(
number number num number++)
    {
        new 
name[32], ip[32], authid[32], frags[0], deaths[0], ping[1], team[2];
        
get_user_name(players[number], namecharsmax(name))
        
get_user_ip(players[number], ipcharsmax(ip), 1)
        
get_user_authid(players[number], authid charsmax(authid))
        
get_user_frags(frags)
        
get_user_deaths(deaths)
        
get_user_ping(ping10)
        
get_user_team(teamteam[]=""charsmax(team))
        
console_print(id"%d  %s    %s"number+1nameip)
    }
    
console_print(id,"----------------------Clients on server----------------------")
    
console_print(id"The total number of players in the server is currently: %d"num

And then only one works Altered just what it is normally, is alien and it is Nick and IP my idea is something new to be done to diversify, because I read a million threads with the same plug-ins do not know watching right now just in your forum some guy had started a topic that had a new show ip who was the provider of your Internet May was not sure!
My English is very very bad but I do not know much, but it's enough for me right!
:D

devilicioux 08-19-2013 06:46

Re: Help with a amx_showip
 
PHP Code:

frags[0], deaths[0

0 Length Arrays ?

You dont need to make them arrays.

Secondly
get_user_team doesnt work like this.Again no need of making it an array

PHP Code:

public function(id

    new 
team get_user_team(id
//make a switch statement to check what it returns and Then store the value in variable.
//get_user_team(id) == 1 //ts
//get_user_team(id) == 2 //ct                                 
//get_user_team(id) == 3 // spec
//get_user_team(id) == 0 // unnasigned                                 


Thirdly

PHP Code:

get_user_frags(frags)
get_user_deaths(deaths

Wrong :nono:
Correct way is
PHP Code:

get_user_frags(id)
get_user_deaths(id

Correct These First and Revert Back.



Edit : http://forums.alliedmods.net/showthread.php?p=372646
You can use this as well.

hpservers 08-24-2013 19:30

Re: Help with a amx_showip
 
I made another attempt and I think it worked, but time function and frags and deaths can not print them, but he spent the MAP.
PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define STR_LEN 32

public plugin_init() {
    
register_plugin("Show IP,Steam Id and Map""0.1""HoBaK")
    
register_concmd("amx_showip""show"ADMIN_ALL"List with player nick,ip,steam id and map to moment.")
}

public 
show(id)
{
    new 
players[32], num
    get_players
(playersnum)

    
console_print(id"=============All Joined players on this server============")
    
console_print(id"")

    for(new 
0numi++)
    {
        new 
name[32];
        new 
szIp[32];
        new 
steamid[32];
        new 
mapname[32];
        
get_user_name(players[i], name31)
        
get_user_ip(players[i], szIp310)
        
get_user_authid(players[i], steamid ,31)
        
get_mapname(mapname31)
        
get_user_deaths(players[i])
        
get_user_frags(players[i])
        
console_print(id" - NickName  -  IP Adress          -             Steam ID       Map Name")
        
console_print(id" - %s - %s - %s - %s"nameszIpsteamidmapname)
    }
    
console_print(id"")

    if (
num == 1)
        
console_print(id" - Have one player on this server.")

    else if (
num 1)
        
console_print(id" - %d players has playing now on this server."num);

    
console_print(id"")
    
console_print(id"Powered by HoBaK")

    return 
PLUGIN_HANDLED
}
/* Please don't change author of the plugin. */ 

And my 3 chance from my free time to say this plugin:

This is a Connect Plugin say message on connect player, i know that there are many plugins do not rub it, as they are the easiest what to do GanGame original plugin you do it yourself ...

Learn about the last time I say!

PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

public plugin_init() {
    
register_plugin("Connect Plugin""0.1""HoBaK");
}

public 
client_disconnect(id
{
    new 
players[32], num
    get_players
(playersnum)
    for(new 
0numi++)
    {
    new 
name[32];
    new 
Ip[32];
    new 
steamid[32];
    new 
mapname[32];
    
get_user_name(players[i], name31)
    
get_user_ip(players[i], Ip310)
    
get_user_authid(players[i], steamid31)
    
get_mapname(mapname31)
    
client_print(idprint_chat"[Map:%s] Player:%s, has left the game, IP:%s and Steam ID:%s"mapnamenameIpsteamid)
    }
}

public 
client_connect(id)
{
    new 
players[32], num
    get_players
(playersnum)
    for(new 
0numi++)
    {
    new 
name[32];
    new 
Ip[32];
    new 
steamid[32];
    new 
mapname[32];
    
get_user_name(players[i], name31)
    
get_user_ip(players[i], Ip310)
    
get_user_authid(players[i], steamid31)
    
get_mapname(mapname31)
    
client_print(idprint_chat"[Map:%s] Player:%s, has joined the game, IP:%s and Steam ID:%s"mapnamenameIpsteamid)
    }


Sorry for my bad English!

akcaliberg 08-24-2013 19:46

Re: Help with a amx_showip
 
get_user_deaths( ) function returns the number of deaths of the player. For example
PHP Code:

console_print(id"You have %d deaths and %d frags",get_user_deaths(id), get_user_frags(id) ) 


hpservers 08-24-2013 23:00

Re: Help with a amx_showip
 
Quote:

Originally Posted by akcaliberg (Post 2020980)
get_user_deaths( ) function returns the number of deaths of the player. For example
PHP Code:

console_print(id"You have %d deaths and %d frags",get_user_deaths(id), get_user_frags(id) ) 


Am question!
This is only for a particular customer or is against the client frags marks them there because now Bulgaria's 6:00 and I can not call any player to come and do a test and use the bot.

If only the ID of the client, and this adds to frags does work.

pokemonmaster 08-25-2013 00:17

Re: Help with a amx_showip
 
Quote:

Originally Posted by devilicioux (Post 2017019)
PHP Code:

public function(id

    new 
team get_user_team(id
//make a switch statement to check what it returns and Then store the value in variable.
//get_user_team(id) == 1 //ts
//get_user_team(id) == 2 //ct                                 
//get_user_team(id) == 3 // spec
//get_user_team(id) == 0 // unnasigned                                 



I think get_user_team returns 3 for both unassigned and spectators. Someone correct me if im wrong.

wickedd 08-25-2013 00:32

Re: Help with a amx_showip
 
Quote:

Originally Posted by pokemonmaster (Post 2021073)
I think get_user_team returns 3 for both unassigned and spectators. Someone correct me if im wrong.

You are wrong.

0 = Unassigned
1 = Terrorist
2 = Counter Terrorist
3 = Spectator

devilicioux 08-25-2013 03:48

Re: Help with a amx_showip
 
You dont Need to loop through players .. instead of id use 0 .. It will print to all the players. Test it yourself.

PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

public plugin_init() {
    
register_plugin("Connect Plugin""0.1""HoBaK");
}

public 
client_disconnect(id
{
  
    new 
name[32];
    new 
Ip[32];
    new 
steamid[32];
    new 
mapname[32];
    
get_user_name(players[i], name31)
    
get_user_ip(players[i], Ip310)
    
get_user_authid(players[i], steamid31)
    
get_mapname(mapname31)
    
client_print(0print_chat"[Map:%s] Player:%s, has left the game, IP:%s and Steam ID:%s"mapnamenameIpsteamid)
  
}

public 
client_connect(id)
{
      new 
name[32];
    new 
Ip[32];
    new 
steamid[32];
    new 
mapname[32];
    
get_user_name(players[i], name31)
    
get_user_ip(players[i], Ip310)
    
get_user_authid(players[i], steamid31)
    
get_mapname(mapname31)
    
client_print(0print_chat"[Map:%s] Player:%s, has joined the game, IP:%s and Steam ID:%s"mapnamenameIpsteamid)
  



hpservers 08-25-2013 13:53

Re: Help with a amx_showip
 
PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define STR_LEN 32

public plugin_init() {
    
register_plugin("Show IP,Steam Id and Map""0.1""HoBaK")
    
register_concmd("amx_showip""show"ADMIN_ALL"List with player nick,ip,steam id and map to moment.")
}

public 
show(id)
{
    new 
players[32], num
    get_players
(playersnum)
    
    
console_print(id"=============All Joined players on this server============")
    
console_print(id"")
    
console_print(id" - NickName  -  IP Adress          -             Steam ID          -             Map Name          -             Team")

    for(new 
0numi++)
    {        
        new 
name[32];
        new 
szIp[32];
        new 
steamid[32];
        new 
mapname[32];
        new 
team[32];
        
get_user_frags(players[i])
        
get_user_name(players[i], name31)
        
get_user_ip(players[i], szIp310)
        
get_user_authid(players[i], steamid ,31)
        
get_mapname(mapname31)
        
get_user_info(players[i],"team",team,18)
        
console_print(id" - %s - %s - %s - %s - %s"nameszIpsteamidmapnameteam)
    }
    
console_print(id"You have %d kills and %d deaths",get_user_frags(id), get_user_deaths(id) )
    
console_print(id"Play Time in seconds:%d"get_user_time(id))
    
console_print(id"")

    if (
num == 1)
        
console_print(id" - Have one player on this server.")

    else if (
num 1)
        
console_print(id" - %d players has playing now on this server."num);

    
console_print(id"")
    
console_print(id"Powered by HoBaK")

    return 
PLUGIN_HANDLED
}
/* Please don't change author of the plugin. */ 

Everything works as it should and only team to show.
Only yesterday did not show and still enters Terrosit and showed me CT

devilicioux 08-26-2013 04:35

Re: Help with a amx_showip
 
Quote:

Originally Posted by devilicioux (Post 2021130)
You dont Need to loop through players .. instead of id use 0 .. It will print to all the players. Test it yourself.

PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

public plugin_init() {
    
register_plugin("Connect Plugin""0.1""HoBaK");
}

public 
client_disconnect(id
{
  
    new 
name[32];
    new 
Ip[32];
    new 
steamid[32];
    new 
mapname[32];
    
get_user_name(players[i], name31)
    
get_user_ip(players[i], Ip310)
    
get_user_authid(players[i], steamid31)
    
get_mapname(mapname31)
    
client_print(0print_chat"[Map:%s] Player:%s, has left the game, IP:%s and Steam ID:%s"mapnamenameIpsteamid)
  
}

public 
client_connect(id)
{
      new 
name[32];
    new 
Ip[32];
    new 
steamid[32];
    new 
mapname[32];
    
get_user_name(players[i], name31)
    
get_user_ip(players[i], Ip310)
    
get_user_authid(players[i], steamid31)
    
get_mapname(mapname31)
    
client_print(0print_chat"[Map:%s] Player:%s, has joined the game, IP:%s and Steam ID:%s"mapnamenameIpsteamid)
  





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

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