Jump to content

Job Transporte de Droga


SimmerMemer

Recommended Posts

Hola, estoy haciendo un Job de Transporte de Droga :S Y me quedé trabado en una parte:

client:

addEventHandler("onClientResourceStart", resourceRoot, function() 
    ventanaJob = guiCreateWindow(605, 103, 383, 382, "Trabajito...", false) 
    guiWindowSetSizable(ventanaJob, false) 
  
    memo = guiCreateMemo(35, 38, 248, 75, "Hey! ¿Me harías un trabajito? Es sólo hasta Bayside, un garage..\n\nSi aceptas, podrías ganar $20 grandes.", false, ventanaJob) 
    guiMemoSetReadOnly(memo, true) 
    botonSi = guiCreateButton(10, 314, 90, 38, "Supongo que puedo", false, ventanaJob) 
    botonNo = guiCreateButton(283, 314, 90, 38, "No, gracias", false, ventanaJob)     
  
addEventHandler("onClientGUIClick", guiRoot, aceptar) 
  
guiSetVisible(ventanaJob, false) 
showCursor(false) 
  
end 
) 
  
function aceptar (button,state) 
if (button == "left") then 
        if(source == botonSi) then 
    triggerServerEvent("onClientAccept", localPlayer, "aceptar") 
        elseif(source == botonNo) then 
    triggerServerEvent("onClientAccept", localPlayer, "cerrar") 
     
end 
end 
end 
  
addEvent("CerrarJob",true) 
addEventHandler("CerrarJob",root, 
function() 
guiSetVisible(ventanaJob,not guiGetVisible(ventanaJob)) 
showCursor(not isCursorShowing()) 
end) 

server:

function jobAccept () 
    car = createVehicle (440, -1295.2314453125, 2507.701171875, 87.013702392578) 
    warpPedIntoVehicle(source, car) 
    markerLS = createMarker (-2258.43359375, 2385.3662109375, 4.9885883331299, "cylinder", 2, 255, 0, 0, 255) 
    blipLS = createBlipAttachedTo (markerLS, 40) 
end 
addEvent ("onClientAccept", true) 
addEventHandler ("onClientAccept", root, jobAccept) 
  
function moneyLS (attacker) 
     if (attacker) and (attacker ~= source) then 
     givePlayerMoney(attacker, 20000) 
     destroyElement(markerLS) 
     destroyElement(blipLS) 
     destroyElement(car) 
end 
end 
addEventHandler( "onMarkerHit", root, moneyLS ) 
  

Saludos.

Link to comment

server:

  
function jobAccept () 
    car = createVehicle (440, -1295.2314453125, 2507.701171875, 87.013702392578) 
    warpPedIntoVehicle(source, car) 
    markerLS = createMarker (-2258.43359375, 2385.3662109375, 4.9885883331299, "cylinder", 2, 255, 0, 0, 255) 
    blipLS = createBlipAttachedTo (markerLS, 40) 
end 
addEvent ("onClientAccept", true) 
addEventHandler ("onClientAccept", root, jobAccept) 
  
function moneyLS (attacker) 
     if (attacker) and (attacker ~= source) then 
     givePlayerMoney(attacker, 20000) 
     destroyElement(markerLS) 
     destroyElement(blipLS) 
     destroyElement(car) 
end 
end 
  
local marker = createMarker ( -1295.763671875, 2509.4091796875, 87.022048950195, "cylinder", 1.0, 255, 0, 0, 255) 
  
  
addEventHandler("onMarkerHit", marker, 
function(E) 
if(E) and getElementType(E) == "player" then 
triggerClientEvent(E,"CerrarJob",E) 
end 
end) 

client:

addEventHandler("onClientResourceStart", resourceRoot, function() 
    ventanaJob = guiCreateWindow(605, 103, 383, 382, "Trabajito...", false) 
    guiWindowSetSizable(ventanaJob, false) 
  
    memo = guiCreateMemo(35, 38, 248, 75, "Hey! ¿Me harías un trabajito? Es sólo hasta Bayside, un garage..\n\nSi aceptas, podrías ganar $20 grandes.", false, ventanaJob) 
    guiMemoSetReadOnly(memo, true) 
    botonSi = guiCreateButton(10, 314, 90, 38, "Supongo que puedo", false, ventanaJob) 
    botonNo = guiCreateButton(283, 314, 90, 38, "No, gracias", false, ventanaJob)     
  
addEventHandler("onClientGUIClick", guiRoot, aceptar) 
  
guiSetVisible(ventanaJob, false) 
showCursor(false) 
  
end 
) 
  
function aceptar (button,state) 
if (button == "left") then 
        if(source == botonSi) then 
    triggerServerEvent("onClientAccept", localPlayer, "botonSi") 
        elseif(source == botonNo) then 
    triggerServerEvent("onClientAccept", localPlayer, "bontonNo") 
     
end 
end 
end 
  
addEvent("CerrarJob",true) 
addEventHandler("CerrarJob",root, 
function() 
guiSetVisible(ventanaJob,not guiGetVisible(ventanaJob)) 
showCursor(not isCursorShowing()) 
end) 

Conseguí abrir la GUI pero ahora, al negarme a trabajar me aparece el camión de todas formas.

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...