1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. GTA Network forum is now in archive mode.

Question getVehicleRPM problem

Discussion in 'Questions & Suggestions' started by invisiblejoke, Jul 21, 2017.

  1. invisiblejoke

    invisiblejoke New Member

    Messages:
    2
    Likes Received:
    0
    Joined:
    Jul 21, 2017
    Hi I didn't find anything helpful, so I decided to write this thread ;p

    There is a problem:

    I want to get vehicle RPM, so I created this function:

    API.onUpdate.connect(function()
    {
    var player = API.getLocalPlayer();
    var inVehicle = API.isPlayerInAnyVehicle(player);

    if(inVehicle)
    {
    var car = API.getPlayerVehicle(player);
    var rpm = API.getVehicleRPM(car);
    API.sendChatMessage(rpm.toString());
    }
    }


    Value of rpm param is always 0. I use API.sendChatMessage(rpm.toString()) to show it on screen. Always 0. But Why? This Code seems simply for me but there is something wrong ;/
     
    Last edited: Jul 21, 2017
  2. -Andreas

    -Andreas Well-Known Member

    Messages:
    172
    Likes Received:
    25
    Joined:
    Sep 29, 2016
    Are you constantly updating for this value or what? You don't show where you're using this piece of code.
     
  3. invisiblejoke

    invisiblejoke New Member

    Messages:
    2
    Likes Received:
    0
    Joined:
    Jul 21, 2017
    Yeah its included in

    API.onUpdate.connect(function() {

    (...)

    }
     

Share This Page