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,87 @@
using System;
using System.Collections.Generic;
using System.Text;
using GTANetworkAPI;
using Newtonsoft.Json;
using reallife_gamemode.Server.Services;
/**
* @overview Life of German Reallife - Server Factions Medic Medic.cs
* @author VegaZ
* @copyright (c) 2008 - 2018 Life of German
*/
namespace reallife_gamemode.Server.Factions.Medic
{
public class Medic : Script
{
public static List<MedicTask> ReviveTasks = new List<MedicTask>();
public static List<MedicTask> HealTasks = new List<MedicTask>();
public static List<MedicTask> FireTasks = new List<MedicTask>();
public static void AddTaskToList(MedicTask task)
{
switch (task.Type)
{
case 0:
ReviveTasks.Add(task);
break;
case 1:
HealTasks.Add(task);
break;
case 2:
FireTasks.Add(task);
break;
}
}
public static void RemoveTaskFromList(MedicTask task)
{
switch (task.Type)
{
case 0:
ReviveTasks.Remove(task);
break;
case 1:
HealTasks.Remove(task);
break;
case 2:
FireTasks.Remove(task);
break;
}
}
[RemoteEvent("loadMedicTasks")]
public void LoadMedicTasks(Client player, int type)
{
switch (type)
{
case 0:
player.TriggerEvent("showMedicTasks", 0, JsonConvert.SerializeObject(ReviveTasks));
break;
case 1:
player.TriggerEvent("showMedicTasks", 1, JsonConvert.SerializeObject(HealTasks));
break;
case 2:
player.TriggerEvent("showMedicTasks", 2, JsonConvert.SerializeObject(FireTasks));
break;
}
}
[RemoteEvent("updateMedicTask")]
public void UpdateMedicTasks(Client player, int type, int index, string medicName)
{
switch (type)
{
case 0:
ReviveTasks[index].MedicName = medicName;
break;
case 1:
HealTasks[index].MedicName = medicName;
break;
case 2:
FireTasks[index].MedicName = medicName;
break;
}
}
}
}