Vehicle is not rotating...
#1

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!
Reply
#2

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))
Reply
#3

Im doing:

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

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.
Reply
#5

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)