Absence2 Posted March 29, 2012 Share Posted March 29, 2012 Ok, so I have a problem with warpPedIntoVehicle, from time to time, it works perfectly fine. But sometimes it doesn't for a period of time. What I'm saying is, it doesn't warp. For an example, lil toady's admin panel. The vehicle just spawns on the ped. And when I use: local jobMarker = createMarker(1808.1796875, -1916.625, 12.56644821167, "cylinder", 2, 0, 255, 255, 100 ) function jobMarkerHit( hitElement, matchingDimension ) if isElementWithinMarker(hitElement, jobMarker) then if getElementType( hitElement ) == "player" and not isPedInVehicle(hitElement) then local vehicle = createVehicle(431, 1798.38171, -1929.55750, 13.38790) setPlayerTeam ( hitElement, Bus) warpPedIntoVehicle(hitElement, vehicle) elseif getElementType( hitElement ) == "vehicle" then end end end addCommandHandler("acceptjob", jobMarkerHit) The vehicle spawns on the given position: 1798.38171, -1929.55750, 13.38790 (line 6) and I don't warp inside it. Is there any way to solve this? It ruins a lot and is quite annoying, also I noticed lil toady's slap mechanism, same thing there. Link to comment
drk Posted March 29, 2012 Share Posted March 29, 2012 http://bugs.mtasa.com/view.php?id=6909 Link to comment
Absence2 Posted March 29, 2012 Author Share Posted March 29, 2012 Thanks, I'll post what I discovered just now there. Sharing it here is just as good I guess, so what I found was, when I first connect to the server. and use the script above^ It does NOT work. HOWEVER, if I kill myself, go back and try again, it works. I guess I found the problem, kinda, but not a solution Anyhow, I'll report it there. Link to comment
drk Posted March 29, 2012 Share Posted March 29, 2012 Before you die, you're in a vehicle? Link to comment
Absence2 Posted March 29, 2012 Author Share Posted March 29, 2012 No, I just connect, go to the marker and use /acceptjob. The vehicle spawns but I don't warp. I then tried killing myself, then I went back and then vehicle spawns & I warp into the vehicle . But that doesn't solve much >.< I tested with a timer on warpPedIntoVehicle but didn't work either, same results, I suppose it's MTA bug then setTimer( warpPedIntoVehicle, 1500, 1,hitElement, vehicle) also I tried being inside a vehicle before killing myself and not being in one. Same result. I have to die in order to make warpPedIntoVehicle work for me. I don't know if players has to do it too or if only one has to do it Link to comment
drk Posted March 29, 2012 Share Posted March 29, 2012 Yes, another mta bug.. It's what I don't like in MTA: Infinite possibilities, infinite bugs Link to comment
Feche1320 Posted March 30, 2012 Share Posted March 30, 2012 It's not a bug (or maybe it is), but you have to spawnPlayer first or it won't work. Link to comment
X-SHADOW Posted March 30, 2012 Share Posted March 30, 2012 try this local jobMarker = createMarker(1808.1796875, -1916.625, 12.56644821167, "cylinder", 2, 0, 255, 255, 100 ) function jobMarkerHit( hitElement, matchingDimension ) if isElementWithinMarker(hitElement, jobMarker) then if getElementType( hitElement ) == "player" and not isPedInVehicle(hitElement) then local vehicle1 = createVehicle(431, 1798.38171, -1929.55750, 13.38790) if vehicle1 then warpPedIntoVehicle(hitElement, vehicle1) setPlayerTeam ( hitElement, Bus) end end end end addCommandHandler("acceptjob", jobMarkerHit) and make sure its ServerSide in meta.xml ! Link to comment
qaisjp Posted March 30, 2012 Share Posted March 30, 2012 local jobMarker = createMarker(1808.1796875, -1916.625, 12.56644821167, "cylinder", 2, 0, 255, 255, 100 ) function jobMarkerHit(p,d) if getElementType(p) == "player" and not isPedInVehicle(p) and d then local v = createVehicle(431, 1798.38171, -1929.55750, 13.38790) spawnPlayer(p, 1798, -1929, 13) if vehicle1 then setTimer(warpPedIntoVehicle, 50, 1, p, v) setPlayerTeam ( p, Bus) end end end addCommandHandler("acceptjob", jobMarkerHit) this WILL work. or tommy vercetti will die Link to comment
Absence2 Posted March 30, 2012 Author Share Posted March 30, 2012 That doesn't work. It just spawns the ped next to the bus.. Plus I'll have to use setElementData to keep skin, guns, wanted level etc etc etc.. >. Link to comment
Feche1320 Posted March 30, 2012 Share Posted March 30, 2012 local jobMarker = createMarker(1808.1796875, -1916.625, 12.56644821167, "cylinder", 2, 0, 255, 255, 100 ) function jobMarkerHit(p,d) if getElementType(p) == "player" and not isPedInVehicle(p) and d then local v = createVehicle(431, 1798.38171, -1929.55750, 13.38790) spawnPlayer(p, 1798, -1929, 13) if v then setTimer(warpPedIntoVehicle, 50, 1, p, v) setPlayerTeam ( p, Bus) end end end addCommandHandler("acceptjob", jobMarkerHit) It's not working becouse you are a lazy to check if the code is right.. bad for you, scripter. Link to comment
Mega9 Posted March 30, 2012 Share Posted March 30, 2012 This works fine to me... local jobMarker = createMarker(1808.1796875, -1916.625, 12.56644821167, "cylinder", 2, 0, 255, 255, 100 ) function jobMarkerHit ( hitElement, matchingDimension ) if isElementWithinMarker ( hitElement, jobMarker ) then if getElementType( hitElement ) == "player" and not getPedOccupiedVehicle ( hitElement ) then local vehicle = createVehicle ( 431, 1798.38171, -1929.55750, 13.38790 ) setPlayerTeam ( hitElement, getTeamFromName ( "Bus" ) ) warpPedIntoVehicle ( hitElement, vehicle, 0 ) end end end addCommandHandler ( "acceptjob", jobMarkerHit ) 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