19.04.2015, 07:46
Hello,
I wanted to try out the new "ability" of opening/closing the windows of a car.
I started scripting and at first I made a command to check my car's windows' state.
Without doing anything, just created a vehicle the command says that the car's windows' status are like this:
Which basically means they're closed.
However, I made a command to open the windows and it came out like this:
And now they're open.
I then proceeded making a command (yeah, I know, I could've make all of this into one command) that'd close the windows and the windows' state came out:
And now they're closed again.
I then made a command like that checks the vehicle windows' status and if they're open (0) it says "Open", Closed (1) says "Closed". I used the switch statement, e.g:
So, my question is: Am I doing something wrong or it's possible a "bug". If I spawn a car and do like /checkwindows it says all the windows are missing (see the switch statement example) aka they're -1.
Shouldn't all cars have the state set to 1 which is closed?
As I said, I might be doing something wrong. Tried this all out myself since on the wiki there's no explanation yet.
Thanks for your time.
I wanted to try out the new "ability" of opening/closing the windows of a car.
I started scripting and at first I made a command to check my car's windows' state.
Without doing anything, just created a vehicle the command says that the car's windows' status are like this:
PHP код:
Driver: -1, Passenger: -1, Back Left: -1, Back Right: -1
However, I made a command to open the windows and it came out like this:
PHP код:
Driver: 0, Passenger: 0, Back Left: 0, Back Right: 0
I then proceeded making a command (yeah, I know, I could've make all of this into one command) that'd close the windows and the windows' state came out:
PHP код:
Driver: 1, Passenger: 1, Back Left: 1, Back Right: 1
I then made a command like that checks the vehicle windows' status and if they're open (0) it says "Open", Closed (1) says "Closed". I used the switch statement, e.g:
PHP код:
switch(driver){
case 0: dst = ""COL_GREEN"Open";
case 1: dst = ""COL_RED"Closed";
default: dst = "Missing";
}
Shouldn't all cars have the state set to 1 which is closed?
As I said, I might be doing something wrong. Tried this all out myself since on the wiki there's no explanation yet.
Thanks for your time.