Nekem még mindig nem megy, ezt most te nyerted
Tessék itt a job-system.lua (csak írd felűl erre.)
wEmployment, jobList, bAcceptJob, bCancel = nil
local jessie = createPed( 12, 359.712890625, 173.5654296875, 1008.3893432617 )
--local jessie = createPed( 141, 359.7060, 173.5371, 1008.3828 )
setPedRotation( jessie, 272 )
setElementDimension( jessie, 5 )
setElementInterior( jessie , 3 )
setElementData( jessie, \"talk\", 1 )
setElementData( jessie, \"name\", \"Jessie Smith\" )
setPedAnimation ( jessie, \"INT_OFFICE\", \"OFF_Sit_Idle_Loop\", -1, true, false, false )
setPedFrozen(jessie, true)
function showEmploymentWindow()
-- Employment Tooltip
if(getResourceFromName(\"tooltips-system\"))then
triggerEvent(\"tooltips:showHelp\",getLocalPlayer(),7)
end
triggerServerEvent(\"onEmploymentServer\", getLocalPlayer())
local width, height = 300, 400
local scrWidth, scrHeight = guiGetScreenSize()
local x = scrWidth/2 - (width/2)
local y = scrHeight/2 - (height/2)
wEmployment = guiCreateStaticImage(x-100, y, 751, 400,\"kep.png\", false)
--dxDrawImage ( x, y, 751, 400, \'kep.png\' )
jobList = guiCreateGridList(0.05, 0.38, 0.45, 0.5, true, wEmployment)
local column = guiGridListAddColumn(jobList, \"Munka Neve\", 0.7)
-- TRUCKER
local row = guiGridListAddRow(jobList)
guiGridListSetItemText(jobList, row, column, \"Csomagszállító\", false, false)
-- BUS
local row = guiGridListAddRow(jobList)
guiGridListSetItemText(jobList, row, column, \"Busz sofőr\", false, false)
-- CITY MAINTENACE
local team = getPlayerTeam(getLocalPlayer())
local ftype = getElementData(team, \"type\")
if ftype ~= 2 then
end
local frakcio = getElementData(localPlayer, \"faction\")
if(frakcio == 52) then
local row = guiGridListAddRow(jobList)
guiGridListSetItemText(jobList, row, column, \"Szerelő - Frakcióval!\", false, false)
end
-- LOCKSMITH
local row = guiGridListAddRow(jobList)
guiGridListSetItemText(jobList, row, column, \"Lakatos\", false, false)
bAcceptJob = guiCreateLabel(0.57, 0.375, 0.23, 0.09, \"\", true, wEmployment)
bCancel = guiCreateLabel(0.57, 0.535, 0.23, 0.09, \"\", true, wEmployment)
showCursor(true)
addEventHandler(\"onClientGUIClick\", bAcceptJob, acceptJob)
addEventHandler(\"onClientGUIDoubleClick\", jobList, acceptJob)
addEventHandler(\"onClientGUIClick\", bCancel, cancelJob)
end
addEvent(\"onEmployment\", true)
addEventHandler(\"onEmployment\", getRootElement(), showEmploymentWindow)
function acceptJob(button, state)
if (button==\"left\") then
local row, col = guiGridListGetSelectedItem(jobList)
local job = getElementData(getLocalPlayer(), \"job\")
if (row==-1) or (col==-1) then
outputChatBox(\"Válassz munkát.\", 255, 0, 0)
elseif (job>0) then
outputChatBox(\"Már van munkád, elött vedd fel.\", 255, 0, 0)
else
local job = 0
local jobtext = guiGridListGetItemText(jobList, guiGridListGetSelectedItem(jobList), 1)
if ( jobtext==\"Delivery Driver\" or jobtext==\"Taxi Driver\" or jobtext==\"Bus Driver\" ) then -- Driving job, requires the license
local carlicense = getElementData(getLocalPlayer(), \"license.car\")
if (carlicense~=1) then
outputChatBox(\"You require a drivers license to do this job.\", 255, 0, 0)
return
end
end
if (jobtext==\"Csomagszállító\") then
displayTruckerJob()
job = 1
elseif (jobtext==\"Taxi sofőr\") then
job = 2
displayTaxiJob()
elseif (jobtext==\"Busz sofőr\") then
job = 3
displayBusJob()
elseif (jobtext==\"Közterület Fenntartó\") then
job = 4
elseif (jobtext==\"Szerelő - Frakcióval!\") then
displayMechanicJob()
triggerServerEvent(\"giveMechanicJob\", getLocalPlayer())
job = 5
elseif (jobtext==\"Lakatos\") then
displayLocksmithJob()
job = 6
end
triggerServerEvent(\"acceptJob\", getLocalPlayer(), job)
destroyElement(jobList)
destroyElement(bAcceptJob)
destroyElement(bCancel)
destroyElement(wEmployment)
wEmployment, jobList, bAcceptJob, bCancel = nil, nil, nil, nil
showCursor(false)
end
end
end
function cancelJob(button, state)
if (source==bCancel) and (button==\"left\") then
destroyElement(jobList)
destroyElement(bAcceptJob)
destroyElement(bCancel)
destroyElement(wEmployment)
wEmployment, jobList, bAcceptJob, bCancel = nil, nil, nil, nil
showCursor(false)
end
end