gruppe kosten

This commit is contained in:
2020-08-02 20:28:14 +02:00
parent 3cf4cc33fa
commit f19d79d968
3 changed files with 13 additions and 2 deletions

View File

@@ -114,6 +114,7 @@ class RageEntityAttachmentPool implements IEntityAttachmentPool {
} }
set(entity: IEntity, attachments: any[], attachmentObjects: any[]): IEntityAttachments { set(entity: IEntity, attachments: any[], attachmentObjects: any[]): IEntityAttachments {
if (!this.attachmentPool) { if (!this.attachmentPool) {
let e = new RageAttachments(entity, attachments, attachmentObjects); let e = new RageAttachments(entity, attachments, attachmentObjects);
this.attachmentPool = []; this.attachmentPool = [];
@@ -125,10 +126,10 @@ class RageEntityAttachmentPool implements IEntityAttachmentPool {
for (let obj of this.attachmentPool.keys()) { for (let obj of this.attachmentPool.keys()) {
if (entity.remoteId == this.attachmentPool[obj].remoteId) { this.remove(entity); } if (entity.remoteId == this.attachmentPool[obj].remoteId) { this.remove(entity); }
} }
let e = new RageAttachments(entity, attachments, attachmentObjects); let e = new RageAttachments(entity, attachments, attachmentObjects);
this.attachmentPool.push(e); this.attachmentPool.push(e);
return e;
return e;
} }
at(remoteId: any): IEntityAttachments { at(remoteId: any): IEntityAttachments {

View File

@@ -1,10 +1,13 @@
using System; using System;
using System.Collections.Generic;
using GTANetworkAPI; using GTANetworkAPI;
using ReallifeGamemode.Database.Entities; using ReallifeGamemode.Database.Entities;
using ReallifeGamemode.Server.Extensions; using ReallifeGamemode.Server.Extensions;
using ReallifeGamemode.Server.Finance; using ReallifeGamemode.Server.Finance;
using ReallifeGamemode.Server.Managers;
using ReallifeGamemode.Server.Services; using ReallifeGamemode.Server.Services;
using ReallifeGamemode.Server.Types; using ReallifeGamemode.Server.Types;
using ReallifeGamemode.Server.Util;
namespace ReallifeGamemode.Server.Commands namespace ReallifeGamemode.Server.Commands
{ {

View File

@@ -57,6 +57,13 @@ namespace ReallifeGamemode.Server.Managers
u.Group = group; u.Group = group;
u.GroupRank = GroupRank.OWNER; u.GroupRank = GroupRank.OWNER;
if (player.GetUser(dbContext).BankAccount.Balance < 50000)
{
ChatService.ErrorMessage(player, "Du hast nicht genug Geld");
return;
}
player.GetUser(dbContext).BankAccount.Balance -= 50000;
dbContext.SaveChanges(); dbContext.SaveChanges();
ChatService.BroadcastGroup($"Die Gruppe \"{name}\" wurde erfolgreich erstellt.", group); ChatService.BroadcastGroup($"Die Gruppe \"{name}\" wurde erfolgreich erstellt.", group);