Handsup: Nur noch möglich, wenn man still steht
This commit is contained in:
13
ReallifeGamemode.Client/Player/handsup.ts
Normal file
13
ReallifeGamemode.Client/Player/handsup.ts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
export default function handsup() {
|
||||||
|
mp.events.add("SERVER:Handsup_CheckIfPlayerCanHandsup", () => {
|
||||||
|
var player = mp.players.local;
|
||||||
|
|
||||||
|
var isStopped = player.isStopped();
|
||||||
|
|
||||||
|
mp.gui.chat.push("isStopped = " + isStopped);
|
||||||
|
|
||||||
|
if (isStopped) {
|
||||||
|
mp.events.callRemote("CLIENT:Handsup_TogglePlayerHup");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -265,6 +265,9 @@ antiAfk(globalData);
|
|||||||
import ammunation from './Interaction/ammunation/ammunation';
|
import ammunation from './Interaction/ammunation/ammunation';
|
||||||
ammunation(globalData);
|
ammunation(globalData);
|
||||||
|
|
||||||
|
import handsup from './Player/handsup';
|
||||||
|
handsup();
|
||||||
|
|
||||||
require('./Gui/policedepartment');
|
require('./Gui/policedepartment');
|
||||||
require('./Gui/helptext');
|
require('./Gui/helptext');
|
||||||
require('./admin/spectate');
|
require('./admin/spectate');
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ namespace ReallifeGamemode.Server.Commands
|
|||||||
[Command("hup")]
|
[Command("hup")]
|
||||||
public void CmdUserHup(Player player)
|
public void CmdUserHup(Player player)
|
||||||
{
|
{
|
||||||
player.ToggleSurrender();
|
player.CheckToggleSurrender();
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("event", "~m~Benutzung: ~s~/event [Nachricht]", GreedyArg = true)]
|
[Command("event", "~m~Benutzung: ~s~/event [Nachricht]", GreedyArg = true)]
|
||||||
|
|||||||
@@ -904,7 +904,7 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
[RemoteEvent("keyPress:ControllH")]
|
[RemoteEvent("keyPress:ControllH")]
|
||||||
public void KeyPressControllH(Player player)
|
public void KeyPressControllH(Player player)
|
||||||
{
|
{
|
||||||
player.ToggleSurrender();
|
player.CheckToggleSurrender();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion User Key
|
#endregion User Key
|
||||||
|
|||||||
@@ -24,5 +24,11 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
player.SendNotification("Du wurdest ~b~AFK~s~ gesetzt", true);
|
player.SendNotification("Du wurdest ~b~AFK~s~ gesetzt", true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[RemoteEvent("CLIENT:Handsup_TogglePlayerHup")]
|
||||||
|
public void PlayerToggleHandsupEvent(Player player)
|
||||||
|
{
|
||||||
|
player.ToggleSurrender();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ namespace ReallifeGamemode.Server.Extensions
|
|||||||
|
|
||||||
public static bool IsAfk(this Player player)
|
public static bool IsAfk(this Player player)
|
||||||
{
|
{
|
||||||
if(!player.HasSharedData("isAfk"))
|
if (!player.HasSharedData("isAfk"))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -339,7 +339,7 @@ namespace ReallifeGamemode.Server.Extensions
|
|||||||
int nameTagColor = 0;
|
int nameTagColor = 0;
|
||||||
|
|
||||||
Player player = user.Player;
|
Player player = user.Player;
|
||||||
if(player == null || !player.IsLoggedIn())
|
if (player == null || !player.IsLoggedIn())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -347,7 +347,7 @@ namespace ReallifeGamemode.Server.Extensions
|
|||||||
bool duty = user.GetData<bool>("duty");
|
bool duty = user.GetData<bool>("duty");
|
||||||
bool adminUnshow = user.GetData<bool>("adminUnshow");
|
bool adminUnshow = user.GetData<bool>("adminUnshow");
|
||||||
|
|
||||||
if(adminUnshow)
|
if (adminUnshow)
|
||||||
{
|
{
|
||||||
blipColor = -1;
|
blipColor = -1;
|
||||||
nameTagColor = -3;
|
nameTagColor = -3;
|
||||||
@@ -437,6 +437,11 @@ namespace ReallifeGamemode.Server.Extensions
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void CheckToggleSurrender(this Player player)
|
||||||
|
{
|
||||||
|
player.TriggerEvent("SERVER:Handsup_CheckIfPlayerCanHandsup");
|
||||||
|
}
|
||||||
|
|
||||||
public static void ToggleSurrender(this Player player)
|
public static void ToggleSurrender(this Player player)
|
||||||
{
|
{
|
||||||
if (player.HasAnimation("hup"))
|
if (player.HasAnimation("hup"))
|
||||||
|
|||||||
Reference in New Issue
Block a user