addEvent("adjTheJob", true)
addEventHandler("adjTheJob", root,
function(var)
if var == "Enter" then
local team = getPlayerTeam(client)
if team and getTeamName(team) == "Pizza" then
outputChatBox("You are already employed.", client, 255, 255, 0)
else
setPlayerTeam(client, getTeamFromName("Pizza"))
outputChatBox("You are now employed as a Pizzaboy!", client, 255, 255, 0)
end
elseif var == "Leave" then
setPlayerTeam(client, nil)
outputChatBox("You are now employed as a nothing!", client, 255, 255, 0)
end
end)
addCommandHandler("pizzahelp",
function()
outputChatBox("Pizza : In the pizza you as a pizzaboy have to deliver pizzas to locations and you get money by delivering the package.")
end)
GUIEditor = {
button = {},
window = {},
label = {}
}
addEventHandler("onClientResourceStart", resourceRoot,
function()
GUIEditor.window[1] = guiCreateWindow(308, 173, 399, 425, "Pizza ", false)
guiWindowSetMovable(GUIEditor.window[1], false)
guiWindowSetSizable(GUIEditor.window[1], false)
guiSetVisible(GUIEditor.window[1], false) --I seted as invisible *
GUIEditor.label[1] = guiCreateLabel(14, 31, 365, 63, " Well Stacked Pizza Co.", false, GUIEditor.window[1])
guiSetFont(GUIEditor.label[1], "sa-header")
guiLabelSetColor(GUIEditor.label[1], 255, 255, 2)
GUIEditor.label[2] = guiCreateLabel(44, 111, 320, 124, " Welcome to the Well Stacked Pizza Co.\n You can employ now as a pizzaboy!\n As a pizzaboy you have to deliver pizza's\n throughout the town.\n You will get money for that.\n\n For help type /pizzahelp", false, GUIEditor.window[1])
guiSetFont(GUIEditor.label[2], "clear-normal")
GUIEditor.button[1] = guiCreateButton(96, 247, 215, 42, "Accept ", false, GUIEditor.window[1])
guiSetFont(GUIEditor.button[1], "sa-header")
guiSetProperty(GUIEditor.button[1], "NormalTextColour", "C8FFFF00")
GUIEditor.button[2] = guiCreateButton(118, 307, 164, 36, "Leave ", false, GUIEditor.window[1])
guiSetFont(GUIEditor.button[2], "sa-header")
guiSetProperty(GUIEditor.button[2], "NormalTextColour", "C8FD0802")
GUIEditor.button[3] = guiCreateButton(122, 368, 150, 32, "Close", false, GUIEditor.window[1])
guiSetFont(GUIEditor.button[3], "sa-header")
end
)
pizzaguy = createPed(155, -1720.0400390625, 1356.6455078125, 7.1875, 121.70565795898)
pizzaMarker = createMarker(-1721.0263671875, 1355.9541015625, 6.1805019378662, "cylinder", 1.25, 0, 255, 0, 180)
createBlip(-1723.74, 1359.68, 6.18, 29, 2, 0, 0, 0, 255, 0, 200)
setElementFrozen(pizzaguy, true)
addEventHandler("onClientPedDamage", pizzaguy, cancelEvent)
addEventHandler("onClientMarkerHit", pizzaMarker,
function(player)
if player == localPlayer and not isPedInVehicle(player) then
guiSetVisible(GUIEditor.window[1], true)
showCursor(true)
end
end)
addEventHandler("onClientGUIClick", root,
function()
if source == GUIEditor.button[1] then
closeWind()
triggerServerEvent("adjTheJob", localPlayer, "Enter")
elseif source == GUIEditor.button[2] then
closeWind()
triggerServerEvent("adjTheJob", localPlayer, "Leave")
elseif source == GUIEditor.button[3] then
closeWind()
end
end)
function closeWind()
guiSetVisible(GUIEditor.window[1], false)
showCursor(false)
end