Hallo, und zwar will ich auf meinen Server verschiedene random Ausrüstung an meine Spieler vergeben.
Nun habe ich dies alles soweit in die init.c Datei hinzugefügt nur habe ich jetzt noch das Problem das aus irgendein Grund die Magazine für die Waffen nicht mit Spawnen.
Aber alles andere Waffen, Kleidung, Essen bekommt man nur halt nicht die Magazine.
Hier mal meine init.c : Danke schon mal für die Hilfe.
Code
void main()
{
Hive ce = CreateHive();
if ( ce )
ce.InitOffline();
Weather weather = g_Game.GetWeather();
weather.GetOvercast().SetLimits( 0.0 , 1.0 );
weather.GetRain().SetLimits( 0.0 , 1.0 );
weather.GetFog().SetLimits( 0.0 , 0.25 );
weather.GetOvercast().SetForecastChangeLimits( 0.0, 0.2 );
weather.GetRain().SetForecastChangeLimits( 0.0, 0.1 );
weather.GetFog().SetForecastChangeLimits( 0.15, 0.45 );
weather.GetOvercast().SetForecastTimeLimits( 1800 , 1800 );
weather.GetRain().SetForecastTimeLimits( 600 , 600 );
weather.GetFog().SetForecastTimeLimits( 1800 , 1800 );
weather.GetOvercast().Set( Math.RandomFloatInclusive(0.0, 0.3), 0, 0);
weather.GetRain().Set( Math.RandomFloatInclusive(0.0, 0.2), 0, 0);
weather.GetFog().Set( Math.RandomFloatInclusive(0.0, 0.1), 0, 0);
weather.SetWindMaximumSpeed(15);
weather.SetWindFunctionParams(0.1, 0.3, 50);
}
class CustomMission: MissionServer
{
void SetRandomHealth(EntityAI itemEnt)
{
int rndHlt = Math.RandomInt(60,100);
itemEnt.SetHealth("","",rndHlt);
}
override PlayerBase CreateCharacter(PlayerIdentity identity, vector pos, ParamsReadContext ctx, string characterName)
{
Entity playerEnt = GetGame().CreatePlayer(identity, characterName, pos, 0, "NONE");
Class.CastTo(m_player, playerEnt);
GetGame().SelectPlayer(identity, m_player);
return m_player;
}
override void StartingEquipSetup(PlayerBase player, bool clothesChosen)
{
player.RemoveAllItems();
EntityAI itemEnt;
ItemBase itemBs;
switch (Math.RandomInt(0, 9)) {
case 0:
// Soldier
itemEnt = player.GetHumanInventory().CreateInHands("M4A1_Black");
player.GetInventory().CreateInInventory("ACOGOptic");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("M4_CQBBttstck");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("M4_PlasticHndgrd");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("Mag_STANAGCoupled_30Rnd");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("Mag_STANAGCoupled_30Rnd");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("TTSKOPants");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("TShirt_Green");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("CombatBoots_Black");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("CombatKnife");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("HighCapacityVest_Black");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("SodaCan_Cola");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("BakedBeansCan_Opened");itemBs = ItemBase.Cast(itemEnt);
break;
case 1:
// Paramedic
itemEnt = player.GetHumanInventory().CreateInHands("AK74");
player.GetInventory().CreateInInventory("PSO1Optic");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("AK74_Hndgrd");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("AK74_WoodBttstck");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("Mag_AK74_30Rnd");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("Mag_AK74_30Rnd");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("Mag_AK74_30Rnd");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("HighCapacityVest_Black");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("BDUPants");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("ParamedicJacket_Green");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("SalineBagIV");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("BandageDressing");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("BakedBeansCan_Opened");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("SodaCan_Cola");itemBs = ItemBase.Cast(itemEnt);
break;
case 2:
// Office worker
itemEnt = player.GetHumanInventory().CreateInHands("SKS");
player.GetInventory().CreateInInventory("SKS_Bayonet");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("AmmoBox_762x39_20Rnd");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("AmmoBox_762x39_20Rnd");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("AmmoBox_762x39_20Rnd");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("SlacksPants_Black");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("WoolCoat_Black");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("AthleticShoes_Black");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("BakedBeansCan_Opened");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("HighCapacityVest_Olive");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("SodaCan_Cola");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("ThinFramesGlasses");itemBs = ItemBase.Cast(itemEnt);
break;
case 3:
// Biker
itemEnt = player.GetHumanInventory().CreateInHands("AKM");
player.GetInventory().CreateInInventory("Mag_AKM_Drum75Rnd");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("Mag_AKM_Drum75Rnd");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("Mag_AKM_Drum75Rnd");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("Binoculars");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("Jeans_Black");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("RidersJacket_Black");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("MotoHelmet_Red");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("HikingBootsLow_Black");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("ImprovisedBag");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("BakedBeansCan_Opened");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("SodaCan_Cola");itemBs = ItemBase.Cast(itemEnt);
break;
case 4:
// Hiker
itemEnt = player.GetHumanInventory().CreateInHands("Mosin9130");
player.GetInventory().CreateInInventory("PUScopeOptic");
player.GetInventory().CreateInInventory("Mosin_Compensator");
player.GetInventory().CreateInInventory("AmmoBox_762x54_20Rnd");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("AmmoBox_762x54_20Rnd");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("PlateCarrierVest");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("HikingJacket_Red");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("CargoPants_Blue");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("HikingBootsLow_Blue");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("MountainBag_Blue");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("BakedBeansCan_Opened");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("WaterBottle");itemBs = ItemBase.Cast(itemEnt);
break;
case 5:
// Cop
itemEnt = player.GetHumanInventory().CreateInHands("MP5K");
player.GetInventory().CreateInInventory("ReflexOptic");
player.GetInventory().CreateInInventory("Battery9V");
player.GetInventory().CreateInInventory("MP5_PlasticHndgrd");
player.GetInventory().CreateInInventory("MP5k_StockBttstck");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("Mag_MP5_30Rnd");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("Mag_MP5_30Rnd");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("Mag_MP5_30Rnd");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("Mag_MP5_30Rnd");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("SmershBag");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("PoliceJacket");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("PolicePants");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("CombatBoots_Grey");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("Flashlight");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("PoliceVest");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("BakedBeansCan_Opened");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("WaterBottle");itemBs = ItemBase.Cast(itemEnt);
break;
case 6:
// Lumberjack
itemEnt = player.GetHumanInventory().CreateInHands("SVD");
player.GetInventory().CreateInInventory("PSO1Optic");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("Mag_SVD_10Rnd");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("Mag_SVD_10Rnd");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("Mag_SVD_10Rnd");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("BandageDressing");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("WaterBottle");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("Shirt_RedCheck");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("Jeans_Blue");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("BakedBeansCan_Opened");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("WorkingBoots_Brown");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("Ushanka_Green");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("ImprovisedBag");itemBs = ItemBase.Cast(itemEnt);
break;
case 7:
// Hood
itemEnt = player.GetHumanInventory().CreateInHands("AK101");
player.GetInventory().CreateInInventory("Mag_AK101_30Rnd");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("Mag_AK101_30Rnd");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("Mag_AK101_30Rnd");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("KashtanOptic");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("AK74_WoodBttstck");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("SodaCan_Kvass");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("BakedBeansCan_Opened");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("TrackSuitPants_Black");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("TrackSuitJacket_Black");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("AthleticShoes_Black");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("TaloonBag_Green");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("PlateCarrierVest");itemBs = ItemBase.Cast(itemEnt);
break;
case 8:
// Fireman
itemEnt = player.GetHumanInventory().CreateInHands("AKS74U_Black");
player.GetInventory().CreateInInventory("AKS74U_Bttstck");
player.GetInventory().CreateInInventory("AK_PlasticHndgrd");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("AK_Suppressor");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("Mag_AK74_30Rnd");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("Mag_AK74_30Rnd");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("Mag_AK74_30Rnd");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("BakedBeansCan_Opened");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("SodaCan_Cola");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("FirefightersHelmet_White");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("WorkingBoots_Yellow");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("SmershVest");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("USMCPants_Woodland");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("BomberJacket_Blue");itemBs = ItemBase.Cast(itemEnt);
player.GetInventory().CreateInInventory("DesignerGlasses");itemBs = ItemBase.Cast(itemEnt);
break;
}
// Give universal gear
itemEnt = player.GetInventory().CreateInInventory("Rag");
itemBs = ItemBase.Cast(itemEnt);
itemBs.SetQuantity(4);
// SetRandomHealth(itemEnt);
// player.GetInventory().CreateInInventory("HuntingKnife");
}
};
Mission CreateCustomMission(string path)
{
return new CustomMission();
}
Alles anzeigen