Aboodealtikrity Posted September 26, 2016 Share Posted September 26, 2016 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 Link to comment
..:D&G:.. Posted September 27, 2016 Share Posted September 27, 2016 (edited) 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 Edited September 27, 2016 by ..:D&G:.. 1 Link to comment
Aboodealtikrity Posted September 27, 2016 Author Share Posted September 27, 2016 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 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 And how can i use getElementData in client can you give me just little example ... And thanks for your help Link to comment
Gravestone Posted September 27, 2016 Share Posted September 27, 2016 3 hours ago, Aboodealtikrity said: And how can i use getElementData in client can you give me just little example ... And thanks for your help getElementData(localPlayer, "dataName") Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now