leoMTA_xD Posted April 29, 2012 Share Posted April 29, 2012 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 ) Link to comment
Edikosh998 Posted April 29, 2012 Share Posted April 29, 2012 (edited) addEventHandler("onVehicleEnter", getRootElement(), function(player) if source == auto then outputChatBox("Ve al Blip que HAY en el radar Si te sales del vehiculo perderas el job", player, 255, 255, 255, true) -- Un error ortografico en un outputChatBox.. end end ) Edited April 29, 2012 by Guest Link to comment
leoMTA_xD Posted April 29, 2012 Author Share Posted April 29, 2012 Sigue sin aparecer el mensaje Link to comment
Edikosh998 Posted April 29, 2012 Share Posted April 29, 2012 Che pero igual no es mas facil hacer : addEvent("onWarpCar", true) addEventHandler("onWarpCar", getRootElement(), function() auto = createVehicle( 411, 2039.9306640625, 1535.390625, 10.671875 ) setVehicleColor( auto, 0,0,0 ) warpPedIntoVehicle( source, auto ) outputChatBox("Ve al Blip que HAY en el radar Si te sales del vehiculo perderas el job", source, 255, 255, 255, true) end ) Si total ya lo warpeas al Vehiculo AAAAA PUSISTE SOURCE EN EL Vehicle Enter, tenes que poner player (Ni me habia fijado sorry)...es el primer parametro del evento fijate. PD : Ahi edite el otro mensaje por si queres usar el vehicle enter. Link to comment
leoMTA_xD Posted April 29, 2012 Author Share Posted April 29, 2012 que esta mal ? quiero que si esta en tal cuidad aparesca un blip en esa ciudad pero no se como estructurarlo aqui el codigo addEvent("onWarpCar", true) addEventHandler("onWarpCar", getRootElement(), function() auto = createVehicle( 411, 2039.9306640625, 1535.390625, 10.671875 ) setVehicleColor( auto, 0,0,0 ) warpPedIntoVehicle( source, auto ) outputChatBox("#FF0000[sERVER]#000000Ve al Blip que HAY en el radar Si te sales del vehiculo perderas el job", source, 0, 0, 0, true) local city = getZoneName ( x, y, z, true ) if ( city == Las Venturas ) then createBlip( 2474.6201171875, 1024.251953125, 10.8203125, 37 ) end end ) Link to comment
Edikosh998 Posted April 29, 2012 Share Posted April 29, 2012 Pone Las Venturas entre comillas Link to comment
leoMTA_xD Posted April 29, 2012 Author Share Posted April 29, 2012 el debugscript me dice bad argument getZoneMap addEvent("onWarpCar", true) addEventHandler("onWarpCar", getRootElement(), function() auto = createVehicle( 411, 2039.9306640625, 1535.390625, 10.671875 ) setVehicleColor( auto, 0,0,0 ) warpPedIntoVehicle( source, auto ) outputChatBox("#FF0000[sERVER]#000000Ve al Blip que HAY en el radar Si te sales del vehiculo perderas el job", source, 0, 0, 0, true) local city = getZoneName ( x, y, z, true ) if ( city == 'Las Venturas' ) then createBlip( 2474.6201171875, 1024.251953125, 10.8203125, 37 ) end end ) Link to comment
Edikosh998 Posted April 29, 2012 Share Posted April 29, 2012 y CLARO donde aclaras que es x,y,z? Link to comment
leoMTA_xD Posted April 29, 2012 Author Share Posted April 29, 2012 Ok ya me funciona pero ahora no me funciona hacer visible solo para el source addEvent("onWarpCar", true) addEventHandler("onWarpCar", getRootElement(), function() auto = createVehicle( 411, 2039.9306640625, 1535.390625, 10.671875 ) setVehicleColor( auto, 0,0,0 ) warpPedIntoVehicle( source, auto ) outputChatBox("#FF0000[sERVER]#000000Ve al Blip que HAY en el radar Si te sales del vehiculo perderas el job", source, 0, 0, 0, true) local x,y,z = getElementPosition( source ) local city = getZoneName ( x, y, z, true ) if ( city == 'Las Venturas' ) then createBlip( 2474.6201171875, 1024.251953125, 10.8203125, 37, source ) createMarker( 2474.6201171875, 1024.251953125, 10.8203125, 36, "cylinder", 1.5, 255, 0, 0, 100 ) end end ) Link to comment
Edikosh998 Posted April 29, 2012 Share Posted April 29, 2012 Porque no lees los parametros de createBlip https://wiki.multitheftauto.com/wiki/CreateBlip x,y,z,icono,size,r,g,b,alpha,ordering,visiblilidad,AQUIENVISIBLE Osea hay un monton de parametros antes que ese . Link to comment
leoMTA_xD Posted April 29, 2012 Author Share Posted April 29, 2012 sigue apareciendole a todos addEvent("onWarpCar", true) addEventHandler("onWarpCar", getRootElement(), function() auto = createVehicle( 411, 2039.9306640625, 1535.390625, 10.671875 ) setVehicleColor( auto, 0,0,0 ) warpPedIntoVehicle( source, auto ) outputChatBox("#FF0000[sERVER]#000000Ve al Blip que HAY en el radar Si te sales del vehiculo perderas el job", source, 0, 0, 0, true) local x,y,z = getElementPosition( source ) local city = getZoneName ( x, y, z, true ) if ( city == 'Las Venturas' ) then createBlip( 2474.6201171875, 1024.251953125, 10.8203125, 37, 0, 99999.0, source ) createMarker( 2474.6201171875, 1024.251953125, 10.8203125, 36, "cylinder", 1.5, 255, 0, 0, 100 ) end end ) Link to comment
Edikosh998 Posted April 29, 2012 Share Posted April 29, 2012 PERO ME ESTAS JODIENDO NO? CHAU Te digo que te falta parametros y me seguis poniendo lo mismo Link to comment
iFoReX Posted April 29, 2012 Share Posted April 29, 2012 lol ahy puse todos los parametros los otros parametros son para el blip especial addEvent("onWarpCar", true) addEventHandler("onWarpCar", getRootElement(), function() auto = createVehicle( 411, 2039.9306640625, 1535.390625, 10.671875 ) setVehicleColor( auto, 0,0,0 ) warpPedIntoVehicle( source, auto ) outputChatBox("#FF0000[sERVER]#000000Ve al Blip que HAY en el radar Si te sales del vehiculo perderas el job", source, 0, 0, 0, true) local x,y,z = getElementPosition( source ) local city = getZoneName ( x, y, z, true ) if ( city == 'Las Venturas' ) then createBlip( 2474.6201171875, 1024.251953125, 10.8203125, 37, 0, 99999.0, source ) ---ordering, visibletodistance, visibleTo -.- createMarker( 2474.6201171875, 1024.251953125, 10.8203125, 36, "cylinder", 1.5, 255, 0, 0, 100 ) end end ) Link to comment
Edikosh998 Posted April 29, 2012 Share Posted April 29, 2012 NOOO Te faltan mas jajaja ya ta lo hago , hay que tener logica : createBlip( 2474.6201171875, 1024.251953125, 10.8203125, 37, 2, 255,0,0,255,99999.0, source ) Link to comment
leoMTA_xD Posted April 29, 2012 Author Share Posted April 29, 2012 Sigue sin funcionar Link to comment
Edikosh998 Posted April 29, 2012 Share Posted April 29, 2012 Porque como un boludo me olvide de poner un parametro mas createBlip( 2474.6201171875, 1024.251953125, 10.8203125, 37, 2, 255,0,0,255,0,99999.0, source ) Link to comment
leoMTA_xD Posted April 29, 2012 Author Share Posted April 29, 2012 he hecho esto pero no funciona , ya no me aparece el marker addEvent("onWarpCar", true) addEventHandler("onWarpCar", getRootElement(), function() auto = createVehicle( 411, 2039.9306640625, 1535.390625, 10.671875 ) setVehicleColor( auto, 0,0,0 ) warpPedIntoVehicle( source, auto ) outputChatBox("#FF0000[sERVER]#000000Ve al Blip que HAY en el radar Si te sales del vehiculo perderas el job", source, 0, 0, 0, true) local x,y,z = getElementPosition( source ) local city = getZoneName ( x, y, z, true ) if ( city == 'Las Venturas' ) then blip = createBlip( 2474.6201171875, 1024.251953125, 10.8203125, 37, 2, 255,0,0,255,0,99999.0, source ) marker2 = createMarker( 2474.611328125, 1024.2529296875, 9.8, "cylinder", 1, 255, 255, 255, 120, source ) end end ) addEventHandler("onMarkerHit", root, function(hitPlayer) if isElement(marker2) then destroyElement(blip) destroyElement(marker2) marker3 = createMarker( 2244.462890625, 2525.0693359375, 10.8203125, "cylinder", 1, 255, 255, 0, 120, source ) blip2 = createBlip( 2244.462890625, 2525.0693359375, 10.8203125, 37, 2, 255,0,0,255,0,99999.0, source ) end end ) addEventHandler("onMarkerHit", root, function(hitPlayer) if isElement(marker3) then destroyElement(blip2) destroyElement(marker3) outputChatBox( "Mision Cumplida ! tu paga es $20000 , disfrutaloo", source ) givePlayerMoney( source, 20000 ) end end ) Link to comment
Edikosh998 Posted April 29, 2012 Share Posted April 29, 2012 Pera que marker no aparece?...O explica que sucede Link to comment
leoMTA_xD Posted April 29, 2012 Author Share Posted April 29, 2012 es que se supone que aqui se iria desencadenando marker por marker pero el que no aparece es el marker2 Link to comment
Edikosh998 Posted April 29, 2012 Share Posted April 29, 2012 No entiendo porque no aparece Link to comment
leoMTA_xD Posted April 29, 2012 Author Share Posted April 29, 2012 lo mismo digo pero no aparece Link to comment
leoMTA_xD Posted April 29, 2012 Author Share Posted April 29, 2012 Si aparece pero el marker no Link to comment
Edikosh998 Posted April 29, 2012 Share Posted April 29, 2012 Capaz el 120, ponele 255 pero no creo que sea eso Link to comment
Recommended Posts