SetVehicleZAngle -
Romz - 16.06.2015
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:
Re: SetVehicleZAngle -
iRusel - 16.06.2015
Also faced with this problem.
Do something.
Re: SetVehicleZAngle -
Ted67 - 18.06.2015
Yeah, I aggree.
Please, fix it.
Re: SetVehicleZAngle -
Jimmy0wns - 18.06.2015
You can just do this to set it's angle:
Quote:
new vehicleid = CreateVehicle(411, 0.0, 0.0, 0.0, 65.000, -1, -1, -1);
|
And I don't seem to get the point of why you would want to change the angle anyways, if you want to change the vehicle's angle where the player is sitting in, it's just as easy as this:
Quote:
SetVehicleZAngle(GetPlayerVehicleID(playerid), 65.000);
|
Re: SetVehicleZAngle -
valych - 18.06.2015
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.
Re: SetVehicleZAngle -
Romz - 18.06.2015
Jimmy0wns, your method is not suitable.
Re: SetVehicleZAngle -
[Saint] - 18.06.2015
it not SA-MP bug, it bug of game GTA - SA opcode
0x0175
Re: SetVehicleZAngle -
Romz - 18.06.2015
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.
Re: SetVehicleZAngle -
[Saint] - 18.06.2015
Quote:
Originally Posted by Kolstin
I think it's still a bug samp. The problem is particularly visible on the server side.
|
i know 100% it bug GTA SA, not SA-MP
Re: SetVehicleZAngle -
Romz - 18.06.2015
Quote:
Originally Posted by [Saint]
i know 100% it bug GTA SA, not SA-MP
|
All the same it is necessary fixes ...
Re: SetVehicleZAngle -
Spmn - 18.06.2015
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.
Re: SetVehicleZAngle -
Romz - 18.06.2015
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.
Re: SetVehicleZAngle -
CodeStyle175 - 18.06.2015
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);
}
Re: SetVehicleZAngle -
Romz - 19.06.2015
CodeStyle175, this does
not work! Evidence:
http://forum.sa-mp.com/showpost.php?...ostcount=13487
Re: SetVehicleZAngle -
CodeStyle175 - 19.06.2015
This function works, but when vehicle spawns there must be a delay.
Re: SetVehicleZAngle -
Spmn - 19.06.2015
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.
Re: SetVehicleZAngle -
Romz - 19.06.2015
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.
Re: SetVehicleZAngle -
CodeStyle175 - 19.06.2015
Maybe it helps if you spawn bot put him in vehicle and then kick him. Then vehicle synces for playerid.
Re: SetVehicleZAngle -
Romz - 19.06.2015
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.
Re: SetVehicleZAngle -
liquor - 21.06.2015
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..