Raised This Month: $12 Target: $400
 3% 

How to make this give permission on IP?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Apocalyman
Member
Join Date: Nov 2022
Old 11-26-2022 , 09:51   How to make this give permission on IP?
Reply With Quote #1

Theres this plugin for CS that is basically admins_manager but simplified. However, it puts the permissions on steam ID and I tried playing around with it change to it to IP but to no avail (I dont know how to program) it gives "Client with that name or userid not found" in the server console but for some reason with authid (steamid) it works perfectly fine. If someone knows how to make this IP please let me know! thank you!
Code link: https://pastebin.com/ZAdaL7br
Apocalyman is offline
CryWolf
Veteran Member
Join Date: Jul 2008
Location: Romania
Old 12-06-2022 , 03:30   Re: How to make this give permission on IP?
Reply With Quote #2

Code:
get_user_authid(plr, playerid, sizeof playerid - 1);
to ----->
PHP Code:
get_user_ip plrplayeridcharsmax (playerid) ); 
__________________
I dont walk trough this world with fear in my heart.
www.dark-arena.com L4D, CS1.6, CZ Servers
CryWolf is offline
Send a message via MSN to CryWolf Send a message via Yahoo to CryWolf
Apocalyman
Member
Join Date: Nov 2022
Old 08-07-2023 , 18:30   Re: How to make this give permission on IP?
Reply With Quote #3

Quote:
Originally Posted by CryWolf View Post
Code:
get_user_authid(plr, playerid, sizeof playerid - 1);
to ----->
PHP Code:
get_user_ip plrplayeridcharsmax (playerid) ); 
It doesnt work I tried
Apocalyman is offline
MrPickles
Senior Member
Join Date: Aug 2022
Location: Colombia
Old 08-07-2023 , 21:24   Re: How to make this give permission on IP?
Reply With Quote #4

Quote:
Originally Posted by CryWolf View Post
Code:
get_user_authid(plr, playerid, sizeof playerid - 1);
to ----->
PHP Code:
get_user_ip plrplayeridcharsmax (playerid) ); 
Did you know that this does the same thing perfectly? Charsmax is the size of - 1.

I don't think it's possible, you have to rebuild the code and match the ip before giving permissions, to give a range if or if the STEAMID has to be used, it is based on that, not the ip, you could try placing a condition before giving the permission checking if the ip is correct, like:

PHP Code:
    new plr str_to_num(Data);
 
    
get_user_name(idownerNamesizeof ownerName 1);
    
get_user_name(plrplayerNamesizeof playerName 1);
    
get_user_authid(plrplayeridsizeof playerid 1); 
 
    new 
szIP[32]
    
get_user_ip(plrszIPcharsmax(szIP), 1)

    if( 
equalszIP"188.212") )
    {
         
server_cmd("amx_addadmin ^"%s^" ^"%s^""playeridaccFlags[szKey]);
         
ColorChat(0"Owner ^4%s^1 Gave^4 %s^1 Access To^4 %s"ownerNameaccNames[szKey], playerName); 
         
server_cmd("amx_reloadadmins")
    }
    
menu_destroy(setLevel);
    return 
PLUGIN_HANDLED

Last edited by MrPickles; 08-07-2023 at 21:33.
MrPickles is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-07-2023 , 23:27   Re: How to make this give permission on IP?
Reply With Quote #5

There is no good reason to use IP instead of SteamID. Just use SteamID.
__________________
fysiks is offline
Apocalyman
Member
Join Date: Nov 2022
Old 08-08-2023 , 11:05   Re: How to make this give permission on IP?
Reply With Quote #6

Quote:
Originally Posted by MrPickles View Post
Did you know that this does the same thing perfectly? Charsmax is the size of - 1.

I don't think it's possible, you have to rebuild the code and match the ip before giving permissions, to give a range if or if the STEAMID has to be used, it is based on that, not the ip, you could try placing a condition before giving the permission checking if the ip is correct, like:

PHP Code:
    new plr str_to_num(Data);
 
    
get_user_name(idownerNamesizeof ownerName 1);
    
get_user_name(plrplayerNamesizeof playerName 1);
    
get_user_authid(plrplayeridsizeof playerid 1); 
 
    new 
szIP[32]
    
get_user_ip(plrszIPcharsmax(szIP), 1)

    if( 
equalszIP"188.212") )
    {
         
server_cmd("amx_addadmin ^"%s^" ^"%s^""playeridaccFlags[szKey]);
         
ColorChat(0"Owner ^4%s^1 Gave^4 %s^1 Access To^4 %s"ownerNameaccNames[szKey], playerName); 
         
server_cmd("amx_reloadadmins")
    }
    
menu_destroy(setLevel);
    return 
PLUGIN_HANDLED
If its that complicated then staying with steamID will probably be for the best. Do you perhaps know if its possible to add a remove admin section to the menu so I can remove permissions with it too and just not give?
Apocalyman is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-08-2023 , 23:05   Re: How to make this give permission on IP?
Reply With Quote #7

Removing admins isn't a functionality that is built into AMX Mod X. I think I recall people asking for something like this in the past, you should search around to see if you can find if there was any solutions implemented.
__________________
fysiks 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 04:11.


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