aaaaaaaaa

This commit is contained in:
hydrant
2020-07-29 21:54:25 +02:00
parent d4770c88ed
commit d88b4d8ebf
3 changed files with 28 additions and 4 deletions

View File

@@ -68,7 +68,12 @@ export default class RageEvents implements IEvents {
var rE: RageEntity;
switch (e.type) {
case 'vehicle':
rE = new RageVehicle(<VehicleMp>e);
var veh = <VehicleMp>e;
if (!veh) {
game.ui.sendChatMessage("onEntityStreamIn - veh is null");
return;
}
rE = new RageVehicle(veh);
break;
case 'player':
rE = new RagePlayer(<PlayerMp>e);
@@ -81,6 +86,11 @@ export default class RageEvents implements IEvents {
onPlayerEnterVehicle(callback: (vehicle: IVehicle, seat: VehicleSeat) => void): void {
mp.events.add("playerEnterVehicle", (rV: VehicleMp, rS: number) => {
if (!rV) {
game.ui.sendChatMessage("onPlayerEnterVehicle - rV is null");
return;
}
callback(new RageVehicle(rV), <VehicleSeat>(rS + 1));
});
}