Hallo, ich möchte gern, wenn ich sterbe oder das Spiel neu betrete ein paar Sachen haben. Wir sind ganz neu im Spiel und da ist es wirklich schwer zurecht zukommen. Eine Karte habe ich schon aktiviert bekommen. Nun möchten wir das man eine Pistole mit 50 Schuss und Essen ins Inventar bekommt. Das ist für uns für den Anfang nützlich. Später soll der Server dann natürlich komplett auf Vanilla zurückgestellt werden. Könnt ihr mir bei der init.c helfen, da muss man das ja machen, wie ich das gelesen habe.
Hier mal die aktuelle init.c Datei:
Code
void main()
{
//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 )
{
float rndHlt = Math.RandomFloat( 0.45, 0.65 );
itemEnt.SetHealth01( "", "", rndHlt );
}
}
override PlayerBase CreateCharacter(PlayerIdentity identity, vector pos, ParamsReadContext ctx, string characterName)
{
Entity playerEnt;
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)
{
EntityAI itemClothing;
EntityAI itemEnt;
ItemBase itemBs;
float rand;
itemClothing = player.FindAttachmentBySlotName( "Body" );
if ( itemClothing )
{
SetRandomHealth( itemClothing );
itemEnt = itemClothing.GetInventory().CreateInInventory( "BandageDressing" );
player.SetQuickBarEntityShortcut(itemEnt, 2);
string chemlightArray[] = { "Chemlight_White", "Chemlight_Yellow", "Chemlight_Green", "Chemlight_Red" };
int rndIndex = Math.RandomInt( 0, 4 );
itemEnt = itemClothing.GetInventory().CreateInInventory( chemlightArray[rndIndex] );
SetRandomHealth( itemEnt );
player.SetQuickBarEntityShortcut(itemEnt, 1);
rand = Math.RandomFloatInclusive( 0.0, 1.0 );
if ( rand < 0.35 )
itemEnt = player.GetInventory().CreateInInventory( "Apple" );
itemEnt = player.GetInventory().CreateInInventory( "Tomato" );
else if ( rand > 0.65 )
itemEnt = player.GetInventory().CreateInInventory( "Pear" );
itemEnt = player.GetInventory().CreateInInventory( "Tomato" );
else
itemEnt = player.GetInventory().CreateInInventory( "Plum" );
itemEnt = player.GetInventory().CreateInInventory( "Tomato" );
player.SetQuickBarEntityShortcut(itemEnt, 3);
SetRandomHealth( itemEnt );
}
itemClothing = player.FindAttachmentBySlotName( "Legs" );
if ( itemClothing )
SetRandomHealth( itemClothing );
itemClothing = player.FindAttachmentBySlotName( "Feet" );
}
};
Mission CreateCustomMission(string path)
{
return new CustomMission();
}
Alles anzeigen