 |
|
Member
|

08-08-2023
, 11:05
Re: How to make this give permission on IP?
|
#5
|
Quote:
Originally Posted by MrPickles
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(id, ownerName, sizeof ownerName - 1);
get_user_name(plr, playerName, sizeof playerName - 1);
get_user_authid(plr, playerid, sizeof playerid - 1);
new szIP[32]
get_user_ip(plr, szIP, charsmax(szIP), 1)
if( equal( szIP, "188.212", 7 ) )
{
server_cmd("amx_addadmin ^"%s^" ^"%s^"", playerid, accFlags[szKey]);
ColorChat(0, "Owner ^4%s^1 Gave^4 %s^1 Access To^4 %s", ownerName, accNames[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?
|
|
|
|