Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Client--
- GUIEditor = {
- gridlist = {},
- window = {},
- button = {}
- }
- thePickup = createPickup(567.61682, 405.20648, 18.92969, 3, 1275)
- function theGUI(thePickup, matchingDimension)
- if (getTeamName(getPlayerTeam(localPlayer) ~= "Police")) then
- guiSetVisible(GUIEditor.window[1], true)
- showCursor(true)
- outputChatBox("Please pick a uniform.", 255, 255, 255, true)
- --Window
- GUIEditor.window[1] = guiCreateWindow(427, 233, 276, 197, "Police Uniforms", false)
- guiWindowSetSizable(GUIEditor.window[1], false)
- --Gridlist
- GUIEditor.gridlist[1] = guiCreateGridList(49, 34, 170, 117, false, GUIEditor.window[1])
- columnA = guiGridListAddColumn(GUIEditor.gridlist[1], "Uniforms", 0.9)
- guiGridListAddRow(GUIEditor.gridlist[1])
- row1 = guiGridListAddRow(GUIEditor.gridlist[1])
- row2 = guiGridListAddRow(GUIEditor.gridlist[1])
- row3 = guiGridListAddRow(GUIEditor.gridlist[1])
- row4 = guiGridListAddRow(GUIEditor.gridlist[1])
- row5 = guiGridListAddRow(GUIEditor.gridlist[1])
- guiGridListSetItemText(GUIEditor.gridlist[1], row1, columnA, "Los Santos Cop", false, false)
- guiGridListSetItemText(GUIEditor.gridlist[1], row2, columnA, "San Fierro Cop", false, false)
- guiGridListSetItemText(GUIEditor.gridlist[1], row3, columnA, "Las Venturas Cop", false, false)
- guiGridListSetItemText(GUIEditor.gridlist[1], row4, columnA, "Deputy Sheriff 1", false, false)
- guiGridListSetItemText(GUIEditor.gridlist[1], row5, columnA, "Deputy Sheriff 2", false, false)
- --Buttons
- GUIEditor.button[1] = guiCreateButton(171, 155, 87, 32, "Close", false, GUIEditor.window[1])
- guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA")
- GUIEditor.button[2] = guiCreateButton(10, 156, 87, 31, "Take uniform", false, GUIEditor.window[1])
- guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA")
- else
- outputChatBox("#ff0000You are not a cop to use this pickup.", 255, 0, 0, true)
- end
- end
- addEventHandler("onClientPlayerPickupHit", localPlayer, theGUI)
- --Close GUI
- --[[ function closeGUI()
- if (source == GUIEditor.button[1]) then
- guiSetVisible(GUIEditor.window[1], false)
- showCursor(false)
- end
- end
- addEventHandler("onClientGUIClick", guiRoot, closeGUI) ]]
- function closeUI()
- guiSetVisible(GUIEditor.window[1], false)
- showCursor(false)
- end
- addEventHandler("onClientGUIClick", GUIEditor.button[1], closeUI, true) -- Remove this line, and the function if closing it doesn't work.
- --Set Skin
- function setPlayerSkin()
- if (source == GUIEditor.button[2]) then
- local row, col = guiGridListGetSelectedItem(GUIEditor.gridlist[1])
- local skin = guiGridListGetItemText(GUIEditor.gridlist[1], row, col)
- outputChatBox("Your uniform has been successfully changed")
- fadeCamera(false, 1.0, 0, 0, 0)
- setTimer(timer, 1000, 1)
- playSFX("script", 94, 2, false)
- if row == row1 then
- triggerServerEvent("skinID280", localPlayer)
- elseif row == row2 then
- triggerServerEvent("skinID281", localPlayer)
- elseif row == row3 then
- triggerServerEvent("skinID282", localPlayer)
- elseif row == row4 then
- triggerServerEvent("skinID283", localPlayer)
- elseif row == row5 then
- triggerServerEvent("skinID288", localPlayer)
- end
- end
- end
- addEventHandler("onClientGUIClick", root, setPlayerSkin)
- --Server--
- function skinID280 (player)
- setElementModel(player, 280)
- end
- function skinID281 (player)
- setElementModel(player, 281)
- end
- function skinID282 (player)
- setElementModel(player, 282)
- end
- function skinID283 (player)
- setElementModel(player, 283)
- end
- function skinID288 (player)
- setElementModel(player, 288)
- end
- addEvent("skinID280", true)
- addEvent("skinID281", true)
- addEvent("skinID282", true)
- addEvent("skinID283", true)
- addEvent("skinID288", true)
- addEventHandler("skinID280", root, skinID280)
- addEventHandler("skinID281", root, skinID281)
- addEventHandler("skinID282", root, skinID282)
- addEventHandler("skinID283", root, skinID283)
- addEventHandler("skinID288", root, skinID288)
Advertisement
Add Comment
Please, Sign In to add comment