Add ClientSide Files

This commit is contained in:
VegaZ
2018-11-01 15:08:54 +01:00
parent f1495fbb82
commit 8e46680218
2 changed files with 42 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Text;
using GTANetworkAPI;
/**
* @overview Life of German Reallife - Managers BankManager (BankManager.cs)
* @author VegaZ
* @copyright (c) 2008 - 2018 Life of German
*/
namespace reallife_gamemode.Server.Managers
{
public class DoorManager : Script
{
[RemoteEvent("ChangeDoorState")]
public void ChangeDoorState(Client player)
{
var isNearDoor = NAPI.ColShape.IsPointWithinColshape(LoadManager.policeDoors, player.Position);
if (isNearDoor)
{
if (NAPI.Data.GetWorldData("policeDoors") == false)
{
player.SendNotification("Polizeitüren ~r~abgeschlossen", false);
NAPI.ClientEvent.TriggerClientEventForAll("changeDoorState", 320433149, 434.7479f, -983.2151f, 30.83926f, 1, 0.0f, 0.0f, 0.0f);
NAPI.ClientEvent.TriggerClientEventForAll("changeDoorState", -1215222675, 434.7479f, -980.6184f, 30.83926f, 1, 0.0f, 0.0f, 0.0f);
NAPI.Data.SetWorldData("policeDoors", true);
}
else
{
player.SendNotification("Polizeitüren ~g~aufgeschlossen", false);
NAPI.ClientEvent.TriggerClientEventForAll("changeDoorState", 320433149, 434.7479f, -983.2151f, 30.83926f, 0, 0.0f, 0.0f, 0.0f);
NAPI.ClientEvent.TriggerClientEventForAll("changeDoorState", -1215222675, 434.7479f, -980.6184f, 30.83926f, 0, 0.0f, 0.0f, 0.0f);
NAPI.Data.SetWorldData("policeDoors", false);
}
}
}
}
}