Ejemplo n.º 1
0
    public void StopEngine(BaseEntity.RPCMessage msg)
    {
        MiningQuarry parentEntity = base.GetParentEntity() as MiningQuarry;

        if (parentEntity)
        {
            parentEntity.EngineSwitch(false);
        }
    }
Ejemplo n.º 2
0
    public void StopEngine(RPCMessage msg)
    {
        MiningQuarry miningQuarry = GetParentEntity() as MiningQuarry;

        if ((bool)miningQuarry)
        {
            miningQuarry.EngineSwitch(false);
            Interface.CallHook("OnQuarryToggled", miningQuarry, msg.player);
        }
    }
Ejemplo n.º 3
0
    public void StopEngine(BaseEntity.RPCMessage msg)
    {
        MiningQuarry parentEntity = this.GetParentEntity() as MiningQuarry;

        if (!Object.op_Implicit((Object)parentEntity))
        {
            return;
        }
        parentEntity.EngineSwitch(false);
    }
Ejemplo n.º 4
0
        void OnQuarryToggled(MiningQuarry aExtractor, BasePlayer aPlayer)
        {
            /* This check takes care of 2 simple cases:
             *   1> The player is whitelisted, just remove
             *   2> Extractor was turned off, don't care about player ID, just remove
             */
            if (permission.UserHasPermission(aPlayer.UserIDString, CPermWhitelist) || !aExtractor.IsEngineOn())
            {
                FPlayerExtractorList.RemoveAll(x => aExtractor.net.ID == x.ExtractorId);
                return;
            }

            ExtractorType type;

            if (CPumpJackPrefabs.Contains(aExtractor.ShortPrefabName))
            {
                type = ExtractorType.PumpJack;
            }
            else if (CQuarryPrefabs.Contains(aExtractor.ShortPrefabName))
            {
                type = ExtractorType.Quarry;
            }
            else
            {
                // Skip anything we don't care about
                return;
            }

            if (FPlayerExtractorList.Count(x => aPlayer.userID == x.PlayerId && (FConfigData.IgnoreExtractorType || type == x.Type)) > 0)
            {
                // Turn engine OFF
                aExtractor.EngineSwitch(false);
                // Warn the player
                aPlayer.ChatMessage(lang.GetMessage("Warning Message Text", this, aPlayer.UserIDString));
                return;
            }

            FPlayerExtractorList.Add(new QuarryState {
                PlayerId = aPlayer.userID, ExtractorId = aExtractor.net.ID, Type = type
            });
        }