save car at position
This commit is contained in:
@@ -4024,7 +4024,7 @@ namespace ReallifeGamemode.Server.Commands
|
||||
ChatService.BroadcastAdmin("~b~[ADMIN]~s~ " + player.Name + " hat " + target.Name + " den Blackscreen entfernt. ", AdminLevel.ADMIN);
|
||||
}
|
||||
}
|
||||
[Command("washcar", "~m~Benutzung: ~s~/washcar")]
|
||||
/*[Command("washcar", "~m~Benutzung: ~s~/washcar")]
|
||||
public void washcar(Player player)
|
||||
{
|
||||
player.TriggerEvent("washcar");
|
||||
@@ -4035,7 +4035,7 @@ namespace ReallifeGamemode.Server.Commands
|
||||
{
|
||||
player.TriggerEvent("getdirtlevel");
|
||||
}
|
||||
|
||||
*/
|
||||
[Command("makeadmin", "~m~Benutzung: ~s~/makeadmin [Name] [Adminlevel]")]
|
||||
public void CmdAdminMakeadmin(Player player, string name, int rank)
|
||||
{
|
||||
|
||||
@@ -9,6 +9,7 @@ using ReallifeGamemode.Server.Managers;
|
||||
using ReallifeGamemode.Server.Services;
|
||||
using ReallifeGamemode.Server.Util;
|
||||
using ReallifeGamemode.Server.WeaponDeal;
|
||||
using ReallifeGamemode.Database.Models;
|
||||
|
||||
namespace ReallifeGamemode.Server.Events
|
||||
{
|
||||
@@ -65,6 +66,26 @@ namespace ReallifeGamemode.Server.Events
|
||||
//LastVehicle = vehicle;
|
||||
//timerNoobRollerRespawn.Elapsed += async (sender, e) => {await
|
||||
}
|
||||
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
ServerVehicle sV = vehicle.GetServerVehicle(dbContext);
|
||||
|
||||
if (sV is UserVehicle)
|
||||
{
|
||||
Vector3 pos = vehicle.Position;
|
||||
|
||||
sV.PositionX = pos.X;
|
||||
sV.PositionY = pos.Y;
|
||||
sV.PositionZ = pos.Z;
|
||||
sV.Heading = vehicle.Heading;
|
||||
|
||||
dbContext.SaveChanges();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
private static void Timer600000_Elapsed(object sender, ElapsedEventArgs e)
|
||||
{
|
||||
|
||||
@@ -384,7 +384,7 @@ namespace ReallifeGamemode.Server.Managers
|
||||
using (var dbcontext = new DatabaseContext())
|
||||
{
|
||||
User u = c.GetUser(dbcontext);
|
||||
if(u.Handmoney <= 0)
|
||||
if(u.Handmoney < 0)
|
||||
{
|
||||
c.SendNotification("Du hast nicht genug Geld auf der Hand!");
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user