Ragemp-roleplay-skript/Fraktionen/PD/PD.cs
2019-04-16 13:59:07 +02:00

759 lines
38 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.PD
{
class PD : Script
{
public const int CALLNACKEN = 4412245;
public const int CALLNACKEN2 = 441224522;
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 PD()
{
API.createPed(PedHash.Cop01SMY, new Vector3(441.2245, -1013.267, 28.6207), 180, 0);
RAPI.Marker.createMarker(1, new Vector3(441.1335, -1014.145, 27.6207), 1, 255, 0, 0, "police", 0, 185, "Fahrzeuge", 0);
RAPI.Marker.createMarker(1, new Vector3(452.3802, -980.3513, 29.68), 1, 255, 0, 0, "policeduty", 0, 185, "Dutymarker", 0);
RAPI.Marker.createMarker(1, new Vector3(458.1259, -991.8962, 29.7), 1, 255, 0, 0, "policeunduty", 0, 185, "Off-dutymarker", 0);
RAPI.Marker.createMarker(0, new Vector3(463.43, -1015.0, 28.0), 1, 255, 0, 0, "policeabgeben",0,185,"Fahrzeuge abgeben",0);
API.createPed(PedHash.Cop01SFY, new Vector3(441.1913,-978.85,30.6896),176,0);
RAPI.Marker.createMarker(1,new Vector3(441.30303,-981.1234,29.6896), 1, 255, 0, 0, "wtdabgabe",0,185,"",0);
Blip pd = API.createBlip(new Vector3(452.3802, -980.3513, 29.68));
pd.sprite = 60;
pd.name = "LSPD";
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.isPD(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.");
}
}
}
}
}
[Command("pdsuche")]
public void pdsuche(Client player, Client otherplayer){
if(otherplayer != null){
if(Fraktionsmanager.getFraktion(player) == 1){
String auto = "Nein";
String motorrad = "Nein";
if (PlayerDatabase.getDatabaseDataInt(otherplayer, "autoschein") == 1) { auto = "Ja"; } else { auto = "Nein"; }
if (PlayerDatabase.getDatabaseDataInt(otherplayer, "motorradschein") == 1) { motorrad = "Ja"; } else { motorrad = "Nein"; }
API.sendPictureNotificationToPlayer(player,"Ingame Name: " + otherplayer.name, "CHAR_CALL911", 0 , 0, "Los Santos Police Department", "Datenbank");
API.sendPictureNotificationToPlayer(player,"Wanteds: " + Fraktionsmanager.getWanteds(otherplayer), "CHAR_CALL911", 0 , 0, "Los Santos Police Department", "Datenbank");
API.sendPictureNotificationToPlayer(player,"Autofuehrerschein: " + auto, "CHAR_CALL911", 0 , 0, "Los Santos Police Department", "Datenbank");
API.sendPictureNotificationToPlayer(player,"Motorradschein: " + motorrad, "CHAR_CALL911", 0 , 0, "Los Santos Police Department", "Datenbank");
}
}
}
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.Police, new Vector3(450.4816, -1020.088, 28.04), new Vector3(0, 0, 90), 0, 0, 0);
API.setPlayerIntoVehicle(sender, veh, -1);
API.setVehicleCustomPrimaryColor(veh, 255, 255, 255);
API.setEntityData(veh, "Fraktionsfahrzeug", 1);
API.setEntitySyncedData(veh, "locked", true);
API.sendNativeToPlayersInDimension(0, Hash.SET_VEHICLE_DOORS_LOCKED, veh, 2);
API.setVehicleNumberPlate(veh, "LSPD");
API.setVehicleMod(veh,11,3);
API.setVehicleMod(veh,18,0);
}
}
else if (index == 1)
{
if (Fraktionsmanager.getFraktionsRang(sender) >= 0)
{
Vehicle veh = API.createVehicle(VehicleHash.Sheriff, new Vector3(450.4816, -1020.088, 28.04), new Vector3(0, 0, 90), 0, 0, 0);
API.setPlayerIntoVehicle(sender, veh, -1);
API.setVehicleCustomPrimaryColor(veh, 255, 255, 255);
API.setEntityData(veh, "Fraktionsfahrzeug", 1);
API.setEntitySyncedData(veh, "locked", true);
API.sendNativeToPlayersInDimension(0, Hash.SET_VEHICLE_DOORS_LOCKED, veh, 2);
API.setVehicleNumberPlate(veh, "LSPD");
API.setVehicleMod(veh,11,3);
API.setVehicleMod(veh,18,0);
}
}
else if (index == 2)
{
if (Fraktionsmanager.getFraktionsRang(sender) >= 1)
{
Vehicle veh = API.createVehicle(VehicleHash.Police2, new Vector3(450.4816, -1020.088, 28.04), new Vector3(0, 0, 90), 0, 0, 0);
API.setPlayerIntoVehicle(sender, veh, -1);
API.setVehicleCustomPrimaryColor(veh, 255, 255, 255);
API.setEntityData(veh, "Fraktionsfahrzeug", 1);
API.setEntitySyncedData(veh, "locked", true);
API.sendNativeToPlayersInDimension(0, Hash.SET_VEHICLE_DOORS_LOCKED, veh, 2);
API.setVehicleNumberPlate(veh, "LSPD");
API.setVehicleMod(veh,11,3);
API.setVehicleMod(veh,18,0);
}
}
else if (index == 3)
{
if (Fraktionsmanager.getFraktionsRang(sender) >= 1)
{
Vehicle veh = API.createVehicle(VehicleHash.Policeb, new Vector3(450.4816, -1020.088, 28.04), new Vector3(0, 0, 90), 0, 0, 0);
API.setPlayerIntoVehicle(sender, veh, -1);
API.setVehicleCustomPrimaryColor(veh, 255, 255, 255);
API.setEntityData(veh, "Fraktionsfahrzeug", 1);
API.setEntitySyncedData(veh, "locked", true);
API.sendNativeToPlayersInDimension(0, Hash.SET_VEHICLE_DOORS_LOCKED, veh, 2);
API.setVehicleNumberPlate(veh, "LSPD");
API.setVehicleMod(veh,11,3);
API.setVehicleMod(veh,18,0);
}
}
else if (index == 4)
{
if (Fraktionsmanager.getFraktionsRang(sender) >= 2)
{
Vehicle veh = API.createVehicle(VehicleHash.Polmav, new Vector3(450, -981, 44), new Vector3(0, 0, 90), 0, 0, 0);
API.setPlayerIntoVehicle(sender, veh, -1);
API.setVehicleCustomPrimaryColor(veh, 255, 255, 255);
API.setEntityData(veh, "Fraktionsfahrzeug", 1);
API.setEntitySyncedData(veh, "locked", true);
API.sendNativeToPlayersInDimension(0, Hash.SET_VEHICLE_DOORS_LOCKED, veh, 2);
API.setVehicleNumberPlate(veh, "LSPD");
API.setVehicleMod(veh,11,3);
API.setVehicleMod(veh,18,0);
}
}
else if (index == 5)
{
if (Fraktionsmanager.getFraktionsRang(sender) >= 3)
{
Vehicle veh = API.createVehicle(VehicleHash.Granger, new Vector3(450.4816, -1020.088, 28.04), new Vector3(0, 0, 90), 0, 0, 0);
API.setPlayerIntoVehicle(sender, veh, -1);
API.setVehicleCustomPrimaryColor(veh, 255, 255, 255);
API.setEntityData(veh, "Fraktionsfahrzeug", 1);
API.setEntitySyncedData(veh, "locked", true);
API.sendNativeToPlayersInDimension(0, Hash.SET_VEHICLE_DOORS_LOCKED, veh, 2);
API.setVehicleNumberPlate(veh, "LSPD");
API.setVehicleMod(veh,11,3);
API.setVehicleMod(veh,18,0);
}
}
else if (index == 6)
{
if (Fraktionsmanager.getFraktionsRang(sender) >= 3)
{
Vehicle veh = API.createVehicle(VehicleHash.PoliceT, new Vector3(450.4816, -1020.088, 28.04), new Vector3(0, 0, 90), 0, 0, 0);
API.setPlayerIntoVehicle(sender, veh, -1);
API.setVehicleCustomPrimaryColor(veh, 255, 255, 255);
API.setEntityData(veh, "Fraktionsfahrzeug", 1);
API.setEntitySyncedData(veh, "locked", true);
API.sendNativeToPlayersInDimension(0, Hash.SET_VEHICLE_DOORS_LOCKED, veh, 2);
API.setVehicleNumberPlate(veh, "LSPD");
API.setVehicleMod(veh,11,3);
API.setVehicleMod(veh,18,0);
}
}
else if (index == 7)
{
if (Fraktionsmanager.getFraktionsRang(sender) >= 4)
{
Vehicle veh = API.createVehicle(VehicleHash.Police3, new Vector3(450.4816, -1020.088, 28.04), new Vector3(0, 0, 90), 0, 0, 0);
API.setPlayerIntoVehicle(sender, veh, -1);
API.setVehicleCustomPrimaryColor(veh, 255, 255, 255);
API.setEntityData(veh, "Fraktionsfahrzeug", 1);
API.setEntitySyncedData(veh, "locked", true);
API.sendNativeToPlayersInDimension(0, Hash.SET_VEHICLE_DOORS_LOCKED, veh, 2);
API.setVehicleNumberPlate(veh, "LSPD");
API.setVehicleMod(veh,11,3);
API.setVehicleMod(veh,18,0);
}
}
}
} 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("police") == true && entity != null && colshape != null && colshape.getData("police") == true)
{
if (API.getEntityType(entity) == EntityType.Player)
{
Client player = API.getPlayerFromHandle(entity);
if (player != null)
{
if (Fraktionsmanager.isPD(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] = "Cruiser ~m~(Rang 0)"; // RANG 0 /ID Police
argumentList[6] = "Sherrif Cruiser ~m~(Rang 0)"; // RANG 0 /ID Police
argumentList[7] = "Buffalo ~m~(Rang 1)"; // RANG 1 - 2 / ID Police2
argumentList[8] = "Police Bike ~m~(Rang 1)"; // RANG 1 - 2 / ID Police2
argumentList[9] = "Police Maverick ~m~(Rang 2)"; // RANG 1 - 2 / ID Police2
argumentList[10] = "Sheriff Granger ~m~(Rang 3)"; // RANG 3 / ID Police3
argumentList[11] = "Police Transporter ~m~(Rang 3)"; // RANG 3 / ID Police3
argumentList[12] = "Interceptor ~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("policeduty") == true)
{
Client player = API.getPlayerFromHandle(entity);
if (Fraktionsmanager.isPD(player) == true)
{
if (Fraktionsmanager.getFraktionsRang(player) >= 0)
{
if (API.getEntityData(player, "duty") == false)
{
API.setEntityData(player, "duty", true);
Fraktionsmanager.sendFraktionsNotification(1, "~g~Der Spieler: " + player.name + " ist nun im Dienst(PD!)!", 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)
{
GivePoliceOutfit_Female(player);
}
else if (API.getEntityModel(player) == 1885233650)
{
GivePoliceOutfit_Male(player);
}
else
{
API.setPlayerSkin(player, PedHash.Cop01SMY);
}
}
}
}
else
{
API.sendNotificationToPlayer(player, "Du bist nicht in der Fraktion!");
}
}
else if (colshape.getData("policeunduty") == 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("policeabgeben") == 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") == 1)
{
if (Fraktionsmanager.getFraktion(player) == 1)
{
veh.delete();
API.sendNotificationToPlayer(player, "Fahrzeug eingelagert!");
}
else
{
API.sendNotificationToPlayer(player, "Du bist nicht in der richtigen Fraktion!");
}
}
}
}
} else if(colshape.hasData("wtdabgabe") == true && colshape.getData("wtdabgabe") == true){
Client player = API.getPlayerFromHandle(entity);
if(player != null){
if(Fraktionen.Fraktionsmanager.getWanteds(player) != 0){
int calculatedprice = Fraktionen.Fraktionsmanager.getWanteds(player) * 350;
object[] argumentList = new object[57];
argumentList[0] = CALLNACKEN + 231;
argumentList[1] = "Akte";
argumentList[2] = "Optionen:";
argumentList[3] = false;
int itemlength = 1;
argumentList[4] = itemlength;
argumentList[5] = "Wanteds löschen";
argumentList[6] = "~c~Kosten ~y~" + calculatedprice;
API.triggerClientEvent(player, "menu_handler_create_menu", argumentList);
}
}
}
}
public void GivePoliceOutfit_Male(Client player)
{
player.setClothes(3, 0, 0);
player.setClothes(4, 35, 0);
player.setClothes(5, 0, 0);
player.setClothes(6, 25, 0);
player.setClothes(7, 0, 0);
player.setClothes(8, 58, 0);
player.setClothes(9, 0, 0);
player.setClothes(10, 0, 0);
player.setClothes(11, 55, 0);
}
public void GivePoliceOutfit_Female(Client player)
{
player.setClothes(3, 14, 0);
player.setClothes(4, 34, 0);
player.setClothes(5, 0, 0);
player.setClothes(6, 25, 0);
player.setClothes(7, 0, 0);
player.setClothes(8, 35, 0);
player.setClothes(9, 0, 0);
player.setClothes(10, 0, 0);
player.setClothes(11, 48, 0);
}
[Command("su")]
public void su(Client player,int playerid, int anzahl, string grund)
{
Levelsystem.addPlayerLevelFortschritt(player,1,API);
Fraktionsmanager.giveWanted(Commands.cmdLoginRegister.getPlayerFromID(playerid), player, anzahl, grund);
}
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.isPD(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);
//////////////////////////////////////////////////////////////
}
}
}