TheIceman1 Posted March 8, 2013 Share Posted March 8, 2013 Why this dont give me new car when i hit marker(carmarker)?No errors function createCarrou () if ( getElementData ( source, "Role" ) == "Car Jacker" ) then x, y, z = unpackCarjacker() ID = model() vehicle = createVehicle ( ID ,x, y, z ) carBlip = createBlipAttachedTo ( vehicle, 41 ) addEventHandler ( "onVehicleEnter", vehicle, carHit ) end end addEvent ( "createCarrou", true ) addEventHandler ( "createCarrou", getRootElement(), createCarrou ) function carHit ( hitPlayer ) hitPlayer = localPlayer carmarker = createMarker( 2041.9,-1777.7,13, "cylinder", 3, 250, 0, 0 ) markerblip = createBlipAttachedTo(carmarker,51) addEventHandler ("onMarkerHit", carmarker, createnewcar ) end function createnewcar ( thePlayer ) if (isPedInVehicle(thePlayer)) then triggerEvent ( "carmoney", thePlayer ) destroyElement ( vehicle ) destroyElement ( carBlip ) destroyElement ( carmarker ) destroyElement ( markerblip ) setTimer( createCarrou() , 2000, 1 ) end end Link to comment
iPrestege Posted March 8, 2013 Share Posted March 8, 2013 hitPlayer = localPlayer localPlayer ClientOnly use getElementType "player" Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now