Vehicle X was not deleted [Trains]
#1

Hey,
i know this bug have already been reported some years ago. Still, it exists.

Example Explanation:
Creating https://sampwiki.blast.hk/wiki/Image:Vehicle_537.jpg will also bring 3 https://sampwiki.blast.hk/wiki/Image:Vehicle_569.jpg with it. The 3 trailers will ALWAYS have the trains vehicle id +X.

If the train got the vehicleid 500, the first trailer will have the id 501, the second the id 502 and the third the id 503. And here it comes to the problem. This trailer will realy ALWAYS get the trains id ++. Even if another vehicle already got this id. The vehicle will automaticly be destroyed, regardless if a player is inside, the car is not even inside the stream radius and and and...

Fix:
If the modelid 537 or 538 (both are trains with 3 trailers) will be created, SA-MP should firstly selected the current highest vehicleid and spawn the trailer on this id. This will easily fix it. If the highest vehicleid => 1996, the train should not be able to spawn (since 2000 max vehicles, or: 1999).


Also: I'm actualy working with a workaround (creating vehicles until the id the train would get + 3 more ids are free) but this is awfuel.
Reply
#2

Trains can only be created with AddStaticVehicle/AddStaticVehicleEx, which can only be used in OnGameModeInit. Unless I'm misunderstanding your problem?
Reply
#3

Quote:
Originally Posted by BeckzyBoi
View Post
Trains can only be created with AddStaticVehicle/AddStaticVehicleEx, which can only be used in OnGameModeInit. Unless I'm misunderstanding your problem?
Those functions can even be used in commands, not just OnGameModeInit (anymore).
Reply
#4

They could be for a long time, its just not recommended to do so for this reason.
Reply
#5

Quote:
Originally Posted by Freshncool
View Post
They could be for a long time, its just not recommended to do so for this reason.
Wow.
This is not a fix or helpfully in any way.

Simply creating the train on the current highest ID. I have to create a real car, but Kalcor got the possibility to create a small entity to like "block" the current free id if she's not the highest one.

This would be a much better solution.
Reply
#6

Quote:
Originally Posted by GangstaSunny.
View Post
The 3 trailers will ALWAYS have the trains vehicle id +X.
No, they get unused ids, at least on 0.3.7. For instance, this script prints:
Code:
Model: 400 - ID: 1
Model: 401 - ID: 2
Model: 402 - ID: 3
Model: 403 - ID: 4

Model: 538 - ID: 1
Model: 401 - ID: 2
Model: 402 - ID: 3
Model: 403 - ID: 4
Model: 570 - ID: 5
Model: 570 - ID: 6
Model: 570 - ID: 7
Which clearly shows that trailer ids don't overlap with other existing ids.
Reply
#7

Quote:
Originally Posted by Spmn
View Post
No, they get unused ids, at least on 0.3.7. For instance, this script prints:
Code:
Model: 400 - ID: 1
Model: 401 - ID: 2
Model: 402 - ID: 3
Model: 403 - ID: 4

Model: 538 - ID: 1
Model: 401 - ID: 2
Model: 402 - ID: 3
Model: 403 - ID: 4
Model: 570 - ID: 5
Model: 570 - ID: 6
Model: 570 - ID: 7
Which clearly shows that trailer ids don't overlap with other existing ids.
Not for me (and basicly everyone else, including ******, except you). 0.3.7
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)