Posts: 1,042
Threads: 46
Joined: Jun 2013
When you try to change the rotation of the machine, nothing happens.
Code:
PHP код:
// Create vehicle:
new vehicleid = CreateVehicle(411, 0.0, 0.0, 0.0, 0.0, -1, -1, -1);
// Edit Vehicle Angle:
SetVehicleZAngle(vehicleid, 65.0000);
// Get Vehicle Angle:
new Float:z_angl;
GetVehicleZAngle(vehicleid, z_angl);
printf("debug: %f", z_angl);
Logs:
Posts: 18
Threads: 3
Joined: May 2013
Reputation:
0
Also faced with this problem.
Do something.
Posts: 150
Threads: 13
Joined: Dec 2012
Reputation:
0
Yeah, I aggree.
Please, fix it.
Posts: 110
Threads: 3
Joined: Aug 2009
Reputation:
0
Have similar problem that when a vehicle spawns, NOONE entered it and you try to get an angle, I get 0.0000 angle. But when someone is in vehicle, the gotten angle seems to be ok.
Posts: 1,042
Threads: 46
Joined: Jun 2013
Jimmy0wns, your method is not suitable.
Posts: 774
Threads: 20
Joined: Sep 2009
Reputation:
0
it not SA-MP bug, it bug of game GTA - SA opcode 0x0175
Posts: 1,042
Threads: 46
Joined: Jun 2013
Quote:
Originally Posted by [Saint]
it not SA-MP bug, it bug of game GTA - SA opcode 0x0175
|
I think it's still a bug samp. The problem is particularly visible on the server side.
Posts: 1,042
Threads: 46
Joined: Jun 2013
Quote:
Originally Posted by [Saint]
i know 100% it bug GTA SA, not SA-MP
|
All the same it is necessary fixes ...
Posts: 513
Threads: 4
Joined: Jun 2015
Reputation:
0
Actually this is a SA-MP bug. Vehicle is not streamed for any player so there is no one who can 'broadcast' the update. Run that code again with a player close to the vehicle (not paused) and you'll see that Z-Angle changes.
Posts: 1,042
Threads: 46
Joined: Jun 2013
Quote:
Originally Posted by Spmn
Actually this is a SA-MP bug. Vehicle is not streamed for any player so there is no one who can 'broadcast' the update. Run that code again with a player close to the vehicle (not paused) and you'll see that Z-Angle changes.
|
I agree that this is a problem SA-MP.
Posts: 455
Threads: 29
Joined: Apr 2014
There is a fix for that. There must be a delay between spawning and setting rotation.
PHP код:
SetTimerEx("VehRot",200,false,"df",vehicleid,65.0);
forward VehRot(veh,Float:angle);
public VehRot(veh,Float:angle){
return SetVehicleZAngle(vehicleid, angle);
}
Posts: 1,042
Threads: 46
Joined: Jun 2013
Posts: 455
Threads: 29
Joined: Apr 2014
This function works, but when vehicle spawns there must be a delay.
Posts: 513
Threads: 4
Joined: Jun 2015
Reputation:
0
Delay would work only in some circumstances, but most of the time it wouldn't. (eg: when vehicle is not streamed for any player).
There are two possible fixes:
1. when you set angle of vehicle, check if it is streamed for any player (not paused). If it isn't then recreate it with the new angle. (also recreate the vehicle at OnVehicleSpawn);
2. check again if there is any player who has vehicle streamed in. If there isn't, assign new angle to a variable and when OnVehicleStreamIn is called for that vehicleid, set the new angle. This should work theoretically, but it is not reliable. I used this semi-fix on my server but there still were players reporting that vehicles' angle is set wrong. However I think using a delay here (at OnVehicleStreamIn) would work but I didn't test this.
Maybe YSF could fix this issue.
Posts: 1,042
Threads: 46
Joined: Jun 2013
Quote:
Originally Posted by CodeStyle175
This function works, but when vehicle spawns there must be a delay.
|
This works only if the player is next. Unfortunately, your method is not the solution.
Posts: 455
Threads: 29
Joined: Apr 2014
19.06.2015, 19:45
(
Последний раз редактировалось CodeStyle175; 21.06.2015 в 07:37.
)
Maybe it helps if you spawn bot put him in vehicle and then kick him. Then vehicle synces for playerid.
Posts: 1,042
Threads: 46
Joined: Jun 2013
Quote:
Originally Posted by CodeStyle175
Maybe it helps if you spawn bot but him in vehicle and then kick him. Then vehicle synces for playerid.
|
Why do we have to use these crutches with bots? We need to get a normal fixed.
Posts: 296
Threads: 9
Joined: Oct 2011
Reputation:
0
I don't understand your request..
Here's the scenarios;
* You create the vehicle without an angle Angle of rotation IS KNOWN - 0.0
* You set the angle ANGLE IS KNOWN - 65.0
* Nobody streamed the vehicle - vehicle MUST have the same angle Angle of rotation IS KNOWN- 65.0
* Someone moves the vehicle - Angle of rotation IS KNOWN - retreive with function
In none of these states is the angle of rotation unknown. You either retreive the data - and if the server requires someone to stream the vehicle to provide you the angle of rotation, it cannot change from e.g. 65.0 unless someone goes close enough to change it...
This is not a problem - at all. Unless you have ghosts..