Jump to content

Recommended Posts

Posted
3 hours ago, hyddro said:

It was, however this would require me to make a manual list of all commands which then needs to be updated everytime there's a new command created.

By utilizing C# custom attribute not only can I control the access requirements next to the command itself in the code, but I can also create dynamic player command lists which shows the player only what he can use.

Posted (edited)

All right, this is where I'm at right now.

- Player enters a command
- Clientside event OnPlayerCommand calls a remote event on server: OnPlayerCommand, then the clientside event deny the player's command from executing by CancelEventArgs.
- Server receives the call from client and starts checking if the player's admin level is sufficient to execute the command.

Basically this is where I'm at. How can I execute the command for the player if the permission check allows it?

 

EDIT: Will update this later on, I just discovered there's a server event for OnPlayercommand aswell.

Edited by introzen

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...