This commit is contained in:
jack77213 2020-03-30 13:45:01 +08:00
parent f988593037
commit 7ab166465e
Signed by: jack77213
GPG key ID: CA81AA7BB873B9F1
3 changed files with 81 additions and 0 deletions

1
tk/$PBOPREFIX$ Normal file
View file

@ -0,0 +1 @@
hijack_server\tk

42
tk/config.cpp Normal file
View file

@ -0,0 +1,42 @@
class CfgPatches
{
class hijack_server_tk
{
name = "Hijack Server 1pp Addon";
author = "jack77213";
url = "https://hijack.moe";
requiredVersion = 1.72;
requiredAddons[] = {"A3_Functions_F"};
units[] = {};
weapons[] = {};
};
};
class CfgFunctions
{
class hijack
{
class server
{
class tk
{
file="\hijack_server\tk\fn_tk.sqf";
postInit=1;
};
};
};
};
class CfgDebriefing
{
class End4
{
title = "Teamkill!";
subtitle = "subtitle";
description = "Teamkill is not Allowed.";
pictureBackground = "";
picture = "b_inf";
pictureColor[] = {0.0,0.3,0.6,1};
};
};

38
tk/fn_tk.sqf Normal file
View file

@ -0,0 +1,38 @@
if (!isServer) exitWith {};
hijack_tk_client = {
[] spawn {
waitUntil { alive player };
HIJACK_TKS = 0;
/*
player addEventHandler ["HandleDamage", {
params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
if (isPlayer _instigator) then {
if (_instigator == _unit) then {
remoteExecCall ["hijack_tk_client_kick", _instigator];
};
};
}];
*/
player addEventHandler ["Killed", {
params ["_unit", "_killer", "_instigator", "_useEffects"];
if (isPlayer _instigator) then {
if (_instigator != _unit) then {
remoteExecCall ["hijack_tk_client_kick", _instigator];
};
};
}];
};
};
hijack_tk_client_kick = {
if (HIJACK_TKS < 2) then {
HIJACK_TKS = HIJACK_TKS + 1;
} else {
["End4", false, 2] call BIS_fnc_endMission;
};
};
publicVariable "hijack_tk_client_kick";
publicVariable "hijack_tk_client";
remoteExecCall ["hijack_tk_client", -2, true];