How can I randomize spawn weapons and suits on a character? Thx!
Beiträge von DarkWater
-
-
Thanks! What value should be set to rain and clouds on the server?
-
//If all is set to null give always sunshine, no fog, and less clouds - Weather weather = g_Game.GetWeather();
- weather.GetOvercast().SetLimits( 0.0 , 0.0 );
- weather.GetRain().SetLimits( 0.0 , 0.0 );
- weather.GetFog().SetLimits( 0.0 , 0.0 );
- weather.GetOvercast().SetForecastChangeLimits( 0.0, 0.0 );
- weather.GetRain().SetForecastChangeLimits( 0.0, 0.0 );
- weather.GetFog().SetForecastChangeLimits( 0.0, 0.0 );
- weather.GetOvercast().Set( 0, 0, 0);
- weather.GetRain().Set( 0, 0, 0);
- weather.GetFog().Set( 0, 0, 0);
- weather.SetWindMaximumSpeed(0);
- weather.SetWindFunctionParams(0.0, 0.0, 0);
-
-
Hey, nice script, my problem is init.c , I want to make, so that to spawn a certain loot on player, but default loot spawns inside . Will help me? I will be grateful!
Code
Alles anzeigenvoid main() { //INIT WEATHER BEFORE ECONOMY INIT------------------------ //If all is set to null give always sunshine, no fog, and less clouds Weather weather = g_Game.GetWeather(); weather.GetOvercast().SetLimits( 0.0 , 0.0 ); weather.GetRain().SetLimits( 0.0 , 0.0 ); weather.GetFog().SetLimits( 0.0 , 0.0 ); weather.GetOvercast().SetForecastChangeLimits( 0.0, 0.0 ); weather.GetRain().SetForecastChangeLimits( 0.0, 0.0 ); weather.GetFog().SetForecastChangeLimits( 0.0, 0.0 ); weather.GetOvercast().Set( 0, 0, 0); weather.GetRain().Set( 0, 0, 0); weather.GetFog().Set( 0, 0, 0); weather.SetWindMaximumSpeed(0); weather.SetWindFunctionParams(0.0, 0.0, 0); //INIT ECONOMY-------------------------------------- Hive ce = CreateHive(); if ( ce ) ce.InitOffline(); GetGame().GetWorld().SetDate(2018, 8, 10, 13, 00); //Set the ingame date and time } class CustomMission: MissionServer { void SetRandomHealth(EntityAI itemEnt) { if ( itemEnt ) { int rndHlt = Math.RandomInt(55,100); itemEnt.SetHealth("","",rndHlt); } } //This func can be used or not, it is your choice void addMags(PlayerBase player, string mag_type, int count) { EntityAI mag; if (count < 1) return; for (int i = 0; i < count; i++) { mag = player.GetInventory().CreateInInventory(mag_type); } } 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 itemEnt; ItemBase itemBs; //Get & Save Admin UIDs const string uid = "76561198225509732"; const string uid2 = "76561198010859062"; const string uid3 = "76561198070175567"; string player_uid = player.GetIdentity().GetPlainId(); //RemoveAllItems player.RemoveAllItems(); //Check if admin or not and choose spawn type if(player_uid == uid) { ItemBase.Cast(player.GetInventory().CreateInInventory("MSFCBeretJACK")); ItemBase.Cast(player.GetInventory().CreateInInventory("MSFCBandanaATACSFGMask")); ItemBase.Cast(player.GetInventory().CreateInInventory("MSFCPCU5ATACSFGComander")); ItemBase.Cast(player.GetInventory().CreateInInventory("MSFCPantsATACSFG")); ItemBase.Cast(player.GetInventory().CreateInInventory("MSFCGlovesATACSFG")); ItemBase.Cast(player.GetInventory().CreateInInventory("MSFCBootsATACSFG")); cloth_militaryBoots.GetInventory().CreateAttachment("CombatKnife"); //attach the knife to the boots ItemBase.Cast(player.GetInventory().CreateInInventory("MSFCTacVestATACSFGLogo")); ItemBase.Cast(player.GetInventory().CreateInInventory("MSFCAliceBagATACSFG")); ItemBase.Cast(player.GetInventory().CreateInInventory("TacticalBaconCan")); ItemBase.Cast(player.GetInventory().CreateInInventory("MSFCBankaBaikal")); ItemBase.Cast(player.GetInventory().CreateInInventory("MSFCBankaJackSmithWhiskey")); ItemBase.Cast(player.GetInventory().CreateInInventory("FNX45")); ItemBase.Cast(player.GetInventory().CreateInInventory("Mag_FNX45_15Rnd")); ItemBase.Cast(player.GetInventory().CreateInInventory("Rag")).SetQuantity(6); //.SetQuantity(x) set the amount of rags } if(player_uid == uid2) { ItemBase.Cast(player.GetInventory().CreateInInventory("MSFCBeretHarry")); ItemBase.Cast(player.GetInventory().CreateInInventory("MSFCBandanaATACSFGMask")); ItemBase.Cast(player.GetInventory().CreateInInventory("MSFCPCU5ATACSFGComander")); ItemBase.Cast(player.GetInventory().CreateInInventory("MSFCPantsATACSFG")); ItemBase.Cast(player.GetInventory().CreateInInventory("MSFCGlovesATACSFG")); ItemBase.Cast(player.GetInventory().CreateInInventory("MSFCBootsATACSFG")); cloth_militaryBoots.GetInventory().CreateAttachment("CombatKnife"); //attach the knife to the boots ItemBase.Cast(player.GetInventory().CreateInInventory("MSFCTacVestATACSFGLogo")); ItemBase.Cast(player.GetInventory().CreateInInventory("MSFCAliceBagATACSFG")); ItemBase.Cast(player.GetInventory().CreateInInventory("TacticalBaconCan")); ItemBase.Cast(player.GetInventory().CreateInInventory("MSFCBankaBaikal")); ItemBase.Cast(player.GetInventory().CreateInInventory("MSFCBankaJackSmithWhiskey")); ItemBase.Cast(player.GetInventory().CreateInInventory("FNX45")); ItemBase.Cast(player.GetInventory().CreateInInventory("Mag_FNX45_15Rnd")); ItemBase.Cast(player.GetInventory().CreateInInventory("Rag")).SetQuantity(6); //.SetQuantity(x) set the amount of rags } if(player_uid == uid3) { ItemBase.Cast(player.GetInventory().CreateInInventory("MSFCBeretPRAPOR")); ItemBase.Cast(player.GetInventory().CreateInInventory("MSFCBandanaATACSFGMask")); ItemBase.Cast(player.GetInventory().CreateInInventory("MSFCPCU5ATACSFGComander")); ItemBase.Cast(player.GetInventory().CreateInInventory("MSFCPantsATACSFG")); ItemBase.Cast(player.GetInventory().CreateInInventory("MSFCGlovesATACSFG")); ItemBase.Cast(player.GetInventory().CreateInInventory("MSFCBootsATACSFG")); cloth_militaryBoots.GetInventory().CreateAttachment("CombatKnife"); //attach the knife to the boots ItemBase.Cast(player.GetInventory().CreateInInventory("MSFCTacVestATACSFGLogo")); ItemBase.Cast(player.GetInventory().CreateInInventory("MSFCAliceBagATACSFG")); ItemBase.Cast(player.GetInventory().CreateInInventory("TacticalBaconCan")); ItemBase.Cast(player.GetInventory().CreateInInventory("MSFCBankaBaikal")); ItemBase.Cast(player.GetInventory().CreateInInventory("MSFCBankaJackSmithWhiskey")); ItemBase.Cast(player.GetInventory().CreateInInventory("FNX45")); ItemBase.Cast(player.GetInventory().CreateInInventory("Mag_FNX45_15Rnd")); ItemBase.Cast(player.GetInventory().CreateInInventory("Rag")).SetQuantity(6); //.SetQuantity(x) set the amount of rags } else { //DEFAULT LOOT ItemBase.Cast(player.GetInventory().CreateInInventory("MSFCSTALKERHood")); ItemBase.Cast(player.GetInventory().CreateInInventory("MSFCGasMaskGP5Tan")); ItemBase.Cast(player.GetInventory().CreateInInventory("MSFCSTALKERJacket")); ItemBase.Cast(player.GetInventory().CreateInInventory("MSFCSTALKERPants")); ItemBase.Cast(player.GetInventory().CreateInInventory("OMNOGloves_Brown")); ItemBase.Cast(player.GetInventory().CreateInInventory("MilitaryBoots_Brown")); cloth_militaryBoots.GetInventory().CreateAttachment("HuntingKnife"); //attach the knife to the boots ItemBase.Cast(player.GetInventory().CreateInInventory("TacticalBaconCan")); ItemBase.Cast(player.GetInventory().CreateInInventory("MSFCBankaBaikal")); ItemBase.Cast(player.GetInventory().CreateInInventory("MSFCBankaBaikal")); ItemBase.Cast(player.GetInventory().CreateInInventory("MakarovIJ70")); ItemBase.Cast(player.GetInventory().CreateInInventory("Mag_IJ70_8Rnd")); ItemBase.Cast(player.GetInventory().CreateInInventory("Rag")).SetQuantity(6); //.SetQuantity(x) set the amount of rags } } };