BrendonPawn Posted December 19, 2019 Share Posted December 19, 2019 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 More sharing options...
Evgeniy_Moguchiy Posted December 20, 2019 Share Posted December 20, 2019 Can you show the value of 'vehicle' variable? Link to comment Share on other sites More sharing options...
BrendonPawn Posted December 22, 2019 Author Share Posted December 22, 2019 (edited) 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 December 22, 2019 by BrendonPawn Fix Link to comment Share on other sites More sharing options...
MrPancakers Posted December 23, 2019 Share Posted December 23, 2019 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. 1 Link to comment Share on other sites More sharing options...
BrendonPawn Posted December 23, 2019 Author Share Posted December 23, 2019 (edited) Explained! Thank you! Edited December 23, 2019 by BrendonPawn Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now