Raised This Month: $ Target: $400
 0% 

Help with a amx_showip


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hpservers
Junior Member
Join Date: Aug 2013
Old 08-18-2013 , 18:22   Help with a amx_showip
Reply With Quote #1

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!
hpservers is offline
devilicioux
Veteran Member
Join Date: Jun 2013
Location: Delhi,India
Old 08-19-2013 , 06:46   Re: Help with a amx_showip
Reply With Quote #2

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
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.
__________________
You keep bringing ANTICHRISTUS down .. He will rise again and kick asses !

#RespectList ANTICHRISTUS fysiks Bugsy

Most Common Errors You Can Encounter Every Now and Then

Last edited by devilicioux; 08-19-2013 at 06:47. Reason: More info.
devilicioux is offline
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 08-25-2013 , 00:17   Re: Help with a amx_showip
Reply With Quote #3

Quote:
Originally Posted by devilicioux View Post
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.
__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.
pokemonmaster is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 08-25-2013 , 00:32   Re: Help with a amx_showip
Reply With Quote #4

Quote:
Originally Posted by pokemonmaster View Post
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
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
hpservers
Junior Member
Join Date: Aug 2013
Old 08-24-2013 , 19:30   Re: Help with a amx_showip
Reply With Quote #5

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!

Last edited by hpservers; 08-24-2013 at 19:47.
hpservers is offline
devilicioux
Veteran Member
Join Date: Jun 2013
Location: Delhi,India
Old 08-25-2013 , 03:48   Re: Help with a amx_showip
Reply With Quote #6

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)
  

__________________
You keep bringing ANTICHRISTUS down .. He will rise again and kick asses !

#RespectList ANTICHRISTUS fysiks Bugsy

Most Common Errors You Can Encounter Every Now and Then
devilicioux is offline
hpservers
Junior Member
Join Date: Aug 2013
Old 08-25-2013 , 13:53   Re: Help with a amx_showip
Reply With Quote #7

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
hpservers is offline
devilicioux
Veteran Member
Join Date: Jun 2013
Location: Delhi,India
Old 08-26-2013 , 04:35   Re: Help with a amx_showip
Reply With Quote #8

Quote:
Originally Posted by devilicioux View Post
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)
  

__________________
You keep bringing ANTICHRISTUS down .. He will rise again and kick asses !

#RespectList ANTICHRISTUS fysiks Bugsy

Most Common Errors You Can Encounter Every Now and Then
devilicioux is offline
akcaliberg
Senior Member
Join Date: Nov 2011
Location: Istanbul
Old 08-24-2013 , 19:46   Re: Help with a amx_showip
Reply With Quote #9

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) ) 

Last edited by akcaliberg; 08-24-2013 at 19:46.
akcaliberg is offline
hpservers
Junior Member
Join Date: Aug 2013
Old 08-24-2013 , 23:00   Re: Help with a amx_showip
Reply With Quote #10

Quote:
Originally Posted by akcaliberg View Post
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.

Last edited by hpservers; 08-24-2013 at 23:01.
hpservers is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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