Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NETWORK TROUBLE after warpPedIntoVehicle into train #3119

Open
1 task done
etrnl1337 opened this issue Jul 13, 2023 · 4 comments
Open
1 task done

NETWORK TROUBLE after warpPedIntoVehicle into train #3119

etrnl1337 opened this issue Jul 13, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@etrnl1337
Copy link

Describe the bug

`spawnPlayer(getRandomPlayer(), -1947, 161, 26)

local veh = createVehicle(537, -1947, 161, 26)
warpPedIntoVehicle(getRandomPlayer ( ), veh)`

Spawn player was used only for the purposes of warpPedIntoVehicle bug where it returns false if you were spawned with
setElementPosition.

After that it just crashes and makes NETWORK - TROUBLE. If you stop the resource it goes back to normal.

bug

Steps to reproduce

  1. Start the code server side
  2. Wait for network trouble :)

Version

client Multi Theft Auto v1.6-release-21890
server 352, 474, MTA:SA Server, 1.6.0-9.21846.0, 1.6, Release, GNU/Linux x64, 1.6-release-21846

Additional context

No response

Relevant log output

No response

Security Policy

  • I have read and understood the Security Policy and this issue is not security related.
@etrnl1337 etrnl1337 added the bug Something isn't working label Jul 13, 2023
@MegadreamsBE
Copy link
Member

Does it work any better if you wrap your warpPedIntoVehicle in setTimer?

@etrnl1337
Copy link
Author

Tried, doesn't work.
Feel free to check it.

Also setTrainSpeed doesn't work if player isn't in the train. I can warp ped into driver but it also doesn't work - it must be a player to setTrainSpeed work.

@Xenius97
Copy link
Contributor

Use timer, i've tested and works.
But without timer can reproduce: https://streamable.com/4h6r81

addEventHandler("onResourceStart", resourceRoot, function()
	local player = getPlayerFromName("Alan_Santos")
	
	-- spawnPlayer(player, -1947, 161, 26)
	local veh = createVehicle(537, -1947, 161, 26)
	warpPedIntoVehicle(player, veh)
	-- setTimer(warpPedIntoVehicle, 50, 1, player, veh)
end)

@Xenius97
Copy link
Contributor

Update:
Using warpPedIntoVehicle after createVehicle can cause network trouble for all vehicles (tested)
If you use 50ms timer, it will work.

Multi Theft Auto v1.6-release-21890

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants