mjau Posted August 7, 2011 Share Posted August 7, 2011 hi i have a problem with my code it should not warp the player if he is in a vehicle but it does anyway heres my code function warpPlayerIntoAndro(hitElement, dimensionMatch) outputDebugString("Warp function triggered") if not dimensionMatch then return end if getElementType(hitElement) == "vehicle" then cancelEvent() else setElementInterior(hitElement, 9, 315.48, 984.13, 1959.11 ) end end Link to comment
JR10 Posted August 7, 2011 Share Posted August 7, 2011 function warpPlayerIntoAndro(hitElement, dimensionMatch) outputDebugString("Warp function triggered") if getElementType(hitElement) == "player" then setElementInterior(hitElement, 9, 315.48, 984.13, 1959.11 ) end end No need for all this, try that. Link to comment
mjau Posted August 7, 2011 Author Share Posted August 7, 2011 still warps me to nowhere when im in a vehicle and tirgger that function Edit with nowhere i mean everything disappears Link to comment
Castillo Posted August 7, 2011 Share Posted August 7, 2011 function warpPlayerIntoAndro(hitElement, dimensionMatch) outputDebugString("Warp function triggered") if isPedInVehicle(hitElement) then return end setElementInterior(hitElement, 9, 315.48, 984.13, 1959.11 ) end Try that. Link to comment
mjau Posted August 7, 2011 Author Share Posted August 7, 2011 kk ehh now it says an error about bad ped pointer and instead of putting me in nowhere it puts me VERY high p in the air and drops me down Link to comment
JR10 Posted August 7, 2011 Share Posted August 7, 2011 function warpPlayerIntoAndro(hitElement, dimensionMatch) outputDebugString("Warp function triggered") if getElementType( hitElement ) ~= "player" then return end if isPedInVehicle(hitElement) then return end setElementInterior(hitElement, 9, 315.48, 984.13, 1959.11 ) end Link to comment
JR10 Posted August 7, 2011 Share Posted August 7, 2011 No problem, I just added checking for hitElement type. Link to comment
mjau Posted August 7, 2011 Author Share Posted August 7, 2011 oh and this is something else but just a quesiton how can i make a colshape inside an interior Link to comment
JR10 Posted August 7, 2011 Share Posted August 7, 2011 setElementInterior(theColshape, interior) Link to comment
mjau Posted August 7, 2011 Author Share Posted August 7, 2011 ahh dammn new problem now it wont warp me into the interior when im out of a vehicle either Link to comment
mjau Posted August 7, 2011 Author Share Posted August 7, 2011 it dont even show the debugstring exept when im in a vehicle Link to comment
Castillo Posted August 7, 2011 Share Posted August 7, 2011 That's not possible, /debugscript works when in vehicle or when on foot. Link to comment
mjau Posted August 7, 2011 Author Share Posted August 7, 2011 the debugstring i added in the script it should out put warp function activated but it only does that when im in a vehicle Link to comment
mjau Posted August 7, 2011 Author Share Posted August 7, 2011 and anyway it dont warpme when im in a vehicle or on foot Link to comment
JR10 Posted August 7, 2011 Share Posted August 7, 2011 Don't double post. Post where you attach the handler. Link to comment
mjau Posted August 7, 2011 Author Share Posted August 7, 2011 since this is goin to be release on community ill upload the whole code function createAndroMarker(thePlayer) vehicle = getPedOccupiedVehicle(thePlayer) x,y,z = getElementPosition( vehicle ) theMarker = createMarker ( x, y + 5, z - 2, "cylinder", 20.5, 0, 0, 255, 170 ) setTimer ( removeMarker, 7000, 1 ) addEventHandler( "onMarkerHit", theMarker, warpPlayerIntoAndro ) end addCommandHandler("marker", createAndroMarker) function warpPlayerIntoAndro(hitElement, dimensionMatch) outputDebugString("Warp function triggered") if getElementType(hitElement) ~= "player" then return end if isPedInVehicle(hitElement) then return end setElementInterior(hitElement, 9, 315.48, 984.13, 1959.11 ) end function removeMarker() destroyElement ( theMarker ) end Link to comment
Headshot4Fun Posted August 7, 2011 Share Posted August 7, 2011 Well. here goes a tip, if you want to teleport someone to a place, and he is in a vehicle, teleport the vehicle, and the guy goes too Link to comment
mjau Posted August 8, 2011 Author Share Posted August 8, 2011 but if u read the problem is that i dont want that vehicle with in the teleport Link to comment
JR10 Posted August 8, 2011 Share Posted August 8, 2011 function createAndroMarker(thePlayer) vehicle = getPedOccupiedVehicle(thePlayer) x,y,z = getElementPosition( vehicle ) theMarker = createMarker ( x, y + 5, z, "cylinder", 20.5, 0, 0, 255, 170 ) setTimer ( removeMarker, 7000, 1 ) addEventHandler( "onMarkerHit", theMarker, warpPlayerIntoAndro ) end addCommandHandler("marker", createAndroMarker) function warpPlayerIntoAndro(hitElement, dimensionMatch) outputDebugString("Warp function triggered") if getElementType(hitElement) ~= "player" then return end if isPedInVehicle(hitElement) then removePedFromVehicle(hitElement) end setElementInterior(hitElement, 9, 315.48, 984.13, 1959.11 ) end function removeMarker() destroyElement ( theMarker ) end Try that. 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