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

give access only in some cases


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 02-08-2019 , 16:20   give access only in some cases
Reply With Quote #1

is there a possibilty to give to someone access only in some cases?
lets give an example, amx_slay, if you are a normal player you dont have access, but what if i add in a vipmenu the option to slay someone, am i able to give him permission to slay him without giving him slay flag?
__________________
a simple act of caring creates an endless ripple.
Nutu_ is offline
thEsp
BANNED
Join Date: Aug 2017
Old 02-08-2019 , 16:27   Re: give access only in some cases
Reply With Quote #2

Use custom flags for command as well for VIP (for instance, 'z' is default for players,give VIPs 'x' flag)
thEsp is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 02-08-2019 , 16:29   Re: give access only in some cases
Reply With Quote #3

in plmenu.sma change an if statement on line 508 from this
PHP Code:
if (!cmd_access(idlevelcid1))
        return 
PLUGIN_HANDLED 
to this
PHP Code:
//global variable
can_slay[id]

if (!
cmd_access(idlevelcid1) && can_slay[id])
        return 
PLUGIN_HANDLED

public client_disconnet(id) {
        
can_slay[id] = 0

all you have to do now is create some sort of way to change the can_slay[index] variable to true on certain occasions.
DjSoftero is offline
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 02-08-2019 , 16:30   Re: give access only in some cases
Reply With Quote #4

well, i think i got this but will the VIP be able to use amx_slay? cuz i dont want give him that permission, only when he uses it by vipmenu
EDIT: djsoftero, i just gave amx_slay as an example, that's not the command i'd like to give
__________________
a simple act of caring creates an endless ripple.

Last edited by Nutu_; 02-08-2019 at 16:32.
Nutu_ is offline
thEsp
BANNED
Join Date: Aug 2017
Old 02-08-2019 , 16:33   Re: give access only in some cases
Reply With Quote #5

Quote:
Originally Posted by Nutu_ View Post
well, i think i got this but will the VIP be able to use amx_slay? cuz i dont want give him that permission, only when he uses it by vipmenu
When you chose a item it automatically writes to client's cmd "slay ...".
But you can use a boolean which checks if command is executed by menu, switch it to true on
PHP Code:
menu_display 
and switch it to false on
PHP Code:
menu_destroy 
prop.
thEsp is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 02-08-2019 , 16:39   Re: give access only in some cases
Reply With Quote #6

Quote:
Originally Posted by Nutu_ View Post
I just gave amx_slay as an example, that's not the command I'd like to give
Apply the same principle to other commands.
DjSoftero is offline
Old 02-08-2019, 17:25
Ghosted
This message has been deleted by Ghosted. Reason: BLIND
Old 02-08-2019, 17:32
DjSoftero
This message has been deleted by DjSoftero. Reason: .
Reply



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 00:30.


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