Changed whole project structure (split client and server into separat projects)

This commit is contained in:
hydrant
2019-02-25 22:12:05 +01:00
parent d2181c4987
commit 33abb3d04f
185 changed files with 282 additions and 596 deletions

View File

@@ -0,0 +1,39 @@
using GTANetworkAPI;
using GTANetworkMethods;
using reallife_gamemode.Server.Entities;
using reallife_gamemode.Server.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
/**
* @overview Life of German Reallife - Event ResourceStop (ResourceStop.cs)
* @author VegaZ
* @copyright (c) 2008 - 2018 Life of German
*/
namespace reallife_gamemode.Server.Events
{
public class ResourceStop : Script
{
[ServerEvent(Event.ResourceStop)]
public void OnResourceStop()
{
var users = NAPI.Pools.GetAllPlayers();
foreach(Client user in users)
{
using (var saveUsers = new DatabaseContext())
{
var saveUser = saveUsers.Users.SingleOrDefault(u => u.Name == user.Name);
saveUser.PositionX = user.Position.X;
saveUser.PositionY = user.Position.Y;
saveUser.PositionZ = user.Position.Z;
saveUsers.SaveChanges();
}
}
}
}
}