Jump to content

Admin Panel ...


Aboodealtikrity

Recommended Posts

Hello guys ...

Because i left learning of scripting for a long time now i forgot everything so im trying to remember anything ...

now im scripting admin panel but the problem now i want to make an access for panel if the player admin so he can open the panel by bindKey but the script will see the admin level from db in mysql like 

if (data['admin'] == 'Admin') then 
  E.g open admin panel 
  call it from client 
  end

and thanks for help because im noob and noob :P

Link to comment

If you don't know the function that opens the panel so I can put it in the code, what do you want me to add to the code?

When you find the client side function, make sure it has an event handler

addEvent()

and

addEventHandler()

Then use that event handler to trigger it in server side (because mysql is server side, but if you do setElementData to set the admin level of a player and getElementData to get the admin level then you can use that instead in both client and server)

So use this to call the event that opens the panel:

triggerClientEvent ( thePlayer, "thePanelOpeningEvent", thePlayer )

 

Hope this helps :D

 

Edited by ..:D&G:..
  • Like 1
Link to comment
48 minutes ago, ..:D&G:.. said:

If you don't know the function that opens the panel so I can put it in the code, what do you want me to add to the code?

When you find the client side function, make sure it has an event handler


addEvent()

and


addEventHandler()

Then use that event handler to trigger it in server side (because mysql is server side, but if you do setElementData to set the admin level of a player and getElementData to get the admin level then you can use that instead in both client and server)

So use this to call the event that opens the panel:


triggerClientEvent ( thePlayer, "thePanelOpeningEvent", thePlayer )

 

Hope this helps :D

Thanks i ve tried this beforw so tell me how to make bindkey with event handler ?

50 minutes ago, ..:D&G:.. said:

If you don't know the function that opens the panel so I can put it in the code, what do you want me to add to the code?

When you find the client side function, make sure it has an event handler


addEvent()

and


addEventHandler()

Then use that event handler to trigger it in server side (because mysql is server side, but if you do setElementData to set the admin level of a player and getElementData to get the admin level then you can use that instead in both client and server)

So use this to call the event that opens the panel:


triggerClientEvent ( thePlayer, "thePanelOpeningEvent", thePlayer )

 

Hope this helps :D

 

And how can i use getElementData in client can you give me just little example ... And thanks for your help

Link to comment

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