Show IP plugin help
This is my first plugin which shows the IPs of the players in the server and I can't continue working on it before I get what's wrong with this code :/ The idea is to read from an .ini file and if there's a line:
Code:
"stk" "1.2.3.4"and the admin is not with that nickname the plugin will show different IP than the real one. The problem is that it still shows my real IP when I test it. Hope I didn't make some terrible mistakes :oops: PHP Code:
|
Re: Show IP plugin help
I just looked over it real quick-like and noticed this...
In the client_connect routine, you say 'if player IS an admin, substitute a fake IP'. Code:
if(is_user_admin(id))Code:
|
Re: Show IP plugin help
In client_connect I check whether the player who's connecting to the server is an admin if he/she is an admin then the plugin reads show_ip.ini and compares the name and the ip/steamid (I haven't added this yet)
But in cmd_showip i check whether the person which is calling the command is amin or not :) I want other admins to be able to see player's (including admins) real IPs/SteamIDs. Thank you for pointing out my mistake regarding the efficiency of the plugin :P |
Re: Show IP plugin help
You verify admin names and IP's in users.ini and anyone can see your IP address by typing "status" in the console.
|
Re: Show IP plugin help
Yeah I know that but I couldn't block it. I guess it's client-side cmd :/
Anyway since it's my first plugin (excluding some say /test ones :D) I've just wanted to know what's wrong so that I can avoid such mistake in future "ideas" :) |
Re: Show IP plugin help
Maybe a typo, and probably not your problem, but if your .ini is set up as you show with "name" "IP", then you're parsing the parameters backwards with
parse(read_data,parsed_admin_ip,31,parsed_admin_name,31. Also, you are only using 1 variable array for the real ip (admin_real_ip). If you don't want them all to be the same, then you need to set up a multidimentional array like admin_real_ip[33][32]. Then put the IP in admin_real_ip[id] and test with if(equal(ip,admin_real_ip[id])). |
Re: Show IP plugin help
Ahh I see :) Thanks again Vet! I've seen these multidimentional arrays in some plugins but I wasn't sure how exactly to use them. Now I got it. I'll try to fix the code when I have some time but the plugin won't be useful at all if it's impossible to block "status". Thank you guys :>
|
| All times are GMT -4. The time now is 11:02. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.