Search the Community
Showing results for tags 'trucker'.
-
local blip = createBlip ( 89.8653, -269.70767, 1.278, 58 ) local jobped = createPed ( 202, 122.80000305176, -296.20001220703, 1.6000000238419, 90.0041198 ) local getjobmarker = createMarker ( 122.69999694824, -294.29998779297, 0.60000002384186, "cylinder", 3, 255, 255, 0, 85 ) local destinations = { { 1456, 2877.8999023438, 9.8000001907349 }; { 2850.1000976563, 1209.8000488281, 9.6999998092651 }; { 2827.1000976563, 1383.5, 9.8000001907349 }; { 2495.5, 2773.3000488281, 9.8000001907349 }; { -2130.6999511719, -80.099998474121, 34.299999237061 }; { -2643.6000976563, 1373, 5.9000000953674 }; { -2747.1000976563, -280, 6 }; { 2339.97876, 2036.61914, 10.42309 }; { 1069.39612, 1226.58252, 10.23718 }; } function unpackDestinations () return unpack ( destinations [ math.random ( #destinations ) ] ) end addEventHandler("onResourceStart",getjobmarker, function(p) if p == lp and not isPedInVehicle(lp) then guiSetVisible(getjobmarker,true) showCursor(true) end end) -- Trucker Job GUI -- sx,sy = guiGetScreenSize() lp = getLocalPlayer() mr = math.random(1,2) jobwindow = guiCreateWindow(360, 190, 333, 388, "Trucker Job", false) guiWindowSetSizable(jobwindow, false) guiSetAlpha(jobwindow, 1.00) memo = guiCreateMemo(9, 18, 314, 224, "Hola, para ser un camionero debes hacer clic en el botón de aceptar a continuación, cuando aceptas el trabajo, debes ir al camión ubicado en el radar, cuando llegues, recibirás dinero. Si quiere dejar este trabajo, primero debe tener el trabajo, luego volver al marcador del trabajo del camionero y hará clic en el botón Salir del trabajo. Buena suerte.", false, jobwindow) label1 = guiCreateLabel(4, 273, 329, 15, "________________________________________________________", false, jobwindow) label = guiCreateLabel(10, 246, 252, 17, "ToRnix~|nR", false, jobwindow) guiSetFont(label, "default-bold-small") takebutton = guiCreateButton(14, 315, 140, 42, "Accept", false, jobwindow) guiSetProperty(takebutton, "NormalTextColour", "FFAAAAAA") cancbutton = guiCreateButton(180, 315, 137, 42, "Close", false, jobwindow) guiSetProperty(cancbutton, "NormalTextColour", "FFAAAAAA") guiSetVisible (jobwindow,false) guiMemoSetReadOnly(memo,true) guiWindowSetMovable (jobwindow,true ) guiWindowSetSizable (jobwindow,false ) -- The Continue or Not Gui -- sx, sy = guiGetScreenSize() lp = getLocalPlayer() mr = math.random(1,2) destinationwindow = guiCreateWindow(327, 219, 339, 365, "Trucker Job", false) guiSetAlpha(destinationwindow, 1.00) destinationmemo = guiCreateMemo(9, 18, 320, 227, "Oye, entonces con este gui, puedes elegir si quieres continuar con el trabajo del camionero o no, es tu elección, :)", false, destinationwindow) label1 = guiCreateLabel(9, 250, 283, 25, "¿Quieres continuar con el trabajo de camionero ?", false, destinationwindow) guiSetFont(label1, "default-bold-small") label2 = guiCreateLabel(0, 275, 334, 21, "_____________________________________________________________________", false, destinationwindow) continue = guiCreateButton(17, 309, 138, 37, "Continue", false, destinationwindow) guiSetProperty(continue, "NormalTextColour", "FFAAAAAA") close = guiCreateButton(192, 308, 127, 38, "Close", false, destinationwindow) guiSetProperty(close, "NormalTextColour", "FFAAAAAA") guiMemoSetReadOnly(destinationmemo, true) guiWindowSetSizable(destinationwindow, false) guiWindowSetMovable(destinationwindow, true) guiSetVisible (destinationwindow, false) -- addEventHandler("onClientGUIClick",jobwindow, function(b,thePlayer) if b == "left" then if source == takebutton then outputChatBox ("Ahora eres camionero",255,255,0, true) outputChatBox ("Ahora vuelve al marcador para ir a trabajar",0,255,0, true) guiSetVisible(jobwindow,false) guiSetVisible(takebutton,false) triggerServerEvent ( "doSomething", lp) showCursor(false) -- onduty = guiCreateButton(14, 288, 303, 27, "Go On Duty", false, jobwindow) guiSetProperty(onduty, "NormalTextColour", "FFAAAAAA") -- quitbutton = guiCreateButton(14, 315, 140, 42, "Quit", false, jobwindow) guiSetProperty(quitbutton, "NormalTextColour", "FFAAAAAA") -- end end end ) addEventHandler("onClientGUIClick",jobwindow, function(b,thePlayer) if b == "left" then if source == cancbutton then guiSetVisible(jobwindow,false) showCursor(false) end end end) addEventHandler("onClientGUIClick",jobwindow, function(b,thePlayer) if b == "left" then if source == quitbutton then outputChatBox ("Ya no eres camionero",255,0,0, true) guiSetVisible(jobwindow,false) guiSetVisible(quitbutton,false) guiSetVisible(onduty,false) guiSetVisible(offduty,false) guiSetVisible(cancbutton,true) guiSetVisible(takebutton,true) triggerServerEvent ( "doSomethin", lp) showCursor(false) destroyElement ( truckerMarker ) destroyElement ( truckerBlip ) end end end) addEventHandler("onClientGUIClick",jobwindow, function(b,thePlayer) if b == "left" then if source == onduty then outputChatBox ("Ahora está de servicio, regrese en el marcador para irse de servicio",source,0,255,0, true) triggerServerEvent ( "HaveTruckerJob", lp) triggerServerEvent ( "sum", lp) guiSetVisible(jobwindow,false) guiSetVisible(quitbutton,true) guiSetVisible(takebutton,false) guiSetVisible(offduty,true) guiSetVisible(onduty,false) guiSetVisible(cancbutton,true) showCursor(false) -- offduty = guiCreateButton(14, 288, 303, 27, "Salir de servicio", false, jobwindow) guiSetProperty(offduty, "NormalTextColour", "FFAAAAAA") -- end end end) addEventHandler("onClientGUIClick",jobwindow, function(b,thePlayer) if b == "left" then if source == offduty then outputChatBox ("Ahora estás fuera de servicio, regresa en el marcador para ir a trabajar",source,255,0,0, true) guiSetVisible(jobwindow,false) guiSetVisible(quitbutton,true) guiSetVisible(takebutton,false) guiSetVisible(offduty,false) guiSetVisible(onduty,true) guiSetVisible(cancbutton,true) showCursor(false) destroyElement ( truckerMarker ) destroyElement ( truckerBlip ) end end end) addEventHandler("onClientMarkerHit",getjobmarker, function(p) if p == lp and not isPedInVehicle(lp) then guiSetVisible(jobwindow,true) showCursor(true) end end ) addEvent("HaveTruckerJob", true) function createDestinations () x, y, z = unpackDestinations () truckerMarker = createMarker ( x, y, z, "cylinder", 3, 255, 51, 102, 85, localPlayer ) truckerBlip = createBlipAttachedTo ( truckerMarker, 51,nil, nil, nil, nil, nil, nil, nil, localPlayer ) end addEventHandler ( "HaveTruckerJob", root, createDestinations ) addEventHandler ( "onClientMarkerHit", root, function ( hitElement ) if source == truckerMarker and localPlayer == hitElement then local vehicle = getPedOccupiedVehicle ( localPlayer ) if vehicle and getElementModel(vehicle) == 514 then triggerServerEvent ( "givePlayerPay", localPlayer ) destroyElement ( truckerMarker ) if isElement(truckerBlip) then -- very important destroyElement ( truckerBlip ) end guiSetVisible(destinationwindow,true) showCursor(true) triggerEvent ( "createTruckerEvent", localPlayer ) end end end) addEventHandler ( "onClientPedDamage", resourceRoot, function () cancelEvent () end ) function exitforcar ( ) if isElement(truckerBlip) then -- very important destroyElement ( truckerBlip ) end if isElement(truckerMarker) then destroyElement ( truckerMarker ) end end addEventHandler ( "onClientPlayerVehicleExit", root, exitforcar ) ------------------------------- function wastedd ( ) if isElement(truckerBlip) then -- very important destroyElement ( truckerBlip ) end if isElement(truckerMarker) then destroyElement ( truckerMarker ) end end addEventHandler ( "OnClientPlayerWasted", getRootElement(), wastedd ) -- Destination Functions -- addEventHandler("onClientGUIClick",destinationwindow, function(b,thePlayer) if b == "left" then if source == continue then x, y, z = unpackDestinations () truckerMarker = createMarker ( x, y, z, "cylinder", 3, 255, 51, 102, 85, localPlayer ) truckerBlip = createBlipAttachedTo ( truckerMarker, 51,nil, nil, nil, nil, nil, nil, nil, localPlayer ) guiSetVisible(destinationwindow,false) showCursor(false) elseif source == close then guiSetVisible(destinationwindow,false) showCursor(false) end end end)