1. Hi, I am extremely new to the whole plugin development thing, nevertheless i am trying to develop a plugin that allows building in rad-towns simply because it seems like no one has gotten around to doing it yet. please help me, i am suck on the CanBuild part of the script but im sure my script doesn't make sense anyway.

    Here is my script so far:
    Code:
    using Oxide.Core.Plugins;
    using System.Collections.Generic;
    using System;
    using UnityEngine;namespace Oxide.Plugins
    {
        [Info("BuildInRadTowns", "Frenchiest_Fry", "1.0.0", ResourceId = xxx)]
        public class Template : BuildInRadTowns
        {
            void OnEntityEnter(TriggerBase radiation zone, BaseEntity assets/prefabs/building core/foundation.steps/foundation.steps.twig.prefab)
            {
                void CanBuild(Planner plan, assets/prefabs/building core/foundation.steps/foundation.steps.twig.prefab)
                {
                    //if CanBuild = true
                    //if CanBuilf = false
                }
            }
            void OnEntityEnter(TriggerBase radiation zone, assets/prefabs/building core/floor/floor.twig.prefab)
            {
                void CanBuild(Planner plan, assets/prefabs/building core/floor/floor.twig.prefab)
                {
                    Puts("CanBuild works!");
                }
            }
            void OnEntityEnter(TriggerBase radiation zone, assets/prefabs/building core/floor.triangle/floor.triangle.twig.prefab)
            {
                void CanBuild(Planner plan, assets/prefabs/building core/floor.triangle/floor.triangle.twig.prefab)
                {
                    Puts("CanBuild works!");
                }
            }
            void OnEntityEnter(TriggerBase radiation zone, assets/prefabs/building core/foundation.triangle/foundation.triangle.twig.prefab)
            {
                void CanBuild(Planner plan, assets/prefabs/building core/foundation.triangle/foundation.triangle.twig.prefab)
                {
                    Puts("CanBuild works!");
                }
            }
            void OnEntityEnter(TriggerBase radiation zone, assets/prefabs/building core/foundation/foundation.twig.prefab)
            {
                void CanBuild(Planner plan, assets/prefabs/building core/foundation/foundation.twig.prefab)
                {
                    Puts("CanBuild works!");
                }
            }
            void OnEntityEnter(TriggerBase radiation zone, assets/prefabs/building core/pillar/pillar.twig.prefab)
            {
                void CanBuild(Planner plan, assets/prefabs/building core/pillar/pillar.twig.prefab)
                {
                    Puts("CanBuild works!");
                }
            }
            void OnEntityEnter(TriggerBase radiation zone, assets/prefabs/building core/roof/roof.twig.prefab)
            {
                void CanBuild(Planner plan, assets/prefabs/building core/roof/roof.twig.prefab)
                {
                    Puts("CanBuild works!");
                }
            }
            void OnEntityEnter(TriggerBase radiation zone, assets/prefabs/building core/stairs.l/block.stair.lshape.twig.prefab)
            {
                void CanBuild(Planner plan, assets/prefabs/building core/stairs.l/block.stair.lshape.twig.prefab)
                {
                    Puts("CanBuild works!");
                }
            }
            void OnEntityEnter(TriggerBase radiation zone, assets/prefabs/building core/stairs.u/block.stair.ushape.twig.prefab)
            {
                void CanBuild(Planner plan, assets/prefabs/building core/stairs.u/block.stair.ushape.twig.prefab)
                {
                    Puts("CanBuild works!");
                }
            }
            void OnEntityEnter(TriggerBase radiation zone, assets/prefabs/building core/wall.doorway/wall.doorway.twig.prefab)
            {
                void CanBuild(Planner plan, assets/prefabs/building core/wall.doorway/wall.doorway.twig.prefab)
                {
                    Puts("CanBuild works!");
                }
            }
            void OnEntityEnter(TriggerBase radiation zone, assets/prefabs/building core/wall.low/wall.low.twig.prefab)
            {
                void CanBuild(Planner plan, assets/prefabs/building core/wall.low/wall.low.twig.prefab)
                {
                    Puts("CanBuild works!");
                }
            }
            void OnEntityEnter(TriggerBase radiation zone, assets/prefabs/building core/wall.window/wall.window.twig.prefab)
            {
                void CanBuild(Planner plan, assets/prefabs/building core/wall.window/wall.window.twig.prefab)
                {
                    Puts("CanBuild works!");
                }
            }
            void OnEntityEnter(TriggerBase radiation zone, assets/prefabs/building core/wall/wall.twig.prefab)
            {
                void CanBuild(Planner plan, assets/prefabs/building core/wall/wall.twig.prefab)
                {
                    Puts("CanBuild works!");
                }
            }
          
        }
    }
     
    Last edited by a moderator: Jun 26, 2017
  2. Hello, you can't build near radtown, it's client sided, the only way is to use copy-paste
     
  3. ok thank you for the feedback, also my code now is updated although i now know it will not work, is this code feasible for something else?
    code:
    Code:
    using Oxide.Core.Plugins;
    using System.Collections.Generic;namespace Oxide.Plugins
    {
        [Info("BuildInRadTowns", "Frenchiest_Fry", "1.0.0", ResourceId = xxx)]
        public class Template : BuildInRadTowns
        {
            void OnEntityEnter(TriggerBase trigger, BaseEntity entity)
            {
                void CanBuild(Planner plan, Construction prefab);
                {
                    if (CanBuild = true)
                    {
                        then CanBuild = true;
                    }
                    else (CanBuild = false);
                    {
                        then(CanBuild = true);
                    }
                }
            }
        }
    }
    [DOUBLEPOST=1498490070][/DOUBLEPOST]i got this error message

    Error while compiling: BuildInRadTowns.cs(16,26): error CS0136: A local variable named `CanBuild' cannot be declared in this scope because it would give a different meaning to `CanBuild', which is already used in a `parent or current' scope to denote something else
     
  4. You are declaring CanBuild in the if statement, if you want to check if a variable is a value you need to use two equals. For example "CanBuild == true", but for bool variables you can just do the following. "if(CanBuild)" <- true and "if(!CanBuild)" <- false. However, CanBuild isn't even an assigned variable in your code so you would get errors regardless.
     
  5. yeah, thanks for the feed back, again i am very new to this kind of thing