10.12.2010, 08:44
I have one problem.
When i type /v parkiraj for parking vehicle, script getting player's position and facing angle, and setting that data into a file. After that, vehicle is destroying and creating with new data, apropos new coords.
So, vehicle creating position is OK and works, but facing angle is very bad.
Look at the images:
http://slike.hr/slike/samp911_7a315.png.html
http://slike.hr/slike/samp912_de4ba.png.html
http://slike.hr/slike/samp913_bca59.png.html
How to fix vehicle facing angle?
Here is my command:
Sorry for my bad English...
When i type /v parkiraj for parking vehicle, script getting player's position and facing angle, and setting that data into a file. After that, vehicle is destroying and creating with new data, apropos new coords.
So, vehicle creating position is OK and works, but facing angle is very bad.
Look at the images:
http://slike.hr/slike/samp911_7a315.png.html
http://slike.hr/slike/samp912_de4ba.png.html
http://slike.hr/slike/samp913_bca59.png.html
How to fix vehicle facing angle?
Here is my command:
pawn Код:
if(strcmp(tmp, "parkiraj", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAuto] == 0)
{
SendClientMessage(playerid, COLOR_GRAD2, "Ne posedujete vozilo!");
return 1;
}
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pAuto])
{
new vozilo = PlayerInfo[playerid][pAuto];
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
Vozilo[vozilo][hParkX] = X;
Vozilo[vozilo][hParkY] = Y;
Vozilo[vozilo][hParkZ] = Z;
Vozilo[vozilo][hParkA] = A;
SacuvajVozilo(vozilo);
DestroyVehicle(vozilo);
Vozilo[vozilo][ownedvehicle] = CreateVehicle(Vozilo[vozilo][hModel], Vozilo[vozilo][hParkX], Vozilo[vozilo][hParkY], Vozilo[vozilo][hParkZ], Vozilo[vozilo][hParkA], Vozilo[vozilo][hBoja1], Vozilo[vozilo][hBoja2], 300000);
SendClientMessage(playerid, COLOR_YELLOW, " > Vozilo parkirano!");
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "Morate biti u svom vozilu.");
return 1;
}
}