Possible Opening/Closing windows bug: -
N0ri - 19.04.2015
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:
PHP код:
Driver: -1, Passenger: -1, Back Left: -1, Back Right: -1
Which basically means they're closed.
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
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:
PHP код:
Driver: 1, Passenger: 1, Back Left: 1, Back Right: 1
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:
PHP код:
switch(driver){
case 0: dst = ""COL_GREEN"Open";
case 1: dst = ""COL_RED"Closed";
default: dst = "Missing";
}
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.
Re: Possible Opening/Closing windows bug: -
MP2 - 19.04.2015
-1 means 'unset'. This is the default state (rolled up).
Re: Possible Opening/Closing windows bug: -
N0ri - 19.04.2015
Would be nice having a parameter like we've the siren one now so we don't gotta set each of the vehicle's parameter to 1.
Found out what I needed, though. Thank you nevertheless, I'll +rep you.
Re: Possible Opening/Closing windows bug: -
Threshold - 19.04.2015
Essentially you can just do this:
pawn Код:
switch(driver){
case 0: dst = ""COL_GREEN"Open";
case -1, 1: dst = ""COL_RED"Closed";
default: dst = "Missing";
}
Can't you?
Re: Possible Opening/Closing windows bug: -
MP2 - 19.04.2015
It should be
case 0: Open
case 1: Closed
Case -1: Closed (default)
Re: Possible Opening/Closing windows bug: -
N0ri - 19.04.2015
@Threshold: I did that in the first place but it didn't work out now it does (lol). Thank you as well.