Jump to content

Jakus

Members
  • Posts

    3
  • Joined

  • Last visited

Jakus's Achievements

I ordered some spaghetti with marinara sauce and I got egg noodles and ketchup. I'm an average nobody.

I ordered some spaghetti with marinara sauce and I got egg noodles and ketchup. I'm an average nobody. (2/54)

0

Reputation

  1. Thanks for the help, figured it out. Tuned it a little; this is the best I could get it. For anyone looking for an andromada you can walk inside of... function getPointFromDistanceRotation(x, y, dist, angle) local a = math.rad(90 - angle); local dx = math.cos(a) * dist; local dy = math.sin(a) * dist; return x+dx, y+dy; end function vehicleAndromadaHandling(pe,ce) if isElement(ce) and getElementType(ce) == "vehicle" and getElementModel(ce) == 592 then setPedRotation(source, 180) setCameraTarget(source,source) setElementData(source,"entveh",ce,false) setElementData(source,"onplane",true,true) setElementInterior(source,9,315.64258,1031.65771,1947.08655) if isTimer(AndroTimer) ~= true then AndroTimer = setTimer( function() count = false for index, player in ipairs(getElementsByType("player")) do if getElementData(player,"onplane") then count = true local x,y,z = getElementPosition(player) if getElementInterior(player) == 9 and z>1900 and z<1946.72034 then local thePlane = getElementData(player,"entveh") local px,py,pz = getElementPosition(thePlane) local rotx,roty,rotz = getVehicleRotation(thePlane) local newx, newy = getPointFromDistanceRotation(px,py,25,180 - rotz) setElementInterior(player,0,newx,newy,pz - 1) setPedRotation(player,360 - rotz) outputChatBox(rotz .. " : " .. getPedRotation(player)) setCameraTarget(player,player) setElementData(player,"onplane",false,true) end end end if count == false then killTimer(AndroTimer) end end ,250,0) end end end addEventHandler("onPlayerContact",getRootElement(),vehicleAndromadaHandling)
  2. Hey, Just trying to get this script working. All it does is spawn you inside the Andromeda cargo hold when you step onto the ramp (anywhere you can step on) of an Andromeda. Then spawn you outside the Andromeda when you walk on the ramp out. I'm using the "getPointFromDistanceRotation" example in the wiki. But my problem is it keeps spawning me randomly around the plane when I walk out. Anyway here's my code (beginner, so tips and corrections very welcome). function getPointFromDistanceRotation(x, y, dist, angle) local a = math.rad(90 - angle); local dx = math.cos(a) * dist; local dy = math.sin(a) * dist; return x+dx, y+dy; end function vehicleAndromadaHandling(pe,ce) if isElement(ce) and getElementType(ce) == "vehicle" and getElementModel(ce) == 592 then setPedRotation(source, 180) setCameraTarget(source,source) setElementData(source,"entveh",ce,false) setElementData(source,"onplane",true,true) setElementInterior(source,9,315.64258,1031.65771,1947.08655) if isTimer(AndroTimer) ~= true then AndroTimer = setTimer( function() count = 0 for index, player in ipairs(getElementsByType("player")) do if getElementData(player,"onplane") then count = count + 1 local x,y,z = getElementPosition(player) if getElementInterior(player) == 9 and z>1900 and z<1946.72034 then local px,py,pz = getElementPosition(getElementData(player,"entveh")) local rotx,roty,rotz = getVehicleRotation(getElementData(player,"entveh")) local newx, newy = getPointFromDistanceRotation(px,py,25,rotz) setElementInterior(player,0,newx,newy,pz) setPedRotation(player,rotz) setCameraTarget(player,player) end end end if count == 0 then killTimer(AndroTimer) end end ,250,0) end end end addEventHandler("onPlayerContact",getRootElement(),vehicleAndromadaHandling)
  3. Hey, I'm just using a loop that checks if the player is in water. But it also triggers when the player is getting in the car, only for the short duration of the animation. Any help? Sorry if its been answered before... Cheers
×
×
  • Create New...