SA-MP Forums Archive
Vehicle is not rotating... - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Vehicle is not rotating... (/showthread.php?tid=154146)



Vehicle is not rotating... - lolumadd - 12.06.2010

Hey..I have a odd problem and I don't know whats wrong. In vehicle selection, when you press arrow key up/down it should rotate the vehicle left-right. This is my code:

pawn Код:
new Float:a;
          GetVehicleZAngle(PlayerInfo[playerid][dealveh], a);
          SetVehicleZAngle(PlayerInfo[playerid][dealveh], a+5.0);
In-game, the first time I press a key to rotate, it works fine, when I try to press the same arrow key again, it wont move. This happens to the other arrow key as well.

Anyone know whats wrong? Thanks for all help!


Re: Vehicle is not rotating... - DJDhan - 12.06.2010

You must be having a condition to check if the oldkeys and the newkeys are the same.

Something like :

Код:
if ((newkeys & KEY_RIGHT) && !(oldkeys & KEY_RIGHT))



Re: Vehicle is not rotating... - lolumadd - 12.06.2010

Im doing:

pawn Код:
new Keys,ud,lr;
    GetPlayerKeys(playerid,Keys,ud,lr);
   
      if(ud > 0) //down
      {
Im not doing this under OnPlayerKeyState


Re: Vehicle is not rotating... - lolumadd - 12.06.2010

NOTE: Its not the keys..its a problem with the actual functions of rotating (SetVehicleZAngle) because I put the function into a command and it has the same problem.


Re: Vehicle is not rotating... - toneysix - 30.10.2010

That's true. Vehicles won't rotatining. SA:MP messed up.


Respuesta: Vehicle is not rotating... - iDarkRain - 03.12.2011

It's a SA-MP's bug, if you can use DestroyVehicle and CreateVehicle