test carwash
This commit is contained in:
@@ -286,6 +286,9 @@ notification();
|
||||
import rentCar from './util/rentcar';
|
||||
rentCar(globalData);
|
||||
|
||||
import Carwash from './util/carwash';
|
||||
Carwash(globalData);
|
||||
|
||||
require('./Gui/policedepartment');
|
||||
require('./Gui/helptext');
|
||||
require('./admin/spectate');
|
||||
|
||||
16
ReallifeGamemode.Client/util/carwash.ts
Normal file
16
ReallifeGamemode.Client/util/carwash.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
export default function Carwash(globalData: IGlobalData) {
|
||||
|
||||
mp.events.add('washcar', () => {
|
||||
let vehicle = mp.players.local.vehicle;
|
||||
|
||||
vehicle.setDirtLevel(0);
|
||||
});
|
||||
|
||||
mp.events.add('entityStreamIn', (entity) => {
|
||||
if (entity.type !== 'vehicle' || !entity.hasVariable('dirtLevel')) {
|
||||
return;
|
||||
}
|
||||
const dirtLevel = entity.getVariable('dirtLevel') || 0;
|
||||
entity.setDirtLevel(parseFloat(dirtLevel));
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user