Beispiel #1
0
        public override void OnPlayerKilled(Entity player, Entity inflictor, Entity attacker, int damage, string mod, string weapon, Vector3 dir, string hitLoc)
        {
            if (player == attacker) //Checking if the player isn't suiciding
            {
                return;
            }


            if (attacker.GetTeam() == Enums.PlayerTeam.ALLIES)
            {
                if (hitLoc == "j_head") //if the human kills with headshots 200$
                {
                    attacker.AddMoney(200);
                    HudHandler.CreateFlyingScore(attacker, 200);
                }
                else //100$ for the human
                {
                    attacker.AddMoney(100);
                    HudHandler.CreateFlyingScore(attacker, 100); //Updating the hud in the CreateFlyingHud to sync it
                }
            }

            if (player.GetTeam() == Enums.PlayerTeam.AXIS) //If a zombie dies give him 50$
            {
                player.AddMoney(50);                       //adding 50$
                HudHandler.UpdateHudMoney(player);         //Updating the hud
            }
        }
Beispiel #2
0
 private void BuyingAlgorithmus(Entity e, Item i)
 {
     if (e.GetMoney() >= i.Price)
     {
         e.RemoveMoney(i.Price);
         e.IPrintLnBold("^2You bought the item:" + i.Name);
         i.Action.Invoke(e);
     }
     else
     {
         e.IPrintLnBold("^1Not enough money to buy the item:" + i.Name);
     }
     HudHandler.UpdateHudMoney(e);
 }