04.03.2009, 01:51
ok, i want to take $100 of the passanger, and give it to the driver, when the passanger exits the vehicle. help, cause i have no idea where to start.
Originally Posted by Daren_Jacobson
start in OnPlayerExitVehicle
|
stock GetVehicleDriver ( iVehicleID ) { for ( new iDriverID; iDriverID < GetMaxPlayers ( ); iDriverID ++ ) { if ( GetPlayerState ( iDriverID ) == PLAYER_STATE_DRIVER ) { if ( GetPlayerVehicleID ( iDriverID ) == iVehicleID) return iDriverID; } } return INVALID_PLAYER_ID; }
if ( IsPlayerInAnyVehicle ( iPassengerID ) { new iDriverID = GetVehicleDriver ( GetPlayerVehicleID ( iPassengerID )); if ( iDriverID != INVALID_PLAYER_ID ) { GivePlayerMoney ( iDriverID, 100); GivePlayerMoney ( iPassengerID, -100); } }