Raised This Month: $ Target: $400
 0% 

How to make this give permission on IP?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Apocalyman
Member
Join Date: Nov 2022
Old 08-08-2023 , 11:05   Re: How to make this give permission on IP?
Reply With Quote #5

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
 



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:35.


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