700 lines
35 KiB
C#
700 lines
35 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using GrandTheftMultiplayer.Server;
|
|
using GrandTheftMultiplayer.Shared;
|
|
using GrandTheftMultiplayer.Server.API;
|
|
using GrandTheftMultiplayer.Shared.Math;
|
|
using GrandTheftMultiplayer.Server.Elements;
|
|
using GrandTheftMultiplayer.Server.Constant;
|
|
using GrandTheftMultiplayer.Server.Managers;
|
|
|
|
namespace Roleplay.Fraktionen.FIB
|
|
{
|
|
class FIB : Script
|
|
{
|
|
public const int CALLNACKEN = 4412265;
|
|
public const int CALLNACKEN2 = 412265522;
|
|
public static Dictionary<Client, Client> senderclickedplayerto = new Dictionary<Client, Client>();
|
|
public static List<Client> gefesselt = new List<Client>();
|
|
[Flags]
|
|
public enum AnimationFlags
|
|
{
|
|
Loop = 1 << 0,
|
|
StopOnLastFrame = 1 << 1,
|
|
OnlyAnimateUpperBody = 1 << 4,
|
|
AllowPlayerControl = 1 << 5,
|
|
Cancellable = 1 << 7
|
|
}
|
|
|
|
public FIB()
|
|
{
|
|
API.createPed(PedHash.FibMugger01, new Vector3(158.5779, -730.0903, 47.07695), 54, 0);
|
|
RAPI.Marker.createMarker(0, new Vector3(156.7758, -729.1006, 47.07695), 1, 255, 0, 0, "fib", 0, 185, "Fahrzeuge", 0);
|
|
RAPI.Marker.createMarker(0, new Vector3(149.0154, -725.745, 47.07695), 1, 255, 0, 0, "fibduty", 0, 185, "Dutymarker", 0);
|
|
RAPI.Marker.createMarker(0, new Vector3(145.8134, -724.6799, 47.07695), 1, 255, 0, 0, "fibunduty", 0, 185, "Off-dutymarker", 0);
|
|
RAPI.Marker.createMarker(0, new Vector3(105.8008, -625.7256, 44.22043), 1, 255, 0, 0, "fibabgeben", 0, 185, "Fahrzeuge abgeben", 0);
|
|
RAPI.Marker.createMarker(0, new Vector3(160.7758, -729.1006, 47.07695), 1, 255, 0, 0, "fibgebäude", 0, 185, "FIB Gebäude", 0);
|
|
RAPI.Marker.createMarker(0, new Vector3(134.5006, -764.3837, 242.152), 1, 255, 0, 0, "fibgebäudeout", 0, 185, "FIB Gebäude Verlassen", 0);
|
|
Blip fib = API.createBlip(new Vector3(145.8134, -724.6799, 47.07695));
|
|
fib.sprite = 432;
|
|
fib.name = "FIB";
|
|
API.onEntityEnterColShape += FahrzeugAusleih;
|
|
API.onClientEventTrigger += ClientTrigger;
|
|
API.onPlayerDeath += Dead;
|
|
API.onClientEventTrigger += interaction;
|
|
API.onClientEventTrigger += callBackWantedMenu;
|
|
}
|
|
|
|
Task task = null;
|
|
private void interaction(Client sender, string eventName, object[] arguments)
|
|
{
|
|
if (eventName == "playerinteraction")
|
|
{
|
|
NetHandle ent = (NetHandle)arguments[0];
|
|
Client clickedplayer = API.getPlayerFromHandle(ent);
|
|
if (Fraktionsmanager.isFIB(sender) == true)
|
|
{
|
|
if (senderclickedplayerto.ContainsKey(sender))
|
|
{
|
|
senderclickedplayerto.Remove(sender);
|
|
}
|
|
senderclickedplayerto.Add(sender, clickedplayer);
|
|
//////////////////////////////////////////////////////
|
|
object[] argslist = new object[72];
|
|
argslist[0] = CALLNACKEN2;
|
|
argslist[1] = "Spieler Interaktion";
|
|
argslist[2] = "Optionen:";
|
|
argslist[3] = false;
|
|
int itemlength = 7;
|
|
argslist[4] = itemlength;
|
|
argslist[5] = "~r~Wanteds geben";
|
|
argslist[6] = "~r~Fesseln";
|
|
argslist[7] = "~r~Ins Fahrzeug ziehen";
|
|
argslist[8] = "~r~Spieler dir folgen lassen";
|
|
argslist[9] = "~r~Durchsuchen";
|
|
argslist[10] = "~r~Waffen entnehmen";
|
|
argslist[11] = "~r~Wanteds entfernen";
|
|
for (var i = 0; i < itemlength; i++)
|
|
{
|
|
argslist[12 + i] = "";
|
|
}
|
|
//////////////////////////////////////////////////////////////
|
|
API.triggerClientEvent(sender, "menu_handler_create_menu", argslist);
|
|
}
|
|
}
|
|
else if (eventName == "menu_handler_select_item")
|
|
{
|
|
|
|
int callbackId = (int)arguments[0];
|
|
int index = (int)arguments[1];
|
|
|
|
|
|
if (callbackId == CALLNACKEN2)
|
|
{
|
|
Client clicked = senderclickedplayerto[sender];
|
|
if (index == 0)
|
|
{
|
|
wantedmenu(sender, clicked);
|
|
}
|
|
else if (index == 1)
|
|
{
|
|
if (API.getPlayersInRadiusOfPlayer(3F, sender).Contains(clicked))
|
|
{
|
|
if (!(sender.isInVehicle))
|
|
{
|
|
if (gefesselt.Contains(clicked))
|
|
{
|
|
API.sendNotificationToPlayer(clicked, "Deine Fesseln wurden ~g~gelöst!", true);
|
|
API.sendNotificationToPlayer(sender, "Du hast dem Spieler: " + clicked.name + " die Fesseln abgenommen!");
|
|
API.triggerClientEvent(clicked, "unfesseln");
|
|
gefesselt.Remove(clicked);
|
|
if (API.shared.getEntityModel(clicked) == -1667301416)
|
|
{
|
|
clicked.setClothes(7, 0, 0);
|
|
}
|
|
else if (API.shared.getEntityModel(clicked) == 1885233650)
|
|
{
|
|
clicked.setClothes(7, 0, 0);
|
|
}
|
|
API.stopPlayerAnimation(clicked);
|
|
}
|
|
else
|
|
{
|
|
|
|
API.sendNotificationToPlayer(clicked, "Du wurdest ~r~gefesselt!", true);
|
|
API.sendNotificationToPlayer(sender, "~w~Du hast den Spieler: " + clicked.name + " (~y~" + Commands.cmdLoginRegister.getPlayerID(clicked) + "~w~) gefesselt!");
|
|
API.triggerClientEvent(clicked, "fesseln");
|
|
if (API.shared.getEntityModel(clicked) == -1667301416)
|
|
{
|
|
clicked.setClothes(7, 25, 0);
|
|
}
|
|
else if (API.shared.getEntityModel(clicked) == 1885233650)
|
|
{
|
|
clicked.setClothes(7, 41, 0);
|
|
}
|
|
API.playPlayerAnimation(clicked, (int)(AnimationFlags.Loop | AnimationFlags.OnlyAnimateUpperBody | AnimationFlags.AllowPlayerControl), "mp_arresting", "idle");
|
|
gefesselt.Add(clicked);
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
API.sendNotificationToPlayer(sender, "~r~Du bist nah genug!", true);
|
|
}
|
|
}
|
|
else if (index == 2)
|
|
{
|
|
if (sender.isInVehicle == true)
|
|
{
|
|
if (gefesselt.Contains(clicked))
|
|
{
|
|
API.setPlayerIntoVehicle(clicked, sender.vehicle, 1);
|
|
API.sendNotificationToPlayer(sender, "Der Spieler wird nun versuchen in dein Fahrzeug einzusteigen!");
|
|
if (API.shared.getEntityModel(clicked) == -1667301416)
|
|
{
|
|
clicked.setClothes(7, 25, 0);
|
|
}
|
|
else if (API.shared.getEntityModel(clicked) == 1885233650)
|
|
{
|
|
clicked.setClothes(7, 41, 0);
|
|
}
|
|
API.playPlayerAnimation(clicked, (int)(AnimationFlags.Loop | AnimationFlags.OnlyAnimateUpperBody | AnimationFlags.AllowPlayerControl), "mp_arresting", "idle");
|
|
}
|
|
else
|
|
{
|
|
API.sendNotificationToPlayer(sender, "~r~Fessel den Spieler vorher!");
|
|
}
|
|
}
|
|
else
|
|
{
|
|
API.sendNotificationToPlayer(sender, "Du sitzt im keinem Fahrzeug!");
|
|
}
|
|
|
|
}
|
|
else if (index == 3)
|
|
{
|
|
if (API.getEntityData(clicked, "going") != true)
|
|
{
|
|
API.setEntityData(clicked, "going", true);
|
|
API.delay(1500, false, () => { triggergotoPlayer(sender, clicked); });
|
|
API.sendNotificationToPlayer(sender, "~r~Der Spieler folgt dir nun!");
|
|
}
|
|
else
|
|
{
|
|
API.setEntityData(clicked, "going", false);
|
|
API.sendNotificationToPlayer(sender, "~r~Der Spieler folgt dir nicht mehr!");
|
|
}
|
|
|
|
}
|
|
else if (index == 4)
|
|
{
|
|
if (gefesselt.Contains(clicked) == true)
|
|
{
|
|
WeaponHash[] weapons = API.getPlayerWeapons(clicked);
|
|
API.sendNotificationToPlayer(clicked, "Du wurdest durchsucht!");
|
|
if (API.getEntityData(clicked, "perso") == false)
|
|
{
|
|
API.sendNotificationToPlayer(sender, "Personalausweis gefunden: ");
|
|
API.sendNotificationToPlayer(sender, "Name: " + clicked.name);
|
|
}
|
|
foreach (WeaponHash wp in weapons)
|
|
{
|
|
|
|
API.sendChatMessageToPlayer(sender, "" + Convert.ToString(wp));
|
|
}
|
|
}
|
|
else
|
|
{
|
|
API.sendNotificationToPlayer(sender, "Du musst den Spieler erst fesseln!", true);
|
|
}
|
|
}
|
|
else if (index == 5)
|
|
{
|
|
//WAFFEN ENTNEHMEN
|
|
if (API.getPlayersInRadiusOfPlayer(5F, sender).Contains(clicked) == true)
|
|
{
|
|
if (gefesselt.Contains(clicked) == true)
|
|
{
|
|
API.removeAllPlayerWeapons(clicked);
|
|
API.sendNotificationToPlayer(sender, "Du hast dem Spieler: " + clicked.name + " die Waffen entnommen!");
|
|
API.sendNotificationToPlayer(clicked, "Dir wurden die Waffen entnommen!");
|
|
}
|
|
else
|
|
{
|
|
API.sendNotificationToPlayer(sender, "Du musst den Spieler erst fesseln!", true);
|
|
}
|
|
}
|
|
}
|
|
else if (index == 6)
|
|
{
|
|
|
|
if (API.getPlayersInRadiusOfPlayer(5F, sender).Contains(clicked) == true)
|
|
{
|
|
Fraktionsmanager.setWanteds(clicked, 0);
|
|
API.sendNotificationToPlayer(sender, "Du hast ~r~" + clicked.name + "~w~ alle Wanteds entfernt.");
|
|
API.sendNotificationToPlayer(clicked, "Dir wurden von ~r~" + sender.name + "~w~ alle Wanteds entfernt.");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
public void triggergotoPlayer(Client boss, Client thegoer)
|
|
{
|
|
if (API.getEntityData(thegoer, "going") == true)
|
|
{
|
|
API.sendNativeToPlayer(thegoer, Hash.TASK_GO_TO_ENTITY, thegoer, boss, 20000, 1.0, 4.0, 0, 0);
|
|
}
|
|
else
|
|
{
|
|
API.sendNativeToPlayer(thegoer, Hash.TASK_PAUSE, 1, 1);
|
|
}
|
|
}
|
|
|
|
[Command("kickout")]
|
|
public void kickout(Client player, int ID)
|
|
{
|
|
if (player.isInVehicle == true)
|
|
{
|
|
Client[] vehicleoccupants = player.vehicle.occupants;
|
|
|
|
foreach (Client occupant in vehicleoccupants)
|
|
{
|
|
if (occupant.name == Commands.cmdLoginRegister.getPlayerFromID(ID).name)
|
|
{
|
|
occupant.position = new Vector3(player.vehicle.position.X, player.vehicle.position.Y, player.vehicle.position.Z + 3);
|
|
API.sendNotificationToPlayer(occupant, "~r~Du wurdest aus dem Fahrzeug geworfen!");
|
|
API.sendNotificationToPlayer(player, "~g~Du hast den Spieler aus deinem Fahrzeug geworfen!");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
private void Dead(Client player, NetHandle entityKiller, int weapon)
|
|
{
|
|
if (Fraktionsmanager.isDuty(player) == true)
|
|
{
|
|
API.setEntityData(player, "duty", false);
|
|
Database.CharacterDatabase.setPlayerDatabaseClothes(player, API);
|
|
}
|
|
}
|
|
|
|
private void ClientTrigger(Client sender, string eventName, object[] arguments)
|
|
{
|
|
if (eventName == "menu_handler_select_item")
|
|
{
|
|
int callback = (int)arguments[0];
|
|
int index = (int)arguments[1];
|
|
if (callback == CALLNACKEN)
|
|
{
|
|
if (Fraktionsmanager.isDuty(sender))
|
|
{
|
|
if (index == 0)
|
|
{
|
|
if (Fraktionsmanager.getFraktionsRang(sender) >= 0)
|
|
{
|
|
Vehicle veh = API.createVehicle(VehicleHash.FBI, new Vector3(90.26668, -644.7562, 44.23546), new Vector3(0, 0, -23), 0, 0, 0);
|
|
API.setPlayerIntoVehicle(sender, veh, -1);
|
|
API.setVehicleCustomPrimaryColor(veh, 0, 0, 0);
|
|
API.setEntityData(veh, "Fraktionsfahrzeug", 11);
|
|
API.setEntitySyncedData(veh, "locked", true);
|
|
API.sendNativeToPlayersInDimension(0, Hash.SET_VEHICLE_DOORS_LOCKED, veh, 2);
|
|
API.setVehicleNumberPlate(veh, "FIB");
|
|
}
|
|
}
|
|
else if (index == 1)
|
|
{
|
|
if (Fraktionsmanager.getFraktionsRang(sender) >= 0)
|
|
{
|
|
Vehicle veh = API.createVehicle(VehicleHash.FBI2, new Vector3(90.26668, -644.7562, 44.23546), new Vector3(0, 0, -23), 0, 0, 0);
|
|
API.setPlayerIntoVehicle(sender, veh, -1);
|
|
API.setVehicleCustomPrimaryColor(veh, 0, 0, 0);
|
|
API.setEntityData(veh, "Fraktionsfahrzeug", 11);
|
|
API.setEntitySyncedData(veh, "locked", true);
|
|
API.sendNativeToPlayersInDimension(0, Hash.SET_VEHICLE_DOORS_LOCKED, veh, 2);
|
|
API.setVehicleNumberPlate(veh, "FIB");
|
|
}
|
|
}
|
|
else if (index == 2)
|
|
{
|
|
if (Fraktionsmanager.getFraktionsRang(sender) >= 1)
|
|
{
|
|
Vehicle veh = API.createVehicle(VehicleHash.T20, new Vector3(90.26668, -644.7562, 44.23546), new Vector3(0, 0, -23), 0, 0, 0);
|
|
API.setPlayerIntoVehicle(sender, veh, -1);
|
|
API.setVehicleCustomPrimaryColor(veh, 0, 0, 0);
|
|
API.setEntityData(veh, "Fraktionsfahrzeug", 11);
|
|
API.setEntitySyncedData(veh, "locked", true);
|
|
API.sendNativeToPlayersInDimension(0, Hash.SET_VEHICLE_DOORS_LOCKED, veh, 2);
|
|
API.setVehicleNumberPlate(veh, "FIB");
|
|
}
|
|
}
|
|
else if (index == 3)
|
|
{
|
|
if (Fraktionsmanager.getFraktionsRang(sender) >= 1)
|
|
{
|
|
Vehicle veh = API.createVehicle(VehicleHash.Zentorno, new Vector3(90.26668, -644.7562, 44.23546), new Vector3(0, 0, -23), 0, 0, 0);
|
|
API.setPlayerIntoVehicle(sender, veh, -1);
|
|
API.setVehicleCustomPrimaryColor(veh, 0, 0, 0);
|
|
API.setEntityData(veh, "Fraktionsfahrzeug", 11);
|
|
API.setEntitySyncedData(veh, "locked", true);
|
|
API.sendNativeToPlayersInDimension(0, Hash.SET_VEHICLE_DOORS_LOCKED, veh, 2);
|
|
API.setVehicleNumberPlate(veh, "FIB");
|
|
}
|
|
}
|
|
else if (index == 4)
|
|
{
|
|
if (Fraktionsmanager.getFraktionsRang(sender) >= 2)
|
|
{
|
|
Vehicle veh = API.createVehicle(VehicleHash.Comet2, new Vector3(90.26668, -644.7562, 44.23546), new Vector3(0, 0, -23), 0, 0, 0);
|
|
API.setPlayerIntoVehicle(sender, veh, -1);
|
|
API.setVehicleCustomPrimaryColor(veh, 0, 0, 0);
|
|
API.setEntityData(veh, "Fraktionsfahrzeug", 11);
|
|
API.setEntitySyncedData(veh, "locked", true);
|
|
API.sendNativeToPlayersInDimension(0, Hash.SET_VEHICLE_DOORS_LOCKED, veh, 2);
|
|
API.setVehicleNumberPlate(veh, "FIB");
|
|
}
|
|
}
|
|
else if (index == 5)
|
|
{
|
|
if (Fraktionsmanager.getFraktionsRang(sender) >= 3)
|
|
{
|
|
Vehicle veh = API.createVehicle(VehicleHash.Moonbeam2, new Vector3(90.26668, -644.7562, 44.23546), new Vector3(0, 0, -23), 0, 0, 0);
|
|
API.setPlayerIntoVehicle(sender, veh, -1);
|
|
API.setVehicleCustomPrimaryColor(veh, 0, 0, 0);
|
|
API.setEntityData(veh, "Fraktionsfahrzeug", 11);
|
|
API.setEntitySyncedData(veh, "locked", true);
|
|
API.sendNativeToPlayersInDimension(0, Hash.SET_VEHICLE_DOORS_LOCKED, veh, 2);
|
|
API.setVehicleNumberPlate(veh, "FIB");
|
|
}
|
|
}
|
|
else if (index == 6)
|
|
{
|
|
if (Fraktionsmanager.getFraktionsRang(sender) >= 3)
|
|
{
|
|
Vehicle veh = API.createVehicle(VehicleHash.Tempesta, new Vector3(90.26668, -644.7562, 44.23546), new Vector3(0, 0, -23), 0, 0, 0);
|
|
API.setPlayerIntoVehicle(sender, veh, -1);
|
|
API.setVehicleCustomPrimaryColor(veh, 0, 0, 0);
|
|
API.setEntityData(veh, "Fraktionsfahrzeug", 11);
|
|
API.setEntitySyncedData(veh, "locked", true);
|
|
API.sendNativeToPlayersInDimension(0, Hash.SET_VEHICLE_DOORS_LOCKED, veh, 2);
|
|
API.setVehicleNumberPlate(veh, "FIB");
|
|
}
|
|
}
|
|
else if (index == 7)
|
|
{
|
|
if (Fraktionsmanager.getFraktionsRang(sender) >= 4)
|
|
{
|
|
Vehicle veh = API.createVehicle(VehicleHash.Feltzer2, new Vector3(90.26668, -644.7562, 44.23546), new Vector3(0, 0, -23), 0, 0, 0);
|
|
API.setPlayerIntoVehicle(sender, veh, -1);
|
|
API.setVehicleCustomPrimaryColor(veh, 0, 0, 0);
|
|
API.setEntityData(veh, "Fraktionsfahrzeug", 11);
|
|
API.setEntitySyncedData(veh, "locked", true);
|
|
API.sendNativeToPlayersInDimension(0, Hash.SET_VEHICLE_DOORS_LOCKED, veh, 2);
|
|
API.setVehicleNumberPlate(veh, "FIB");
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
else if (callback == CALLNACKEN + 231)
|
|
{
|
|
if (index == 0)
|
|
{
|
|
int spielerwanteds = Fraktionen.Fraktionsmanager.getWanteds(sender); // Die Wanteds vom Spieler
|
|
int bargeld = Environment.MONEY.Money.getBarMoney(sender); // Das Bargeld vom Spieler
|
|
int leisten = bargeld / 350; // Wie viel Wanteds er sich löschen kann OHNE BEGRENZUNG
|
|
if (leisten >= spielerwanteds)
|
|
{
|
|
Fraktionsmanager.setWanteds(sender, 0);
|
|
Levelsystem.addPlayerLevelFortschritt(sender, spielerwanteds, API);
|
|
Environment.MONEY.Money.giveBarMoney(sender, -(350 * spielerwanteds), API);
|
|
}
|
|
else
|
|
{
|
|
API.sendNotificationToPlayer(sender, "Du kannst dir das nicht leisten!");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
private void FahrzeugAusleih(ColShape colshape, NetHandle entity)
|
|
{
|
|
if (colshape.hasData("fib") == true && entity != null && colshape != null && colshape.getData("fib") == true)
|
|
{
|
|
if (API.getEntityType(entity) == EntityType.Player)
|
|
{
|
|
Client player = API.getPlayerFromHandle(entity);
|
|
if (player != null)
|
|
{
|
|
if (Fraktionsmanager.isFIB(player))
|
|
{
|
|
object[] argumentList = new object[40];
|
|
argumentList[0] = CALLNACKEN;
|
|
argumentList[1] = "Fahrzeuge";
|
|
argumentList[2] = "Fahrzeuge:";
|
|
argumentList[3] = false;
|
|
int itemlength = 8;
|
|
argumentList[4] = itemlength;
|
|
argumentList[5] = "FIB ~m~(Rang 0)"; // RANG 0 /ID Police
|
|
argumentList[6] = "FIB Cruiser ~m~(Rang 0)"; // RANG 0 /ID Police
|
|
argumentList[7] = "T20 ~m~(Rang 1)"; // RANG 1 - 2 / ID Police2
|
|
argumentList[8] = "Zentorno ~m~(Rang 1)"; // RANG 1 - 2 / ID Police2
|
|
argumentList[9] = "Comet ~m~(Rang 2)"; // RANG 1 - 2 / ID Police2
|
|
argumentList[10] = "Moonbeam ~m~(Rang 3)"; // RANG 3 / ID Police3
|
|
argumentList[11] = "Tempesta Transporter ~m~(Rang 3)"; // RANG 3 / ID Police3
|
|
argumentList[12] = "Feltzer ~m~(Rang 4)"; // RANG 4
|
|
for (var i = 0; i < itemlength; i++)
|
|
{
|
|
argumentList[13 + i] = "";
|
|
}
|
|
API.triggerClientEvent(player, "menu_handler_create_menu", argumentList);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (colshape.getData("fibduty") == true)
|
|
{
|
|
Client player = API.getPlayerFromHandle(entity);
|
|
|
|
if (Fraktionsmanager.isFIB(player) == true)
|
|
{
|
|
if (Fraktionsmanager.getFraktionsRang(player) >= 0)
|
|
{
|
|
if (API.getEntityData(player, "duty") == false)
|
|
{
|
|
API.setEntityData(player, "duty", true);
|
|
Fraktionsmanager.sendFraktionsNotification(11, "~g~Der Spieler: " + player.name + " ist nun im Dienst(FIB!)!", true);
|
|
API.givePlayerWeapon(player, WeaponHash.StunGun, 1, true, true);
|
|
API.givePlayerWeapon(player, WeaponHash.Nightstick, 1, true, true);
|
|
API.givePlayerWeapon(player, WeaponHash.Flashlight, 1, true, true);
|
|
API.givePlayerWeapon(player, WeaponHash.SMG, 500, true, true);
|
|
API.givePlayerWeapon(player, WeaponHash.Pistol, 100, true, true);
|
|
API.setPlayerHealth(player, 100);
|
|
API.setPlayerArmor(player, 100);
|
|
if (Fraktionsmanager.getFraktionsRang(player) >= 3)
|
|
{
|
|
API.givePlayerWeapon(player, WeaponHash.CarbineRifle, 500, true, true);
|
|
}
|
|
if (API.getEntityModel(player) == -1667301416)
|
|
{
|
|
}
|
|
else if (API.getEntityModel(player) == 1885233650)
|
|
{
|
|
}
|
|
else
|
|
{
|
|
API.setPlayerSkin(player, PedHash.Cop01SMY);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
API.sendNotificationToPlayer(player, "Du bist nicht in der Fraktion!");
|
|
}
|
|
}
|
|
else if (colshape.getData("fibunduty") == true)
|
|
{
|
|
Client player = API.getPlayerFromHandle(entity);
|
|
|
|
if (API.getEntityData(player, "duty") == true)
|
|
{
|
|
API.setEntityData(player, "duty", false);
|
|
Database.CharacterDatabase.setPlayerDatabaseClothes(player, API);
|
|
API.removeAllPlayerWeapons(player);
|
|
Fraktionsmanager.sendFraktionsNotification(1, "~r~Der Spieler: " + player.name + " ist nicht mehr im Dienst!", true);
|
|
}
|
|
}
|
|
else if (colshape.getData("fibabgeben") == true)
|
|
{
|
|
Client player = API.getPlayerFromHandle(entity);
|
|
if (player != null && player.isInVehicle == true)
|
|
{
|
|
Vehicle veh = player.vehicle;
|
|
if (veh != null)
|
|
{
|
|
if (API.hasEntityData(veh, "Fraktionsfahrzeug") == true && API.getEntityData(veh, "Fraktionsfahrzeug") == 11)
|
|
{
|
|
if (Fraktionsmanager.getFraktion(player) == 11)
|
|
{
|
|
veh.delete();
|
|
API.sendNotificationToPlayer(player, "Fahrzeug eingelagert!");
|
|
}
|
|
else
|
|
{
|
|
API.sendNotificationToPlayer(player, "Du bist nicht in der richtigen Fraktion!");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}else if(colshape.getData("fibgebäude") == true)
|
|
{
|
|
Client Player = API.getPlayerFromHandle(entity);
|
|
if(Player != null && Player.isInVehicle == false)
|
|
{
|
|
API.setEntityPosition(Player, new Vector3(134.635, -765.831, 242.152));
|
|
}
|
|
}
|
|
else if (colshape.getData("fibgebäudeout") == true)
|
|
{
|
|
Client Player = API.getPlayerFromHandle(entity);
|
|
if (Player != null && Player.isInVehicle == false)
|
|
{
|
|
API.setEntityPosition(Player, new Vector3(153.7758, -729.1006, 47.07695));
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public const int wantedcallback = 191919954;
|
|
|
|
|
|
public void callBackWantedMenu(Client sender, string eventName, object[] arguments)
|
|
{
|
|
if (eventName == "menu_handler_select_item")
|
|
{
|
|
int callback = (int)arguments[0];
|
|
if (callback == wantedcallback)
|
|
{
|
|
Client clicked = senderclickedplayerto[sender];
|
|
|
|
int index = (int)arguments[1];
|
|
if (index == 0)
|
|
{
|
|
Fraktionsmanager.giveWanted(clicked, sender, 5, "Fahren ohne Fahr-erlaubnis");
|
|
}
|
|
else if (index == 1)
|
|
{
|
|
Fraktionsmanager.giveWanted(clicked, sender, 5, "Missachtung der Straßenverkehrsordnung");
|
|
}
|
|
else if (index == 2)
|
|
{
|
|
Fraktionsmanager.giveWanted(clicked, sender, 3, "Benutzung eines fahruntuechtigen Fahrzeugs im Straßenverkehr");
|
|
}
|
|
else if (index == 3)
|
|
{
|
|
Fraktionsmanager.giveWanted(clicked, sender, 5, "Fahren abseits der Straße");
|
|
}
|
|
else if (index == 4)
|
|
{
|
|
Fraktionsmanager.giveWanted(clicked, sender, 3, "Fahren ohne Beleuchtung");
|
|
}
|
|
else if (index == 5)
|
|
{
|
|
Fraktionsmanager.giveWanted(clicked, sender, 9, "Unerlaubtes Entfernen vom Unfallort");
|
|
}
|
|
else if (index == 6)
|
|
{
|
|
Fraktionsmanager.giveWanted(clicked, sender, 9, "Illegales Straßenrennen");
|
|
}
|
|
else if (index == 7)
|
|
{
|
|
Fraktionsmanager.giveWanted(clicked, sender, 9, "Oeffentliches tragen einer Waffe");
|
|
}
|
|
else if (index == 8)
|
|
{
|
|
Fraktionsmanager.giveWanted(clicked, sender, 10, "Erpressung/Drohung");
|
|
}
|
|
else if (index == 9)
|
|
{
|
|
Fraktionsmanager.giveWanted(clicked, sender, 10, "Fahren unter Drogen/Rausch");
|
|
}
|
|
else if (index == 10)
|
|
{
|
|
Fraktionsmanager.giveWanted(clicked, sender, 10, "Behinderung der Justiz");
|
|
}
|
|
else if (index == 11)
|
|
{
|
|
Fraktionsmanager.giveWanted(clicked, sender, 10, "Angabe falscher Information");
|
|
}
|
|
else if (index == 12)
|
|
{
|
|
Fraktionsmanager.giveWanted(clicked, sender, 10, "Fahrlaessige Toetung");
|
|
}
|
|
else if (index == 13)
|
|
{
|
|
Fraktionsmanager.giveWanted(clicked, sender, 25, "Geiselnahme");
|
|
}
|
|
else if (index == 14)
|
|
{
|
|
Fraktionsmanager.giveWanted(clicked, sender, 20, "Besitz verbotener Waffen");
|
|
}
|
|
else if (index == 15)
|
|
{
|
|
Fraktionsmanager.giveWanted(clicked, sender, 15, "Waffen benutzung ohne Lizenz");
|
|
}
|
|
else if (index == 16)
|
|
{
|
|
Fraktionsmanager.giveWanted(clicked, sender, 25, "Herbeifuehren einer Explosion");
|
|
}
|
|
else if (index == 17)
|
|
{
|
|
Fraktionsmanager.giveWanted(clicked, sender, 30, "Totschlag/Mord");
|
|
}
|
|
else if (index == 18)
|
|
{
|
|
//CLOSE
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
[Command("walkhere")]
|
|
public void followPlayer(Client player, String target)
|
|
{
|
|
if (Fraktionsmanager.isFIB(player) == true)
|
|
{
|
|
API.sendNativeToPlayer(player, Hash.TASK_GO_STRAIGHT_TO_COORD, API.getPlayerFromName(target), player.position.X, player.position.Y, player.position.Z, 2, -1);
|
|
}
|
|
}
|
|
|
|
|
|
public void wantedmenu(Client player, Client giveto)
|
|
{
|
|
|
|
//////////////////////////////////////////////////////
|
|
object[] argslist = new object[72];
|
|
argslist[0] = wantedcallback;
|
|
argslist[1] = "Spieler Interaktion";
|
|
argslist[2] = "Optionen:";
|
|
argslist[3] = true;
|
|
int itemlength = 20;
|
|
argslist[4] = itemlength;
|
|
argslist[5] = "~g~Fahren ohne Lizenz";
|
|
argslist[6] = "~g~Missacht. der StVo";
|
|
argslist[7] = "~g~Benutzung eines fahrunt. Fahrz.";
|
|
argslist[8] = "~g~Fahren abseits der Straße";
|
|
argslist[9] = "~g~Fahren ohne Licht";
|
|
argslist[10] = "~y~Entfernen vom Unfallort";
|
|
argslist[11] = "~y~Straßenrennen";
|
|
argslist[12] = "~y~Oeffent. tragen einer Waffe";
|
|
argslist[13] = "~y~Erpressung/Drohung";
|
|
argslist[14] = "~y~Fahren unter Drogen/Rausch";
|
|
argslist[15] = "~y~Behinderung der Justiz";
|
|
argslist[16] = "~y~Angabe falscher Information";
|
|
argslist[17] = "~r~Gefaegnisbefreiung";
|
|
argslist[18] = "~r~Fahrlaessige Toetung";
|
|
argslist[19] = "~r~Geiselnahme";
|
|
argslist[20] = "~r~Besitz verbotener Waffen";
|
|
argslist[21] = "~r~Waffen benutzung ohne Lizenz";
|
|
argslist[22] = "~r~Herbeifuehren einer Explosion";
|
|
argslist[23] = "~r~Totschlag/Mord";
|
|
argslist[24] = "~c~Schliessen";
|
|
//25
|
|
for (var i = 0; i < itemlength; i++)
|
|
{
|
|
argslist[25 + i] = "";
|
|
}
|
|
API.triggerClientEvent(player, "menu_handler_create_menu", argslist);
|
|
//////////////////////////////////////////////////////////////
|
|
}
|
|
|
|
}
|
|
}
|