iFoReX Posted March 31, 2012 Author Posted March 31, 2012 que esta mal ? No aparece el marker ... function onMrWhoopeeEnter ( thePlayer, seat, jackedPlayer ) local arrowMarker = createMarker ( 0, 0, 0, "arrow", .75, 255, 0, 0, 170 ) attachElements ( arrowMarker, thePlayer, 0, 0, 2 ) end addEventHandler ( "onVehicleEnter", v1, onMrWhoopeeEnter ) addEventHandler ( "onVehicleEnter", v2, onMrWhoopeeEnter )
Castillo Posted April 1, 2012 Posted April 1, 2012 local x = 1540.95654 local y = -1687.67078 local z = 5.89063 local market = createMarker ( 685.62610, -2692.39307, 7.5, "cylinder", 1.5, 0, 0, 255, 170 ) local market2 = createMarker ( 294.38306 + 2, -167.90103, 1.57813 - 1, "cylinder", 1.5, 0, 0, 255, 170 ) local market3 = createMarker ( 1526.51270, -1677.93237, 5, "cylinder", 1.5, 0, 0, 255, 170 ) local ped = createPed ( 286, 1525.26294, -1677.85596, 5.89063, 270 ) setElementFrozen(ped, true) GUIEditor_Grid = {} GUIEditor_Grid[1] = guiCreateGridList(258,160,294,357,false) guiSetVisible( GUIEditor_Grid[1], false ) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) guiGridListAddColumn(GUIEditor_Grid[1],"Autos",0.50) for i = 1, 2 do guiGridListAddRow(GUIEditor_Grid[1]) end guiGridListSetItemText(GUIEditor_Grid[1],0,1,"Camion Polis",false,false) guiGridListSetItemText(GUIEditor_Grid[1],1,1,"Auto Polis",false,false) addEventHandler("onClientGUIDoubleClick", root, function ( ) if ( source == GUIEditor_Grid[1] ) then local row, col = guiGridListGetSelectedItem ( source ) if ( row and col and row ~= -1 and col ~= -1 ) then if ( row == 0 ) then v1 = createVehicle ( 427, x, y, z ) elseif ( row == 1 ) then v2 = createVehicle ( 596, x, y, z ) end guiSetVisible( GUIEditor_Grid[1], false ) end end end ) -- Te falto el parentesis. bindKey ( "enter", "down", function ( ) if ( isElementWithinMarker ( localPlayer, market3 ) ) then guiSetVisible ( GUIEditor_Grid[1], true ) end end ) addEventHandler ( 'onClientMarkerHit', root, function ( player ) if ( player == localPlayer and source == market ) then setTimer ( setElementPosition, 2000, 1, player, 294.38306, -167.90103, 1.57813 ); elseif ( player == localPlayer and source == market2 ) then setTimer ( setElementPosition, 2000, 1, player, 685.62610 + 2, -2692.39307 + 2, 7.5 + 2 ); elseif ( player == localPlayer and source == market3 ) then addEventHandler ( "onClientRender", root, drawText ) end end ) addEventHandler ( 'onClientMarkerLeave', root, function ( player ) if ( player == localPlayer and source == market3 ) then removeEventHandler ( "onClientRender", root, drawText ) end end ) function drawText ( ) dxDrawText("Press Enter for do the job",458.0,295.0,631.0,317.0,tocolor(255,0,0,170),1.2,"default","left","top",false,false,false) end function onMrWhoopeeEnter ( thePlayer ) if ( source == v1 or source == v2 ) then arrowMarker = createMarker ( 0, 0, 0, "arrow", .75, 255, 0, 0, 170 ) attachElements ( arrowMarker, source, 0, 0, 2 ) end end addEventHandler ( "onClientVehicleEnter", root, onMrWhoopeeEnter )
iFoReX Posted April 1, 2012 Author Posted April 1, 2012 siguen sin aparecer los markers en los autos man
Castillo Posted April 1, 2012 Posted April 1, 2012 Lo estas usando con los vehiculos que creas con el script, verdad?
iFoReX Posted April 1, 2012 Author Posted April 1, 2012 sip man : addEventHandler("onClientGUIDoubleClick", root, function ( ) if ( source == GUIEditor_Grid[1] ) then local row, col = guiGridListGetSelectedItem ( source ) if ( row and col and row ~= -1 and col ~= -1 ) then if ( row == 0 ) then v1 = createVehicle ( 427, x, y, z ) elseif ( row == 1 ) then v2 = createVehicle ( 596, x, y, z ) end guiSetVisible( GUIEditor_Grid[1], false ) end end end ) ... function onMrWhoopeeEnter ( thePlayer ) if ( source == v1 or source == v2 ) then -------aqui estan el v1 y el v2 osea los autos que se crean al aprietar double click arrowMarker = createMarker ( 0, 0, 0, "arrow", .75, 255, 0, 0, 170 ) attachElements ( arrowMarker, source, 0, 0, 2 ) end end addEventHandler ( "onClientVehicleEnter", root, onMrWhoopeeEnter )
Castillo Posted April 1, 2012 Posted April 1, 2012 local x = 1540.95654 local y = -1687.67078 local z = 5.89063 local market = createMarker ( 685.62610, -2692.39307, 7.5, "cylinder", 1.5, 0, 0, 255, 170 ) local market2 = createMarker ( 294.38306 + 2, -167.90103, 1.57813 - 1, "cylinder", 1.5, 0, 0, 255, 170 ) local market3 = createMarker ( 1526.51270, -1677.93237, 5, "cylinder", 1.5, 0, 0, 255, 170 ) local ped = createPed ( 286, 1525.26294, -1677.85596, 5.89063, 270 ) setElementFrozen(ped, true) GUIEditor_Grid = {} GUIEditor_Grid[1] = guiCreateGridList(258,160,294,357,false) guiSetVisible( GUIEditor_Grid[1], false ) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) guiGridListAddColumn(GUIEditor_Grid[1],"Autos",0.50) for i = 1, 2 do guiGridListAddRow(GUIEditor_Grid[1]) end guiGridListSetItemText(GUIEditor_Grid[1],0,1,"Camion Polis",false,false) guiGridListSetItemText(GUIEditor_Grid[1],1,1,"Auto Polis",false,false) addEventHandler("onClientGUIDoubleClick", root, function ( ) if ( source == GUIEditor_Grid[1] ) then local row, col = guiGridListGetSelectedItem ( source ) if ( row and col and row ~= -1 and col ~= -1 ) then if ( row == 0 ) then v1 = createVehicle ( 427, x, y, z ) arrowMarker = createMarker ( 0, 0, 0, "arrow", .75, 255, 0, 0, 170 ) attachElements ( arrowMarker, v1, 0, 0, 2 ) elseif ( row == 1 ) then v2 = createVehicle ( 596, x, y, z ) arrowMarker = createMarker ( 0, 0, 0, "arrow", .75, 255, 0, 0, 170 ) attachElements ( arrowMarker, v2, 0, 0, 2 ) end guiSetVisible( GUIEditor_Grid[1], false ) end end end ) -- Te falto el parentesis. bindKey ( "enter", "down", function ( ) if ( isElementWithinMarker ( localPlayer, market3 ) ) then guiSetVisible ( GUIEditor_Grid[1], true ) end end ) addEventHandler ( 'onClientMarkerHit', root, function ( player ) if ( player == localPlayer and source == market ) then setTimer ( setElementPosition, 2000, 1, player, 294.38306, -167.90103, 1.57813 ); elseif ( player == localPlayer and source == market2 ) then setTimer ( setElementPosition, 2000, 1, player, 685.62610 + 2, -2692.39307 + 2, 7.5 + 2 ); elseif ( player == localPlayer and source == market3 ) then addEventHandler ( "onClientRender", root, drawText ) end end ) addEventHandler ( 'onClientMarkerLeave', root, function ( player ) if ( player == localPlayer and source == market3 ) then removeEventHandler ( "onClientRender", root, drawText ) end end ) function drawText ( ) dxDrawText("Press Enter for do the job",458.0,295.0,631.0,317.0,tocolor(255,0,0,170),1.2,"default","left","top",false,false,false) end Cambie como funciona, ahora pone la flecha arriva del vehiculo cuando lo spawneas.
iFoReX Posted April 1, 2012 Author Posted April 1, 2012 Muchas gracias man ahora como puedo aser para que al entrar al vehiculo se cree un marker
iFoReX Posted April 1, 2012 Author Posted April 1, 2012 que esta mal ? es que no entiendo muy bien ... addEventHandler ( "onVehicleEnter", root, function crearjob() local markerjob = createMarker ( 246.55173, 1434.92371, 23.37029, "cylinder", 1.5, 0, 255, 255, 170 ) blip = createBlipAttachedTo ( markerjob, 51, 1 ) end end ...
Castillo Posted April 1, 2012 Posted April 1, 2012 Me parece que tenes que empezar a usar anteojos: onClientVehicleEnter no: onVehicleEnter.
iFoReX Posted April 1, 2012 Author Posted April 1, 2012 en que parte pongo los autos ? addEventHandler ( "onClientVehicleEnter", root, function crearjob() local markerjob = createMarker ( 246.55173, 1434.92371, 23.37029, "cylinder", 1.5, 0, 255, 255, 170 ) blip = createBlipAttachedTo ( markerjob, 51, 1 ) end end
iFoReX Posted April 1, 2012 Author Posted April 1, 2012 man ahora no me aparece ni el marker ni el ped
Castillo Posted April 1, 2012 Posted April 1, 2012 Sabes detectar errores en tus scripts? si no es asi, entonces pone: /debugscript 3 en el chat del juego y postea los errores que aparecen.
Castillo Posted April 1, 2012 Posted April 1, 2012 addEventHandler ( "onClientVehicleEnter", root, function ( ) local markerjob = createMarker ( 246.55173, 1434.92371, 23.37029, "cylinder", 1.5, 0, 255, 255, 170 ) blip = createBlipAttachedTo ( markerjob, 51, 1 ) end )
Castillo Posted April 1, 2012 Posted April 1, 2012 Sep, ami me paso lo mismo, podrias intentar crear los coches server side. Usa triggerServerEvent.
iFoReX Posted April 1, 2012 Author Posted April 1, 2012 me ayudarias ? es que nose casi nada de triggerserverevent o triggerclientevent please
iFoReX Posted April 1, 2012 Author Posted April 1, 2012 sory por el doble post pero ayudenmme porfa es que esto es urgente
Castillo Posted April 1, 2012 Posted April 1, 2012 Podrias al menos intentar hacerlo? ya me estoy aburriendo de hacerte todo porque vos no lo intentas.
iFoReX Posted April 1, 2012 Author Posted April 1, 2012 Podrias al menos intentar hacerlo? ya me estuy aburriendo de hacerte todo porque vos no lo intentas. Lo intente toda la noche ayer asta las 3 a.m ._. y no pude Me podrias decir aunque sea como unirlos que funciones uno y eso ?
iFoReX Posted April 1, 2012 Author Posted April 1, 2012 ok pero si no tiene sentido es porq no entendia mucho Client-Side ... addEventHandler("onClientGUIDoubleClick", root, function ( ) if ( source == GUIEditor_Grid[1] ) then local row, col = guiGridListGetSelectedItem ( source ) if ( row and col and row ~= -1 and col ~= -1 ) then if ( row == 0 ) then triggerServerEvent ( "crearVehiculo1") arrowMarker = createMarker ( 0, 0, 0, "arrow", .75, 255, 0, 0, 170 ) attachElements ( arrowMarker, v1, 0, 0, 2 ) outputChatBox ( "Porfavor #00FF00Sube al Camion", getRootElement(), 255, 0, 0, true ) elseif ( row == 1 ) then triggerServerEvent ( "crearVehiculo2") arrowMarker = createMarker ( 0, 0, 0, "arrow", .75, 255, 0, 0, 170 ) attachElements ( arrowMarker, v2, 0, 0, 2 ) end guiSetVisible( GUIEditor_Grid[1], false ) outputChatBox ( "Porfavor #00FF00Sube al auto", getRootElement(), 255, 0, 0, true ) end end end ) ... Server-Side function crearAuto2() v2 = createVehicle ( 596, x, y, z ) end end addEvent("crearVehiculo2", true) addEventHandler("crearVehiculo2, crearAuto2) function crearAuto1() v1 = createVehicle ( 427, x, y, z ) end end addEvent("crearVehiculo1", true) addEventHandler("crearVehiculo1, crearAuto1)
Castillo Posted April 1, 2012 Posted April 1, 2012 No leiste todos los argumentos de la funcion. Tambien te faltan comillas, variables.
Recommended Posts