Files
reallife-gamemode/Main.cs
2018-11-03 22:34:45 +01:00

68 lines
2.1 KiB
C#

using System;
using System.Linq;
using GTANetworkAPI;
using Microsoft.EntityFrameworkCore;
using reallife_gamemode.Model;
using reallife_gamemode.Server.Entities;
using reallife_gamemode.Server.Managers;
/**
* @overview Life of German Reallife - Main Class (Main.cs)
* @author VegaZ, hydrant
* @copyright (c) 2008 - 2018 Life of German
*/
namespace reallife_gamemode
{
public class Main : Script
{
public static readonly Vector3 DEFAULT_SPAWN_POSITION = new Vector3(-427.5189, 1116.453, 326.7829);
public static readonly float DEFAULT_SPAWN_HEADING = 340.8f;
[ServerEvent(Event.ResourceStart)]
public void OnResourceStart()
{
NAPI.Server.SetGlobalServerChat(false);
NAPI.Server.SetCommandErrorMessage("~r~[FEHLER]~s~ Dieser Command existiert nicht.");
NAPI.Server.SetDefaultSpawnLocation(DEFAULT_SPAWN_POSITION, DEFAULT_SPAWN_HEADING);
NAPI.Server.SetAutoSpawnOnConnect(false);
NAPI.Server.SetAutoRespawnAfterDeath(false);
NAPI.Data.SetWorldData("playerCreatorDimension", 0);
NAPI.Data.SetWorldData("policeDoors", false);
TuningManager.AddTuningGarage(new Vector3(-341, -134, 38.5));
using (var context = new DatabaseContext())
{
context.Bans.FirstOrDefault();
context.Factions.FirstOrDefault();
context.Users.FirstOrDefault();
context.SaveChanges();
}
TempBlip tempBlip = new TempBlip()
{
Color = 1,
Name = "",
Transparency = 0,
ShortRange = true,
Sprite = 1,
Scale = 1,
};
NAPI.Data.SetWorldData("blipTemplate", tempBlip);
}
}
public class TempBlip
{
public byte Color { get; set; }
public string Name { get; set; }
public byte Transparency { get; set; }
public bool ShortRange { get; set; }
public uint Sprite { get; set; }
public float Scale { get; set; }
}
}