Merge interaction to develop
This commit is contained in:
@@ -26,6 +26,7 @@ mp.events.add("startDeathTimer", (isAdmin) => {
|
||||
else {
|
||||
mp.gui.chat.activate(false);
|
||||
}
|
||||
mp.game.audio.playSoundFrontend(-1, "Bed", "WastedSounds", true);
|
||||
deathDate = new Date();
|
||||
respawnTime = Math.floor(deathDate.getTime() / 1000 + 120);
|
||||
fade = 255 - 120;
|
||||
|
||||
243
Client/Interaction/factioninteraction.js
Normal file
243
Client/Interaction/factioninteraction.js
Normal file
@@ -0,0 +1,243 @@
|
||||
let screenRes = mp.game.graphics.getScreenResolution(0, 0);
|
||||
const player = mp.players.local;
|
||||
var tasks;
|
||||
var initTasks;
|
||||
var newTasks;
|
||||
var sorting = 0;
|
||||
var activeTask = false;
|
||||
var activeCheckpoint;
|
||||
var taskStart;
|
||||
var taskFinish;
|
||||
var taskRange;
|
||||
var ambulanceImagePos;
|
||||
var rangeLeft;
|
||||
var sortText = "Nach Uhrzeit"
|
||||
|
||||
const NativeUI = require("nativeui");
|
||||
const Menu = NativeUI.Menu;
|
||||
const UIMenuItem = NativeUI.UIMenuItem;
|
||||
const UIMenuListItem = NativeUI.UIMenuListItem;
|
||||
const UIMenuCheckboxItem = NativeUI.UIMenuCheckboxItem;
|
||||
const BadgeStyle = NativeUI.BadgeStyle;
|
||||
const Point = NativeUI.Point;
|
||||
const ItemsCollection = NativeUI.ItemsCollection;
|
||||
const Color = NativeUI.Color;
|
||||
|
||||
var factionInteractionMenu;
|
||||
var reviveTaskMenu;
|
||||
|
||||
mp.events.add("updateFactionBlips", (type, taskList) => {
|
||||
|
||||
});
|
||||
|
||||
mp.events.add("showFactionInteraction", (userFactionId, userFactionName, isFactionLeader, reviveTaskCount, healTaskCount, fireTaskCount) => {
|
||||
mp.gui.chat.activate(false);
|
||||
globalData.Interaction = true;
|
||||
|
||||
var rP = ((reviveTaskCount === "0") ? "~r~" : "~g~");
|
||||
var hP = ((healTaskCount === "0") ? "~r~" : "~g~");
|
||||
var fP = ((fireTaskCount === "0") ? "~r~" : "~g~");
|
||||
|
||||
factionInteractionMenu = new Menu("Fraktionsinteraktion", userFactionName, new Point(0, screenRes.y / 2));
|
||||
|
||||
if (isFactionLeader) {
|
||||
let leaderMenu = new UIMenuItem("Leadermen\u00fc", "Verwaltung der Fraktion");
|
||||
leaderMenu.SetRightBadge(BadgeStyle.Star);
|
||||
factionInteractionMenu.AddItem(leaderMenu);
|
||||
}
|
||||
let reviveTaskMenu;
|
||||
let healTaskMenu;
|
||||
let fireTaskMenu;
|
||||
|
||||
switch (userFactionId) {
|
||||
case 2:
|
||||
reviveTaskMenu = new UIMenuItem("Reviveauftr\u00e4ge");
|
||||
reviveTaskMenu.SetRightLabel(rP + reviveTaskCount)
|
||||
factionInteractionMenu.AddItem(reviveTaskMenu);
|
||||
|
||||
healTaskMenu = new UIMenuItem("Healauftr\u00e4ge");
|
||||
healTaskMenu.SetRightLabel(hP + healTaskCount)
|
||||
factionInteractionMenu.AddItem(healTaskMenu);
|
||||
|
||||
fireTaskMenu = new UIMenuItem("Feuerauftr\u00e4ge");
|
||||
fireTaskMenu.SetRightLabel(fP + fireTaskCount)
|
||||
factionInteractionMenu.AddItem(fireTaskMenu);
|
||||
break;
|
||||
}
|
||||
|
||||
let cancelItem = new UIMenuItem("Schlie\u00dfen", "Schlie\u00dft die Fraktionsinteraktion");
|
||||
cancelItem.BackColor = new Color(213, 0, 0);
|
||||
cancelItem.HighlightedBackColor = new Color(229, 57, 53);
|
||||
factionInteractionMenu.AddItem(cancelItem);
|
||||
|
||||
factionInteractionMenu.Visible = true;
|
||||
|
||||
factionInteractionMenu.ItemSelect.on((item) => {
|
||||
switch (item) {
|
||||
case cancelItem:
|
||||
factionInteractionMenu.Visible = false;
|
||||
mp.gui.chat.activate(true);
|
||||
globalData.Interaction = false;
|
||||
break;
|
||||
case reviveTaskMenu:
|
||||
mp.events.callRemote("loadMedicTasks", 0)
|
||||
factionInteractionMenu.Visible = false;
|
||||
mp.gui.chat.activate(true);
|
||||
globalData.Interaction = false;
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
factionInteractionMenu.MenuClose.on(() => {
|
||||
mp.gui.chat.activate(true);
|
||||
globalData.Interaction = false;
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
mp.events.add("showMedicTasks", (type, taskList) => {
|
||||
tasks = JSON.parse(taskList);
|
||||
if (sorting === 0) {
|
||||
initTasks = tasks;
|
||||
}
|
||||
mp.gui.chat.activate(false);
|
||||
globalData.Interaction = true;
|
||||
switch (type) {
|
||||
case 0:
|
||||
reviveTaskMenu = new Menu("Revives", "Sortierung: ~g~" + sortText + " ~y~[NUM 5]", new Point(0, screenRes.y / 2));
|
||||
let aTask;
|
||||
for (var i = 0; i < tasks.length; i++) {
|
||||
if (tasks[i].MedicName === "none") {
|
||||
aTask = new UIMenuItem("~g~" + tasks[i].Victim);
|
||||
} else {
|
||||
aTask = new UIMenuItem("~r~" + tasks[i].Victim);
|
||||
}
|
||||
|
||||
aTask.SetRightLabel(mp.game.gameplay.getDistanceBetweenCoords(player.position.x, player.position.y, player.position.z, tasks[i].Position.x, tasks[i].Position.y, tasks[i].Position.z, true).toFixed(2).toString() + " ~g~m");
|
||||
reviveTaskMenu.AddItem(aTask);
|
||||
}
|
||||
|
||||
let backItem = new UIMenuItem("Zur\u00fcck", "Zur\u00fcck zur Fraktionsinteraktion");
|
||||
backItem.BackColor = new Color(213, 0, 0);
|
||||
backItem.HighlightedBackColor = new Color(229, 57, 53);
|
||||
reviveTaskMenu.AddItem(backItem);
|
||||
|
||||
reviveTaskMenu.ItemSelect.on((item, index) => {
|
||||
if (item === backItem) {
|
||||
reviveTaskMenu.Visible = false;
|
||||
factionInteractionMenu.Visible = true;
|
||||
} else {
|
||||
if (tasks[index].MedicName === "none") {
|
||||
mp.game.graphics.requestStreamedTextureDict("medicimages", true);
|
||||
mp.events.callRemote("updateMedicTask", 0, index, player.name);
|
||||
mp.game.ui.setNewWaypoint(tasks[index].Position.x, tasks[index].Position.y);
|
||||
activeCheckpoint = mp.markers.new(1, new mp.Vector3(tasks[index].Position.x, tasks[index].Position.y, tasks[index].Position.z - 2), 3.0, {
|
||||
color: [255, 0, 0, 150],
|
||||
visible: true,
|
||||
dimension: 0
|
||||
});
|
||||
reviveTaskMenu.Visible = false;
|
||||
mp.gui.chat.activate(true);
|
||||
globalData.Interaction = false;
|
||||
ambulanceImagePos = 0.325
|
||||
taskStart = player.position;
|
||||
taskFinish = tasks[index].Position;
|
||||
taskRange = mp.game.gameplay.getDistanceBetweenCoords(player.position.x, player.position.y, player.position.z, tasks[index].Position.x, tasks[index].Position.y, tasks[index].Position.z, true);
|
||||
activeTask = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
reviveTaskMenu.MenuClose.on(() => {
|
||||
reviveTaskMenu.Visible = false;
|
||||
factionInteractionMenu.Visible = true;
|
||||
});
|
||||
break;
|
||||
case 1:
|
||||
break;
|
||||
case 2:
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
mp.events.add("sortFactionTasks", () => {
|
||||
newTasks = tasks;
|
||||
if (sorting < 4) {
|
||||
sorting++;
|
||||
} else {
|
||||
sorting = 0;
|
||||
}
|
||||
switch (sorting) {
|
||||
case 0: //Standartsortierung
|
||||
|
||||
reviveTaskMenu.Close();
|
||||
factionInteractionMenu.Close();
|
||||
mp.events.call("showMedicTasks", 0, JSON.stringify(initTasks));
|
||||
sortText = "Nach Uhrzeit";
|
||||
break;
|
||||
|
||||
case 1: //Sortierung nach Metern (aufsteigend)
|
||||
|
||||
for (d = 0; d < newTasks.length; d++) {
|
||||
for (e = 0; e < newTasks.length - 1; e++) {
|
||||
if (getDistance1(e) > getDistance2(e + 1)) {
|
||||
var tempTask = newTasks[e];
|
||||
newTasks[e] = newTasks[e + 1];
|
||||
newTasks[e + 1] = tempTask;
|
||||
mp.gui.chat.push("SWITCH");
|
||||
}
|
||||
}
|
||||
}
|
||||
sortText = "Entfernung aufsteigend";
|
||||
reviveTaskMenu.Close();
|
||||
factionInteractionMenu.Close();
|
||||
mp.events.call("showMedicTasks", 0, JSON.stringify(newTasks));
|
||||
break;
|
||||
|
||||
//case 2: //Sortierung nach Metern (absteigend)
|
||||
// mp.gui.chat.push("Sorting 2");
|
||||
// sortText = "Entfernung absteigend";
|
||||
// break;
|
||||
//case 3: //Sortierung nach Zeit (aufsteigend)
|
||||
// mp.gui.chat.push("Sorting 3");
|
||||
// sortText = "Restzeit aufsteigend";
|
||||
// break;
|
||||
//case 4: //Sortierung nach Zeit (absteigend)
|
||||
// mp.gui.chat.push("Sorting 4");
|
||||
// sortText = "Restzeit absteigend";
|
||||
// break;
|
||||
}
|
||||
});
|
||||
|
||||
function getDistance1(index) {
|
||||
return mp.game.gameplay.getDistanceBetweenCoords(player.position.x, player.position.y, player.position.z, newTasks[index].Position.x, newTasks[index].Position.y, newTasks[index].Position.z, true).toFixed(2);
|
||||
}
|
||||
function getDistance2(index) {
|
||||
return mp.game.gameplay.getDistanceBetweenCoords(player.position.x, player.position.y, player.position.z, newTasks[index].Position.x, newTasks[index].Position.y, newTasks[index].Position.z, true).toFixed(2);
|
||||
}
|
||||
|
||||
mp.events.add('render', () => {
|
||||
if (activeTask) {
|
||||
rangeLeft = mp.game.gameplay.getDistanceBetweenCoords(player.position.x, player.position.y, player.position.z, taskFinish.x, taskFinish.y, taskFinish.z, true).toFixed(2);
|
||||
if (rangeLeft > 1.9) {
|
||||
ambulanceImagePos = 0.655 - (mp.game.gameplay.getDistanceBetweenCoords(player.position.x, player.position.y, player.position.z, taskFinish.x, taskFinish.y, taskFinish.z, true) / taskRange * 0.35);
|
||||
mp.game.graphics.drawRect(0.5, 0.945, 0.35, 0.025, 150, 0, 0, 200);
|
||||
mp.game.graphics.drawText(rangeLeft.toString() + "m", [0.5, 0.93], {
|
||||
font: 0,
|
||||
color: [255, 255, 255, 255],
|
||||
scale: [0.35, 0.35],
|
||||
outline: true,
|
||||
centre: true
|
||||
});
|
||||
mp.game.graphics.drawSprite("medicimages", "finish", 0.655, 0.898, 0.04, 0.07, 0, 255, 255, 255, 255);
|
||||
if (player.isInAnyVehicle(false)) {
|
||||
mp.game.graphics.drawSprite("medicimages", "ambulance", ambulanceImagePos + 0.01, 0.915, 0.04, 0.07, 0, 255, 255, 255, 255);
|
||||
} else {
|
||||
mp.game.graphics.drawSprite("medicimages", "running", ambulanceImagePos + 0.02, 0.915, 0.02, 0.035, 0, 255, 0, 0, 255);
|
||||
}
|
||||
} else {
|
||||
activeTask = false;
|
||||
activeCheckpoint.destroy();
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -42,7 +42,7 @@ const Color = NativeUI.Color;
|
||||
mp.events.add("showPlayerInteraction", (nearPlayerArr) => {
|
||||
mp.gui.chat.activate(false);
|
||||
nearbyPlayers = JSON.parse(nearPlayerArr);
|
||||
globalData.PlayerInteraction = true;
|
||||
globalData.Interaction = true;
|
||||
let playerInteractionMenu = new Menu("Spielerinteraktion", "", new Point(0, screenRes.y / 2));
|
||||
let playerSelect = new UIMenuListItem("Mit", "~y~W\u00e4hle den Spieler aus.", new ItemsCollection(nearbyPlayers));
|
||||
playerInteractionMenu.AddItem(playerSelect);
|
||||
@@ -60,17 +60,17 @@ mp.events.add("showPlayerInteraction", (nearPlayerArr) => {
|
||||
mp.events.callRemote("openTradeInventory", playerSelect.SelectedValue);
|
||||
playerInteractionMenu.Visible = false;
|
||||
mp.gui.chat.activate(true);
|
||||
globalData.PlayerInteraction = false;
|
||||
globalData.Interaction = false;
|
||||
} else if (item.Text === "Schlie\u00dfen") {
|
||||
playerInteractionMenu.Visible = false;
|
||||
mp.gui.chat.activate(true);
|
||||
globalData.PlayerInteraction = false;
|
||||
globalData.Interaction = false;
|
||||
}
|
||||
});
|
||||
|
||||
playerInteractionMenu.MenuClose.on(() => {
|
||||
mp.gui.chat.activate(true);
|
||||
globalData.PlayerInteraction = false;
|
||||
globalData.Interaction = false;
|
||||
});
|
||||
});
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
//https://docs.microsoft.com/de-de/windows/desktop/inputdev/virtual-key-codes
|
||||
|
||||
var chat = false;
|
||||
var showInventory = false;
|
||||
var showGui = true;
|
||||
var showInv = false;
|
||||
@@ -22,12 +21,31 @@ mp.keys.bind(0x0D, false, function () {
|
||||
|
||||
//LEFT ARROW (Interaktion mit anderen Spielern)
|
||||
mp.keys.bind(0x25, false, function () {
|
||||
if (!globalData.InChat && !showInv && !globalData.PlayerInteraction) {
|
||||
if (!globalData.InChat && !showInv && !globalData.Interaction) {
|
||||
mp.events.callRemote("keyPress:LEFT_ARROW");
|
||||
}
|
||||
});
|
||||
|
||||
//UP ARROW (Interaktion mit anderen Spielern)
|
||||
mp.keys.bind(0x26, false, function () {
|
||||
if (!globalData.InChat && !showInv && !globalData.Interaction) {
|
||||
mp.events.callRemote("keyPress:UP_ARROW");
|
||||
}
|
||||
});
|
||||
|
||||
//RIGHT ARROW (Interaktion mit anderen Spielern)
|
||||
mp.keys.bind(0x27, false, function () {
|
||||
if (!globalData.InChat && !showInv && !globalData.Interaction) {
|
||||
mp.events.callRemote("keyPress:RIGHT_ARROW");
|
||||
}
|
||||
});
|
||||
|
||||
//DOWN ARROW (Interaktion mit anderen Spielern)
|
||||
mp.keys.bind(0x28, false, function () {
|
||||
if (!globalData.InChat && !showInv && !globalData.Interaction) {
|
||||
mp.events.callRemote("keyPress:DOWN_ARROW");
|
||||
}
|
||||
});
|
||||
//F7 //Unshowalles
|
||||
mp.keys.bind(0x76, false, function () {
|
||||
if (showGui === true) {
|
||||
@@ -46,6 +64,13 @@ mp.keys.bind(0x62, false, function () {
|
||||
}
|
||||
});
|
||||
|
||||
//NUM5 //Fraktionsinteraktion (Tasks sortieren)
|
||||
mp.keys.bind(0x65, false, function () {
|
||||
if (!globalData.InChat) {
|
||||
mp.events.call("sortFactionTasks");
|
||||
}
|
||||
});
|
||||
|
||||
//E
|
||||
mp.keys.bind(0x45, false, function () {
|
||||
if (!globalData.InChat) {
|
||||
|
||||
3
Client/dlcpacks/medicimages/dlc.rpf
Normal file
3
Client/dlcpacks/medicimages/dlc.rpf
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:3f017f66bb91eed7430558929321ad5851973a2d75f886bf4b461cda349344fc
|
||||
size 12288
|
||||
@@ -2,12 +2,12 @@
|
||||
* @overview Life of German Reallife - Login index.js
|
||||
* @author VegaZ, hydrant
|
||||
* @copyright (c) 2008 - 2018 Life of German
|
||||
*/
|
||||
**/
|
||||
|
||||
let globalData = {
|
||||
InTuning: false,
|
||||
HideGui: false,
|
||||
PlayerInteraction: false,
|
||||
Interaction: false,
|
||||
InChat: false
|
||||
};
|
||||
|
||||
@@ -19,8 +19,8 @@ require('./Business/main.js');
|
||||
require('./Business/cardealer.js');
|
||||
|
||||
require('./CharCreator/index.js');
|
||||
|
||||
require('./coloredhlights');
|
||||
|
||||
require('./DoorManager/doormanager.js');
|
||||
|
||||
require('./FactionManagement/main.js');
|
||||
@@ -33,7 +33,8 @@ require('./Gui/Inventory/inventory.js');
|
||||
require('./Gui/vehiclemenu/main.js');
|
||||
require('./Gui/interiors.js');
|
||||
|
||||
require('./Interaction/interaction.js');
|
||||
require('./Interaction/factioninteraction.js');
|
||||
require('./Interaction/playerinteraction.js');
|
||||
|
||||
require('./Login/main.js');
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ using reallife_gamemode.Server.Saves;
|
||||
using reallife_gamemode.Server.Business;
|
||||
using System.Text.RegularExpressions;
|
||||
using reallife_gamemode.Server.Classes;
|
||||
using reallife_gamemode.Server.Factions.Medic;
|
||||
|
||||
/**
|
||||
* @overview Life of German Reallife - Admin Commands (Admin.cs)
|
||||
@@ -1006,6 +1007,9 @@ namespace reallife_gamemode.Server.Commands
|
||||
target.SetData("isDead", false);
|
||||
NAPI.Player.SpawnPlayer(target, target.Position);
|
||||
target.Health = 100;
|
||||
|
||||
MedicTask task = Medic.ReviveTasks.FirstOrDefault(t => t.Victim == target.Name);
|
||||
Medic.RemoveTaskFromList(task);
|
||||
}
|
||||
|
||||
[Command("setarmor", "~m~Benutzung: ~s~/setarmor [Spieler] (Armor)")]
|
||||
@@ -1268,6 +1272,9 @@ namespace reallife_gamemode.Server.Commands
|
||||
|
||||
NAPI.Player.SpawnPlayer(managedClient, managedClient.Position);
|
||||
managedClient.Health = 100;
|
||||
|
||||
//MedicTask task = Medic.ReviveTasks.FirstOrDefault(t => t.Victim == managedClient.Name);
|
||||
//Medic.RemoveTaskFromList(task);
|
||||
}
|
||||
|
||||
player.SendChatMessage("~b~Du hast " + playerRevided + " Spieler wiederbelebt.");
|
||||
|
||||
@@ -3,6 +3,7 @@ using Newtonsoft.Json;
|
||||
using reallife_gamemode.Model;
|
||||
using reallife_gamemode.Server.Entities;
|
||||
using reallife_gamemode.Server.Extensions;
|
||||
using reallife_gamemode.Server.Factions.Medic;
|
||||
using reallife_gamemode.Server.Services;
|
||||
using reallife_gamemode.Server.Util;
|
||||
using System;
|
||||
@@ -243,6 +244,9 @@ namespace reallife_gamemode.Server.Commands
|
||||
deadPlayer.SetData("isDead", false);
|
||||
NAPI.Player.SpawnPlayer(deadPlayer, deadPlayer.Position);
|
||||
deadPlayer.Health = 50;
|
||||
|
||||
MedicTask task = Medic.ReviveTasks.FirstOrDefault(t => t.Victim == deadPlayer.Name);
|
||||
Medic.RemoveTaskFromList(task);
|
||||
}
|
||||
|
||||
[Command("heal", "~m~Benutzung: ~s~/heal [Spieler]")] //TODO Eventuell noch mit Geldbetrag wie bei SA:MP
|
||||
|
||||
@@ -6,6 +6,7 @@ using GTANetworkAPI;
|
||||
using GTANetworkMethods;
|
||||
using reallife_gamemode.Model;
|
||||
using reallife_gamemode.Server.Extensions;
|
||||
using reallife_gamemode.Server.Factions.Medic;
|
||||
using reallife_gamemode.Server.Services;
|
||||
using reallife_gamemode.Server.Util;
|
||||
|
||||
@@ -76,6 +77,21 @@ namespace reallife_gamemode.Server.Events
|
||||
ChatService.BroadcastAdmin(message, AdminLevel.ADMIN);
|
||||
}
|
||||
}
|
||||
//MEDIC AUFTRAG
|
||||
MedicTask reviveTask = new MedicTask()
|
||||
{
|
||||
Victim = player.Name,
|
||||
Position = player.Position,
|
||||
CauseOfDeath = reason.ToString(),
|
||||
Caller = null,
|
||||
Description = "Gestorben",
|
||||
Time = DateTime.Now,
|
||||
Type = 0,
|
||||
MedicName = "none"
|
||||
};
|
||||
Medic.AddTaskToList(reviveTask);
|
||||
|
||||
//TODO PICTURE NOTIFICATION + SOUND für Medics
|
||||
|
||||
using (var userDeath = new DatabaseContext())
|
||||
{
|
||||
|
||||
@@ -8,6 +8,7 @@ using reallife_gamemode.Model;
|
||||
using reallife_gamemode.Server.Classes;
|
||||
using reallife_gamemode.Server.Entities;
|
||||
using reallife_gamemode.Server.Extensions;
|
||||
using reallife_gamemode.Server.Factions.Medic;
|
||||
using reallife_gamemode.Server.Inventory;
|
||||
using reallife_gamemode.Server.Inventory.Interfaces;
|
||||
using reallife_gamemode.Server.Managers;
|
||||
@@ -60,9 +61,18 @@ namespace reallife_gamemode.Server.Events
|
||||
}
|
||||
player.TriggerEvent("showPlayerInteraction", JsonConvert.SerializeObject(nearbyPlayerList));
|
||||
}
|
||||
else
|
||||
}
|
||||
[RemoteEvent("keyPress:RIGHT_ARROW")]
|
||||
public void KeyPressRightArrow(Client player)
|
||||
{
|
||||
player.SendNotification("~r~Es ist niemand in deiner N\u00e4he!", false);
|
||||
if (!player.IsLoggedIn()) return;
|
||||
User user = player.GetUser();
|
||||
switch (user.FactionId)
|
||||
{
|
||||
//LSFD
|
||||
case 2:
|
||||
player.TriggerEvent("showFactionInteraction", user.FactionId, user.GetFaction().Name, user.FactionLeader, Medic.ReviveTasks.Count.ToString(), Medic.HealTasks.Count.ToString(), Medic.FireTasks.Count.ToString());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
87
Server/Factions/Medic/Medic.cs
Normal file
87
Server/Factions/Medic/Medic.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
26
Server/Factions/Medic/MedicTask.cs
Normal file
26
Server/Factions/Medic/MedicTask.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using GTANetworkAPI;
|
||||
|
||||
/**
|
||||
* @overview Life of German Reallife - Server Factions Medic MedicTask.cs
|
||||
* @author VegaZ
|
||||
* @copyright (c) 2008 - 2018 Life of German
|
||||
*/
|
||||
|
||||
|
||||
namespace reallife_gamemode.Server.Factions.Medic
|
||||
{
|
||||
public class MedicTask
|
||||
{
|
||||
public string Victim { get; set; }
|
||||
public Vector3 Position { get; set; }
|
||||
public int Type { get; set; }
|
||||
public string CauseOfDeath { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string Caller { get; set; }
|
||||
public DateTime Time { get; set; }
|
||||
public string MedicName { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,11 @@ namespace reallife_gamemode.Server.Managers
|
||||
{
|
||||
public class InteractionManager : Script
|
||||
{
|
||||
#region Umgebungsinteraktionen PFEILTASTE-HOCH
|
||||
#endregion
|
||||
#region Eigeninteraktionen PFEILTASTE-RUNTER
|
||||
#endregion
|
||||
#region Spielerinteraktionen PFEILTASTE-LINKS
|
||||
[RemoteEvent("openTradeInventory")]
|
||||
public void OpenTradeInventory(Client player, string targetPlayer)
|
||||
{
|
||||
@@ -50,5 +55,8 @@ namespace reallife_gamemode.Server.Managers
|
||||
tradeRequester.TriggerEvent("unlockTradeItems");
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region Fraktionsinteraktionen / Jobinteraktionen PFEILTASTE-RECHTS
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user