19.02.2011, 21:05
Hey guys, well I know a lot of people code the /engineoff and /engineon to turn the engine on and off but I dont think its a very efficient way in doing it, as people can spam engineoff even when it is off..
I have attempted to code all of it in one command (/engine) So that if the engine is on, and you type /engine it turns it off. Problem is.. If you turn the /engine on and then leave the vehicle and go to a different vehicle and type /engine to turn the engine off, it says "You have turned your engine off", instead of on.
Reason why (I think) is because the bool im using (new bool:engineonoff = false) that changes from on to off on use of the command, But is there a way to detect if the vehicles engine is turned off when they use the command or if its turned on so that it turns the engine off or on according to what state the engine is in.
Thanks in advance.
I have attempted to code all of it in one command (/engine) So that if the engine is on, and you type /engine it turns it off. Problem is.. If you turn the /engine on and then leave the vehicle and go to a different vehicle and type /engine to turn the engine off, it says "You have turned your engine off", instead of on.
Reason why (I think) is because the bool im using (new bool:engineonoff = false) that changes from on to off on use of the command, But is there a way to detect if the vehicles engine is turned off when they use the command or if its turned on so that it turns the engine off or on according to what state the engine is in.
Thanks in advance.