Jump to content

setAlarm not work


BrendonPawn

Recommended Posts

Hi! I would like to know why I am getting this error when using the vehicle function: setAlarm

vehicle.setAlarm(!!1);

Error:
 

(node:4412) UnhandledPromiseRejectionWarning: TypeError: vehicle.setAlarm is not a function

Remembering that I use "vehicle.setColorRGB" without problems.

Link to comment
Share on other sites

results.foreach(data => {
    let vehicle = mp.vehicles.new(mp.joaat(data.model), new mp.Vector3(data.positionx, data.positiony, data.positionz));
    console.log(Object.entries(vehicle));
});

Entries for vehicle:

[['setVariable', [Function]], ['call', [Function]]]

Entries for results:

[['0', RowDataPacket {
    id: 1,
    model: 'caracara2',
    plate: 'JDF 0001',
    alpha: 255,
    positionx: 904.96,
    positiony: -188.912,
    positionz: 73.4449,
    rotationx: -1.47989,
    rotationy: 2.03963,
    rotationz: 237.873,
    dimension: 0,
    color: '220, 220, 220, 220, 220, 220',
    owner: 'None',
    engine: 0,
    alarm: 0,
    locked: 0,
    lights: 0,
    fuel: 100,
    oil: 100,
    weater: 100,
    battery: 100,
    odometer: 0,
    platetype: 0
}]]

 

Edited by BrendonPawn
Fix
Link to comment
Share on other sites

15 hours ago, BrendonPawn said:

results.foreach(data => {
    let vehicle = mp.vehicles.new(mp.joaat(data.model), new mp.Vector3(data.positionx, data.positiony, data.positionz));
    console.log(Object.entries(vehicle));
});

Entries for vehicle:


[['setVariable', [Function]], ['call', [Function]]]

Entries for results:


[['0', RowDataPacket {
    id: 1,
    model: 'caracara2',
    plate: 'JDF 0001',
    alpha: 255,
    positionx: 904.96,
    positiony: -188.912,
    positionz: 73.4449,
    rotationx: -1.47989,
    rotationy: 2.03963,
    rotationz: 237.873,
    dimension: 0,
    color: '220, 220, 220, 220, 220, 220',
    owner: 'None',
    engine: 0,
    alarm: 0,
    locked: 0,
    lights: 0,
    fuel: 100,
    oil: 100,
    weater: 100,
    battery: 100,
    odometer: 0,
    platetype: 0
}]]

 

setAlarm is a clientside function, not a serverside function. That's why you're getting that error.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...