Skip to content

Conversation

lopezloo
Copy link
Member

@lopezloo lopezloo commented Aug 8, 2015

So, this basically adds clientside function to control vehicle windows. Also I seen when ped start driveby as driver the window don't open, this fixes that. I redefined windows ID to be 0 - 6 but I'm not sure I do it proper place (game_sa).

@@ -5576,12 +5576,37 @@ void CClientPed::SetDoingGangDriveby ( bool bDriveby )
}
else if ( bDriveby )
{
bool bRight = ( GetOccupiedVehicleSeat ( ) % 2 == 0 ) ? false : true;
char cSeat = GetOccupiedVehicleSeat ( );
bool bRight = ( cSeat % 2 == 0 ) ? false : true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cSeat % 2 == 0 is already a boolean expression.

cSeat % 2 != 0 has the same effect without the ternary operator

@lopezloo
Copy link
Member Author

lopezloo commented Aug 8, 2015

Hm... I can do it but in that case function will return always true, even vehicle don't have specified window.

//edit
Maybe make this always return true? I seen setVehicleDoorState do that.

@ccw808
Copy link
Member

ccw808 commented Aug 8, 2015

I think that is acceptable.

Return always true (between 0 - 6 IDs) if vehicle is unstreamed, but
return true value if is streamed.
@lopezloo
Copy link
Member Author

lopezloo commented Aug 8, 2015

Ok, done.

@qaisjp
Copy link
Contributor

qaisjp commented Aug 8, 2015

Nice work! 👍

@lopezloo lopezloo changed the title Add get/setVehicleWindowOpen Add is/setVehicleWindowOpen Aug 9, 2015
qaisjp added a commit that referenced this pull request Aug 9, 2015
Add is/setVehicleWindowOpen
@qaisjp qaisjp merged commit 7f7e3e1 into multitheftauto:master Aug 9, 2015
@qaisjp qaisjp added the enhancement New feature or request label Sep 6, 2015
samr46 pushed a commit to samr46/mtasa-blue that referenced this pull request Jul 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants