Code
switch(player.GetIdentity().GetPlainId()) {
// Custum Loadout
case "STEAM_ID64": //zm4ster
player.RemoveAllItems();
EntityAI item01b = player.GetInventory().CreateInInventory("M65Jacket_Khaki");
EntityAI item02b = player.GetInventory().CreateInInventory("UKAssVest_Khaki");
EntityAI item03b = player.GetInventory().CreateInInventory("BalaclavaMask_Green");
EntityAI item04b = player.GetInventory().CreateInInventory("BallisticHelmet_Green");
EntityAI item05b = player.GetInventory().CreateInInventory("CargoPants_Green");
EntityAI item06b = player.GetInventory().CreateInInventory("JungleBoots_Green");
EntityAI item07b = player.GetInventory().CreateInInventory("TacticalGloves_Green");
EntityAI item08b = player.GetInventory().CreateInInventory("MilitaryBelt");
EntityAI item09b = player.GetInventory().CreateInInventory("rifleholster_TTsKO_mung");
EntityAI item10b = player.GetInventory().CreateInInventory("Splint");
EntityAI item11b = player.GetInventory().CreateInInventory("FNX45");
EntityAI item12b = player.GetInventory().CreateInInventory("Mag_FNX45_15Rnd");
EntityAI item13b = player.GetInventory().CreateInInventory("Mag_FNX45_15Rnd");
EntityAI item14b = player.GetInventory().CreateInInventory("TacticalBaconCan_Opened");
EntityAI item15b = player.GetInventory().CreateInInventory("CombatKnife");
EntityAI item16b = player.GetInventory().CreateInInventory("BandageDressing");
EntityAI item17b = player.GetInventory().CreateInInventory("BandageDressing");
EntityAI item18b = player.GetInventory().CreateInInventory("MassArmbandDouble_Blue");
EntityAI item19b = player.GetInventory().CreateInInventory("Canteen");
player.SetPosition("7359 5.5 2635"); //Setze Spawn
break;
}
Alles anzeigen
zB
Spoiler anzeigen
Code
void main()
{
//INIT WEATHER BEFORE ECONOMY INIT------------------------
Weather weather = g_Game.GetWeather();
weather.MissionWeather(false); // false = use weather controller from Weather.c
weather.GetOvercast().Set( Math.RandomFloatInclusive(0.4, 0.6), 1, 0);
weather.GetRain().Set( 0, 0, 1);
weather.GetFog().Set( Math.RandomFloatInclusive(0.05, 0.1), 1, 0);
//INIT ECONOMY--------------------------------------
Hive ce = CreateHive();
if ( ce )
ce.InitOffline();
//DATE RESET AFTER ECONOMY INIT-------------------------
int year, month, day, hour, minute;
int reset_month = 9, reset_day = 20;
GetGame().GetWorld().GetDate(year, month, day, hour, minute);
if ((month == reset_month) && (day < reset_day))
{
GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
}
else
{
if ((month == reset_month + 1) && (day > reset_day))
{
GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
}
else
{
if ((month < reset_month) || (month > reset_month + 1))
{
GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
}
}
}
}
class CustomMission: MissionServer
{
void SetRandomHealth(EntityAI itemEnt)
{
if ( itemEnt )
{
int rndHlt = Math.RandomInt(99,100);
itemEnt.SetHealth("","",rndHlt);
}
}
override PlayerBase CreateCharacter(PlayerIdentity identity, vector pos, ParamsReadContext ctx, string characterName)
{
Entity playerEnt;
playerEnt = GetGame().CreatePlayer(identity, characterName, pos, 0, "NONE");//Creates random player
Class.CastTo(m_player, playerEnt);
GetGame().SelectPlayer(identity, m_player);
return m_player;
}
override void StartingEquipSetup(PlayerBase player, bool clothesChosen)
{
EntityAI itemTop;
EntityAI itemEnt;
ItemBase itemBs;
float rand;
itemTop = player.FindAttachmentBySlotName("Body");
if ( itemTop )
{
itemEnt = itemTop.GetInventory().CreateInInventory("Rag");
if ( Class.CastTo(itemBs, itemEnt ) )
itemBs.SetQuantity(4);
SetRandomHealth(itemEnt);
string chemlightArray[] = { "Chemlight_White", "Chemlight_Yellow", "Chemlight_Green", "Chemlight_Red" };
int rndIndex = Math.RandomInt(0, 4);
itemEnt = itemTop.GetInventory().CreateInInventory(chemlightArray[rndIndex]);
SetRandomHealth(itemEnt);
rand = Math.RandomFloatInclusive(0.0, 1.0);
if ( rand < 0.35 )
itemEnt = player.GetInventory().CreateInInventory("Apple");
else if ( rand > 0.65 )
itemEnt = player.GetInventory().CreateInInventory("Pear");
else
itemEnt = player.GetInventory().CreateInInventory("Plum");
SetRandomHealth(itemEnt);
switch(player.GetIdentity().GetPlainId()) {
case "STEAM_ID64": //zm4ster
player.RemoveAllItems();
EntityAI item01b = player.GetInventory().CreateInInventory("M65Jacket_Khaki");
EntityAI item02b = player.GetInventory().CreateInInventory("UKAssVest_Khaki");
EntityAI item03b = player.GetInventory().CreateInInventory("BalaclavaMask_Green");
EntityAI item04b = player.GetInventory().CreateInInventory("BallisticHelmet_Green");
EntityAI item05b = player.GetInventory().CreateInInventory("CargoPants_Green");
EntityAI item06b = player.GetInventory().CreateInInventory("JungleBoots_Green");
EntityAI item07b = player.GetInventory().CreateInInventory("TacticalGloves_Green");
EntityAI item08b = player.GetInventory().CreateInInventory("MilitaryBelt");
EntityAI item09b = player.GetInventory().CreateInInventory("rifleholster_TTsKO_mung");
EntityAI item10b = player.GetInventory().CreateInInventory("Splint");
EntityAI item11b = player.GetInventory().CreateInInventory("FNX45");
EntityAI item12b = player.GetInventory().CreateInInventory("Mag_FNX45_15Rnd");
EntityAI item13b = player.GetInventory().CreateInInventory("Mag_FNX45_15Rnd");
EntityAI item14b = player.GetInventory().CreateInInventory("TacticalBaconCan_Opened");
EntityAI item15b = player.GetInventory().CreateInInventory("CombatKnife");
EntityAI item16b = player.GetInventory().CreateInInventory("BandageDressing");
EntityAI item17b = player.GetInventory().CreateInInventory("BandageDressing");
EntityAI item18b = player.GetInventory().CreateInInventory("MassArmbandDouble_Blue");
EntityAI item19b = player.GetInventory().CreateInInventory("Canteen");
player.SetPosition("7359 5.5 2635"); //Setze Spawn
break;
} }
}
};
Mission CreateCustomMission(string path)
{
return new CustomMission();
}
Alles anzeigen
![GDZ [gdz]](https://germandayz.gg/images/smilies/smiley34.png)