Araa Posted August 27, 2012 Share 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. Link to comment
Castillo Posted August 27, 2012 Share 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. Link to comment
Araa Posted August 28, 2012 Author Share Posted August 28, 2012 Proba con eso. attempt to call a global 'getPedOccupiedVehicleSeat' (a nil value) Link to comment
Castillo Posted August 28, 2012 Share Posted August 28, 2012 Oh, no me di cuenta de que esa funcion es solo server side, copia el codigo de nuevo y proba. Link to comment
Araa Posted August 28, 2012 Author Share 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 Link to comment
Castillo Posted August 28, 2012 Share Posted August 28, 2012 Ah, es que puse 'source' en vez de 'vehicle', copialo de nuevo . Link to comment
Araa Posted August 28, 2012 Author Share Posted August 28, 2012 Ah, es que puse 'source' en vez de 'vehicle', copialo de nuevo . Funciono, muchas gracias Link to comment
Recommended Posts