Jump to content

Set Occupation on Admin Panel


Eren07

Recommended Posts

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

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