Eren07 Posted July 3, 2014 Share Posted July 3, 2014 Guys I've Occupation on my scoreboard and I want to change it whenever I want in admin panel Set Occupation System: http://i.imgur.com/81rIQCr.png Scoreboard: http://i.imgur.com/QjRPpMq.png Server: function setOccupation(player, occupation) setElementData(player, "Occupation") outputChatBox("You have succesfully set "..getPlayerName(player).."'s occupation to "..occupation, client, 0, 255, 0) outputChatBox(getPlayerName(client).. " has set your occupation to "..occupation, player, 255, 255, 0) end addEvent("AdminPanel.setOccupation", true) addEventHandler("AdminPanel.setOccupation", root, setOccupation) Client: function setOccupation() if (not player) then outputChatBox(errorString, 255, 0, 0) return end local occupation = guiGetText(aEdit [6]) if (occupation == "") then return end logString = getPlayerName(localPlayer).. " has changed "..getPlayerName(player).."'s occupation to "..occupation triggerServerEvent("AdminPanel.insertAdminLog", root, logString, player) triggerServerEvent("AdminPanel.setOccupation", root, player, occupation) end Link to comment
MTA Team botder Posted July 3, 2014 MTA Team Share Posted July 3, 2014 setElementData(player, "Occupation") You are missing the value parameter: occupation Replace with: setElementData(player, "Occupation", occupation) Link to comment
justn Posted July 3, 2014 Share Posted July 3, 2014 Where is "player" defined in the client-side ? Link to comment
Eren07 Posted July 4, 2014 Author Share Posted July 4, 2014 I can't find it. I'm made that function by looking another function. it is setMoney. This is almost same of it. Link to comment
Eren07 Posted July 4, 2014 Author Share Posted July 4, 2014 Any debug errors? How I can see it if there is? Link to comment
novo Posted July 4, 2014 Share Posted July 4, 2014 By using the command /debugscript 3 https://wiki.multitheftauto.com/wiki/Se ... ebugscript 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