wEmployment, jobList, bAcceptJob, bCancel = nil
local jessie = createPed( 12, 359.21789, 173.099609, 1008.3893432617 )
--local jessie = createPed( 141, 359.7060, 173.5371, 1008.3828 )
setPedRotation( jessie, 271 )
setElementDimension( jessie, 8 )
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 = guiCreateWindow(x, y, width, height, \"Munkanélküli Szerver\", false)
jobList = guiCreateGridList(0.05, 0.05, 0.9, 0.8, true, wEmployment)
local column = guiGridListAddColumn(jobList, \"Munka Neve\", 0.9)
-- TRUCKER
local row = guiGridListAddRow(jobList)
guiGridListSetItemText(jobList, row, column, \"Csomagszállító\", false, false)
-- TAXI
local row = guiGridListAddRow(jobList)
guiGridListSetItemText(jobList, row, column, \"Taxi sofőr\", 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
local rowmaintenance = guiGridListAddRow(jobList)
guiGridListSetItemText(jobList, rowmaintenance, column, \"Közterület Fenntartó\", false, false)
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 = guiCreateButton(0.05, 0.85, 0.45, 0.1, \"Munka Felvétele\", true, wEmployment)
bCancel = guiCreateButton(0.5, 0.85, 0.45, 0.1, \"Bezárás\", 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
nem jó
Szerintem mindent jól csináltam
Dupla üzenet összevonva ekkor: 2014. november 05. - 20:48:53
Én tévedtem, Jó lett, köszi!