como saber si el jugador entro en un auto especifico, bueno veran hago un resource acerca de unos trabajos pero nose como detectar si el jugador esta en ese vehiculo y enviarle un mensaje en el chat
aqui los codigos
client
GUIEditor_Window = {}
GUIEditor_Button = {}
GUIEditor_Label = {}
GUIEditor_Progress = {}
GUIEditor_Window[1] = guiCreateWindow(0.3075,0.3183,0.4462,0.3317,"GUI Confirmacion Job",true)
guiWindowSetMovable(GUIEditor_Window[1],false)
guiWindowSetSizable(GUIEditor_Window[1],false)
GUIEditor_Button[1] = guiCreateButton(11,149,119,41,"Hacer Job",false,GUIEditor_Window[1])
GUIEditor_Button[2] = guiCreateButton(241,149,105,41,"Cancelar",false,GUIEditor_Window[1])
GUIEditor_Label[1] = guiCreateLabel(108,41,122,15,"Deseas Hacer el Job ?",false,GUIEditor_Window[1])
guiSetFont(GUIEditor_Label[1],"default-bold-small")
GUIEditor_Progress[1] = guiCreateProgressBar(105,67,186,41,false,GUIEditor_Window[1])
GUIEditor_Label[2] = guiCreateLabel(8,72,94,22,"Jobs Echos hoy :",false,GUIEditor_Window[1])
guiSetFont(GUIEditor_Label[2],"default-bold-small")
guiSetVisible(GUIEditor_Window[1],false)
showCursor(false)
marker = createMarker( 2000.640625, 1538.1500244141, 12.5, "cylinder", 1, 255, 255, 255, 120 )
createBlipAttachedTo( marker, 51 )
addEventHandler("onClientGUIClick", root,
function()
if ( source == GUIEditor_Button[2] ) then
guiSetVisible(GUIEditor_Window[1],false)
showCursor(false)
elseif ( source == GUIEditor_Button[1] ) then
triggerServerEvent("onWarpCar", getLocalPlayer())
end
end
)
function markerHit (hitPlayer)
if ( hitPlayer == localPlayer ) then
guiSetVisible (GUIEditor_Window[1], true)
showCursor (true)
end
end
addEventHandler ("onClientMarkerHit", marker, markerHit)
function markerLeave ()
guiSetVisible (GUIEditor_Window[1], false)
showCursor (false)
end
addEventHandler ("onClientMarkerLeave", marker, markerLeave)
server
addEvent("onWarpCar", true)
addEventHandler("onWarpCar", getRootElement(),
function()
auto = createVehicle( 411, 2039.9306640625, 1535.390625, 10.671875 )
setVehicleColor( auto, 0,0,0 )
warpPedIntoVehicle( source, auto )
end
)
addEventHandler("onVehicleEnter", getRootElement(),
function()
if (auto) then
outputChatBox("Ve al Blip que ai en el radar Si te sales del vehiculo perderas el job", source, 255, 255, 255, true)
end
end
)