Important Note: This function has no effect on un-occupied vehicles and does not effect trains.
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys){if(IsPlayerInAnyVehicle(playerid)){ if(isUtas(playerid)) { if (newkeys & KEY_UP) { SetVehicleVelocity(GetPlayerVehicleID(playerid),1.0,0.0,0.0); } if (newkeys & KEY_DOWN) { SetVehicleVelocity(GetPlayerVehicleID(playerid),-1.0,0.0,0.0); } if (newkeys & KEY_LEFT) { SetVehicleVelocity(GetPlayerVehicleID(playerid),0.0,-1.0,0.0); } if (newkeys & KEY_RIGHT) { SetVehicleVelocity(GetPlayerVehicleID(playerid),0.0,1.0,0.0); }}}return 1;}stock isUtas(playerid) { return (GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) ? true : false;}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys){if(IsPlayerInAnyVehicle(playerid)){ if(isUtas(playerid)) { if (newkeys & KEY_UP) { SetVehicleVelocity(GetPlayerVehicleID(playerid),1.0,0.0,0.0); } if (newkeys & KEY_DOWN) { SetVehicleVelocity(GetPlayerVehicleID(playerid),-1.0,0.0,0.0); } if (newkeys & KEY_LEFT) { SetVehicleZAngle(GetPlayerVehicleID(playerid), -1); } if (newkeys & KEY_RIGHT) { SetVehicleZAngle(GetPlayerVehicleID(playerid), 1); }}}return 1;}stock isUtas(playerid) { return (GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) ? true : false;}