evtl fix taxifahrer fehler
This commit is contained in:
@@ -6,10 +6,18 @@ class RageEntity implements IEntity {
|
||||
private entity: EntityMp;
|
||||
|
||||
get id(): number {
|
||||
if (!this.entity) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return this.entity.id;
|
||||
}
|
||||
|
||||
get remoteId(): number {
|
||||
if (!this.entity) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return this.entity.remoteId;
|
||||
}
|
||||
|
||||
@@ -18,6 +26,10 @@ class RageEntity implements IEntity {
|
||||
}
|
||||
|
||||
get type(): EntityType {
|
||||
if (!this.entity) {
|
||||
return null;
|
||||
}
|
||||
|
||||
switch (this.entity.type) {
|
||||
case 'vehicle': return EntityType.Vehicle;
|
||||
case 'player': return EntityType.Player;
|
||||
@@ -26,6 +38,10 @@ class RageEntity implements IEntity {
|
||||
}
|
||||
|
||||
getSharedData<T>(key: string): T {
|
||||
if (!this.entity) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var data = this.entity.getVariable(key);
|
||||
if (typeof data !== 'undefined') {
|
||||
return parseJson<T>(<string>data);
|
||||
@@ -45,11 +61,19 @@ class RagePlayer extends RageEntity implements IPlayer {
|
||||
}
|
||||
|
||||
get vehicle(): IVehicle {
|
||||
if (!this.player) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var veh: VehicleMp = this.player.vehicle;
|
||||
return veh ? new RageVehicle(veh) : null;
|
||||
}
|
||||
|
||||
get inVehicle(): boolean {
|
||||
if (!this.player) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return this.player.isInAnyVehicle(false);
|
||||
}
|
||||
|
||||
|
||||
@@ -388,7 +388,11 @@ namespace ReallifeGamemode.Server.Managers
|
||||
public void JobManagerPlayerEnterVehicle(Player player, Vehicle veh, sbyte seat)
|
||||
{
|
||||
ServerVehicle sVeh = veh.GetServerVehicle();
|
||||
//if (sVeh == null) return;
|
||||
if (sVeh == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (seat != 0)
|
||||
{
|
||||
if (sVeh is JobVehicle jV && jV.JobId == 1) // Spieler steigt in Taxi ein
|
||||
|
||||
Reference in New Issue
Block a user