Jump to content

Shutdown Engines


monstergnom

Recommended Posts

Posted

Hello all,

I want to shutdown the engine of the car when I'm going out.

I used this script:

function turnEngineOff ( theVehicle, leftSeat, jackerPlayer )
-- if it's the driver who got out, and he was not jacked,
if leftSeat == 0 and not jackerPlayer then
-- turn off the engine
setVehicleEngineState ( theVehicle, false )
end
end
-- add 'turnEngineOff' as a handler for "onPlayerExitVehicle"
addEventHandler ( "onPlayerExitVehicle", getRootElement ( ), turnEngineOff )

But it didn't work for me.

I just searched the forum but didn't find anything...

Greets

Posted

ah okay thx =)

now it works as well.

BTW: Why doesnt slrfuel work for me?

Server gets the error: error: .../mods/deathmatch/resources/slrfuel/Server_Petrol.lua:154 attempt to index field '?'

What should i do? The Slrfuel thing isnt even shown on my interface :/

Posted

We can't really help you unless we can see the script that's throwing off that error - but basically you're trying to use a variable that doesn't exist. Check spelling, capitalization (that CAPITAL letters are being used correctly), etc.

(Btw, are you Norwegian? :P)

Posted
We can't really help you unless we can see the script that's throwing off that error - but basically you're trying to use a variable that doesn't exist. Check spelling, capitalization (that CAPITAL letters are being used correctly), etc.

(Btw, are you Norwegian? :P)

Ok, sorry =)

Nah im not norwegian :D

Im talking about this script: https://community.multitheftauto.com/index.php?p=resources&s=details&id=190, i just downloaded it and inserted it into the resources folder, but it wont work :/ just this error i posted in the post above.

Posted
there is a mistake in the example, use the onPlayerVehicleExit event instead of onPlayerExitVehicle

if you find mistakes/wrong statements in examples/on wiki pages you should edit them.

already fixed that page after ive posted my first reply in this topic :wink:

Posted
and how can i shutdown helicopters?

setHelicopterRotorSpeed (theVehicle, 0) doenst work, it gets this error:

attempt to call global 'setHelicopterRotorSpeed'

Read wiki PLEASE! This function is available client-side only.

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...