Araa Posted August 27, 2012 Posted August 27, 2012 Tengo un problema en mi script, el blip y el marker se crean cuando entro al vehiculo, pero cuando le doy hit a un marker me dice Bad Argument @getElementModel . Intente mucho pero no lo puedo arreglar, alguna idea del porque? function getNewLocation(player, seat) local vehicle = getPedOccupiedVehicle(player) local id = getElementModel(vehicle) if ( id == 448 ) and ( seat == 0 )then outputChatBox("A new location has been marker in your map, deliver you pizza on time!") num = math.random(#markersPosition) marker = createMarker(markersPosition[num][1], markersPosition[num][2], markersPosition[num][3], "checkpoint", 1.5, 100, 150, 50) blip = createBlipAttachedTo(marker, 51) addEventHandler("onClientMarkerHit", marker, function() destroyElement(marker) destroyElement(blip) setTimer(getNewLocation,2000,1) end) end end addEventHandler("onClientVehicleEnter", root, getNewLocation) Gracias. Hi, this is a signature.
Castillo Posted August 27, 2012 Posted August 27, 2012 function getNewLocation ( player, seat ) local vehicle = getPedOccupiedVehicle ( player ) local id = getElementModel ( vehicle ) if ( id == 448 ) and ( seat == 0 )then outputChatBox ( "A new location has been marker in your map, deliver you pizza on time!" ) local num = math.random ( #markersPosition ) marker = createMarker ( markersPosition [ num ] [ 1 ], markersPosition [ num ] [ 2 ], markersPosition [ num ] [ 3 ], "checkpoint", 1.5, 100, 150, 50 ) blip = createBlipAttachedTo ( marker, 51 ) addEventHandler ( "onClientMarkerHit", marker, function ( hitElement ) if ( hitElement and getElementType ( hitElement ) == "player" and hitElement == localPlayer ) then destroyElement ( marker ) destroyElement ( blip ) setTimer ( getNewLocation, 2000, 1, localPlayer, seat ) end end ) end end addEventHandler ( "onClientVehicleEnter", root, getNewLocation ) Proba con eso. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Araa Posted August 28, 2012 Author Posted August 28, 2012 Proba con eso. attempt to call a global 'getPedOccupiedVehicleSeat' (a nil value) Hi, this is a signature.
Castillo Posted August 28, 2012 Posted August 28, 2012 Oh, no me di cuenta de que esa funcion es solo server side, copia el codigo de nuevo y proba. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Araa Posted August 28, 2012 Author Posted August 28, 2012 Oh, no me di cuenta de que esa funcion es solo server side, copia el codigo de nuevo y proba. aun: badArgument @getElementModel Hi, this is a signature.
Castillo Posted August 28, 2012 Posted August 28, 2012 Ah, es que puse 'source' en vez de 'vehicle', copialo de nuevo . San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Araa Posted August 28, 2012 Author Posted August 28, 2012 Ah, es que puse 'source' en vez de 'vehicle', copialo de nuevo . Funciono, muchas gracias Hi, this is a signature.
Castillo Posted August 28, 2012 Posted August 28, 2012 No hay de que . San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Recommended Posts