Redox Posted August 16, 2010 Posted August 16, 2010 Hi, I have question. How can I do so: In function is condition eg: car = getPlayerOccupiedVehicle ( source ) if car == (id vehicle) then I try do this, but vehicle id is like this: 000000F6. When I do this, it doesn't work: car = getPlayerOccupiedVehicle ( source ) if car == "000000F6" then
dzek (varez) Posted August 16, 2010 Posted August 16, 2010 getPedOccupiedVehicle returns vehihicle element, not its model id. After you get element get model id with getElementModel(vehicle) Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online! programista php rzeszów Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting. Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!
Redox Posted August 16, 2010 Author Posted August 16, 2010 Hmm, here there is no such numbers, that the first vehicle is an id 1, second id 2, etc.
dzek (varez) Posted August 16, 2010 Posted August 16, 2010 you want to assign an id to each spawned car? That will be pretty weird. Tell us whatnyou are trying to do - not in the code, but the idea. Eighter your idea or you english is wrong, so i need more info to understand you.. Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online! programista php rzeszów Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting. Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!
Redox Posted August 16, 2010 Author Posted August 16, 2010 I want to do one car for police, but no policecar (eg police sultan) and only in this car can use key 'h'. I made function on key 'h' to flashing lights, and I want to put there "if car == id". Now you understand me? ;> I hope so
50p Posted August 17, 2010 Posted August 17, 2010 I want to do one car for police, but no policecar (eg police sultan) and only in this car can use key 'h'. I made function on key 'h' to flashing lights, and I want to put there "if car == id". Now you understand me? ;> I hope so You want to compare model ID not an "ID" of a vehicle. Use getElementModel and compare the returned value with model ID of Sultan (iirc it's 560). - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
Redox Posted August 19, 2010 Author Posted August 19, 2010 But when I have on my map sultan, and sultan id is 560, when I put this id, then in all cars (sultans) this function be work. 50p where are you from?
50p Posted August 19, 2010 Posted August 19, 2010 If you want it to work on specific cars only then you can use element data. Use setElementData to set some specific data and then use getElementData to check if this specific data was set. - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
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