1. Sign up for news, events and more!

    You're currently visiting the official DarkRP Forums as a guest. Sign up now to participate in our community and we'll let you know when we have news.

[HELP] SERVER ISN"T RUNNING ENTITIES.LUA

Discussion in 'DarkRP Modding Questions & Help' started by Ganged, Sep 2, 2017.

  1. Ganged

    Ganged New Member

    Hi, I was working on the entities file that is placed in darkrp_customthings and then after I was done and it was saved, I restarted my server now for some odd reason, if I type a long text it will display in all blue not even my name will show up.

    I checked on the server console and it seems to display the error

    Code (Text):
    [AddCSLuaFile] Couldn't find 'darkrp_customthings/entities.lua' (@gamemodes/darkrp/gamemode/libraries/modificationloader.lua (line 136))
    Not running script darkrp_customthings/entities.lua - it's too short.
    Although my entities.lua file is CLEARLY there, with the size of 7,255 kbs.

    The entities file wasn't the only thing I worked on.

    Btw, I also have the name of the darkrp-modification file to "addon-darkrpmodification".

    Symptoms:-
    1. If the player changed his job, his playermodel will not change.
    2. If teleporting to spawn after job change is set to true the player won't be affected by it.
    3. Long messages will display in blue and the sender's name will not appear.

    Things I tried to do:-
    1. I used the glua init thing to test my code. it said it's all fine.

    The whole entities file content:-
    Code (Text):

    --[[---------------------------------------------------------------------------
    DarkRP custom entities
    ---------------------------------------------------------------------------

    This file contains your custom entities.
    This file should also contain entities from DarkRP that you edited.

    Note: If you want to edit a default DarkRP entity, first disable it in darkrp_config/disabled_defaults.lua
       Once you've done that, copy and paste the entity to this file and edit it.

    The default entities can be found here:
    https://github.com/FPtje/DarkRP/blob/master/gamemode/config/addentities.lua#L111

    For examples and explanation please visit this wiki page:
    http://wiki.darkrp.com/index.php/DarkRP:CustomEntityFields

    Add entities under the following line:
    ---------------------------------------------------------------------------]]
    DarkRP.createEntity("Spike Strip", {
        ent = "nova_spikestrip_ammo",
        model = "models/weapons/w_suitcase_passenger.mdl",
        price = 5000,
        max = 1,
        cmd = "buyspikestrip",
        customCheck = function(ply) return
            table.HasValue({TEAM_OPERATIVE, TEAM_SNIPER, TEAM_BREACHER, TEAM_COMMANDER, TEAM_SWATCORPORAL, TEAM_SWATSERGEANT, TEAM_SWATPRIVATE, TEAM_SWATCOMMANDER, TEAM_POLICE, TEAM_POLICECHIEF}, ply:Team())
        end,
        CustomCheckFailMsg = "This entity is for police only!",
    })
    --[[
        Generated using: DarkRP | Entity Generator
        https://csite.io/tools/gmod-darkrp-entity
    --]]
    DarkRP.createEntity("Aspirin", {
        ent = "durgz_aspirin",
        model = "models/jaanus/aspbtl.mdl",
        price = 5000,
        max = 1,
        cmd = "buyaspirin",
        customCheck = function(ply) return
            table.HasValue({TEAM_DRUGDEALER}, ply:Team())
        end,
        CustomCheckFailMsg = "This entity is for the drug dealer only!",
    })

    --[[
        Generated using: DarkRP | Entity Generator
        https://csite.io/tools/gmod-darkrp-entity
    --]]
    DarkRP.createEntity("Cocaine", {
        ent = "durgz_cocaine",
        model = "models/gdrugs/cocaine/cocaine.mdl",
        price = 20000,
        max = 1,
        cmd = "buycocaine",
        customCheck = function(ply) return
            table.HasValue({TEAM_DRUGDEALER}, ply:Team())
        end,
        CustomCheckFailMsg = "This entity is for the drug dealer only!",
    })

    --[[
        Generated using: DarkRP | Entity Generator
        https://csite.io/tools/gmod-darkrp-entity
    --]]
    DarkRP.createEntity("Heroin", {
        ent = "durgz_heroine",
        model = "models/katharsmodels/syringe_out/syringe_out.mdl",
        price = 2000,
        max = 1,
        cmd = "buyheroin",
        customCheck = function(ply) return
            table.HasValue({TEAM_DRUGDEALER}, ply:Team())
        end,
        CustomCheckFailMsg = "This entity is for the drug dealer only!",
    })

    --[[
        Generated using: DarkRP | Entity Generator
        https://csite.io/tools/gmod-darkrp-entity
    --]]
    DarkRP.createEntity("LSD", {
        ent = "durgz_lsd",
        model = "models/smile/smile.mdl",
        price = 2000,
        max = 1,
        cmd = "buylsd",
        customCheck = function(ply) return
            table.HasValue({TEAM_DRUGDEALER}, ply:Team())
        end,
        CustomCheckFailMsg = "This entity is for the drug dealer only!",
    })

    --[[
        Generated using: DarkRP | Entity Generator
        https://csite.io/tools/gmod-darkrp-entity
    --]]
    DarkRP.createEntity("Marijuana", {
        ent = "durgz_weed",
        model = "models/gdrugs/weed/weed.mdl",
        price = 2000,
        max = 1,
        cmd = "buyweed",
        customCheck = function(ply) return
            table.HasValue({TEAM_DRUGDEALER}, ply:Team())
        end,
        CustomCheckFailMsg = "This entity is for the drug dealer only!",
    })

    --[[
        Generated using: DarkRP | Entity Generator
        https://csite.io/tools/gmod-darkrp-entity
    --]]
    DarkRP.createEntity("Mushroom", {
        ent = "durgz_mushroom",
        model = "models/ipha/mushroom_small.mdl",
        price = 2000,
        max = 1,
        cmd = "buyshroom",
        customCheck = function(ply) return
            table.HasValue({TEAM_DRUGDEALER}, ply:Team())
        end,
        CustomCheckFailMsg = "This entity is for the drug dealer only!",
    })

    --[[
        Generated using: DarkRP | Entity Generator
        https://csite.io/tools/gmod-darkrp-entity
    --]]
    DarkRP.createEntity("PCP", {
        ent = "durgz_pcp",
        model = "models/marioragdoll/super mario galaxy/star/star.mdl",
        price = 2000,
        max = 1,
        cmd = "buypcp",
        customCheck = function(ply) return
            table.HasValue({TEAM_DRUGDEALER}, ply:Team())
        end,
        CustomCheckFailMsg = "This entity is for the drug dealer only!",
    })

    if (ECL.CustomModels.Stove) then  
       DarkRP.createEntity("Portable Stove", {
           ent = "ecl_stove",
           model = "models/srcocainelab/portablestove.mdl",
           price = 1000,
           max = 4,
           cmd = "eclbuyst",
           category = "Cocaine Supplies",
    else
       DarkRP.createEntity("Stove", {
           ent = "ecl_stove",
           model = "models/props_c17/furnitureStove001a.mdl",
           price = 5000,
           max = 1,
           cmd = "eclbuyst",
           category = "Cocaine Supplies",
       })
    end
    end

    DarkRP.createEntity("Pot for cooking Cocaine", {
       ent = "ecl_pot",
       model = "models/props_c17/metalPot001a.mdl",
       price = 500,
       max = 4,
       cmd = "eclbuyp",
       category = "Cocaine Supplies",
    })

    DarkRP.createEntity("Box for collecting leaves", {
       ent = "ecl_leafbox",
       model = "models/props_junk/cardboard_box004a.mdl",
       price = 150,
       max = 5,
       cmd = "eclbuycl",
       category = "Cocaine Supplies",
    })

    DarkRP.createEntity("Kerosin", {
       ent = "ecl_kerosin",
       model = "models/props_junk/metal_paintcan001a.mdl",
       price = 750,
       max = 8,
       cmd = "eclbuyks",
       category = "Cocaine Supplies",
    })

    if (ECL.CustomModels.Gascan) then
       DarkRP.createEntity("Gascan", {
           ent = "ecl_gas",
           model = "models/srcocainelab/gascan.mdl",
           price = 500,
           max = 5,
           cmd = "eclbuygs",
           category = "Cocaine Supplies",
       })
    else  
       DarkRP.createEntity("Gas for Stove", {
           ent = "ecl_gas",
           model = "models/props_junk/propane_tank001a.mdl",
           price = 500,
           max = 5,
           cmd = "eclbuygs",
           category = "Cocaine Supplies",
       })
    end;

    DarkRP.createEntity("Gasoline", {
       ent = "ecl_gasoline",
       model = "models/props_junk/metalgascan.mdl",
       price = 1000,
       max = 2,
       cmd = "eclbuygl",
       category = "Cocaine Supplies",
    })

    DarkRP.createEntity("Water for Drufing Leaves", {
       ent = "ecl_drafted",
       model = "models/props_junk/plasticbucket001a.mdl",
       price = 500,
       max = 4,
       cmd = "eclbuydl",
       category = "Cocaine Supplies",
    })

    DarkRP.createEntity("Sulfuric Acid", {
       ent = "ecl_sulfuric_acid",
       model = "models/props_junk/garbage_milkcarton001a.mdl",
       price = 1000,
       max = 2,
       cmd = "eclbuysa",
       category = "Cocaine Supplies",
    })

    DarkRP.createEntity("Pot for growing Coca Plant", {
       ent = "ecl_plant_pot",
       model = "models/props_junk/terracotta01.mdl",
       price = 150,
       max = 5,
       cmd = "eclbuypp",
       category = "Cocaine Supplies",
    })

    DarkRP.createEntity("Seed for pot", {
       ent = "ecl_seed",
       model = "models/props/cs_office/plant01_gib1.mdl",
       price = 150,
       max = 5,
       cmd = "eclbuyseed",
       category = "Cocaine Supplies",
    })

    DarkRP.createEntity("CCTV System", {
        ent = "tbfy_cctv_camera",
        model = "models/tobadforyou/cctv_camera.mdl",
        price = 300,
        max = 5,
        cmd = "buycctvsystem",
       category = "Other"
    })

    AddCustomShipment("Piano", {
        model = "models/fishy/furniture/piano.mdl",
        entity = "gmt_instrument_piano",
        price = 2500,
        amount = 10,
        seperate = true,
        pricesep = 250,
        noship = false,
        allowed = {TEAM_PIANIST}
    })
     
    --- Double Post Merged, Sep 3, 2017 ---
    Please help.
     
    Last edited: Sep 3, 2017
    Sir Klutch likes this.
  2. System

    System Active Member

    You have a Shipment within your entities.lua

    Code (Text):
    AddCustomShipment("Piano", {
        model = "models/fishy/furniture/piano.mdl",
        entity = "gmt_instrument_piano",
        price = 2500,
        amount = 10,
        seperate = true,
        pricesep = 250,
        noship = false,
        allowed = {TEAM_PIANIST}
    })
    Also fixed your cssite.io spam
    UNTESTED
    Code (Text):
    --[[---------------------------------------------------------------------------
    DarkRP custom entities
    ---------------------------------------------------------------------------

    This file contains your custom entities.
    This file should also contain entities from DarkRP that you edited.

    Note: If you want to edit a default DarkRP entity, first disable it in darkrp_config/disabled_defaults.lua
       Once you've done that, copy and paste the entity to this file and edit it.

    The default entities can be found here:
    https://github.com/FPtje/DarkRP/blob/master/gamemode/config/addentities.lua#L111

    For examples and explanation please visit this wiki page:
    http://wiki.darkrp.com/index.php/DarkRP:CustomEntityFields

    Add entities under the following line:
    ---------------------------------------------------------------------------]]
    DarkRP.createEntity("Spike Strip", {
        ent = "nova_spikestrip_ammo",
        model = "models/weapons/w_suitcase_passenger.mdl",
        price = 5000,
        max = 1,
        cmd = "buyspikestrip",
        customCheck = function(ply) return
            table.HasValue({TEAM_OPERATIVE, TEAM_SNIPER, TEAM_BREACHER, TEAM_COMMANDER, TEAM_SWATCORPORAL, TEAM_SWATSERGEANT, TEAM_SWATPRIVATE, TEAM_SWATCOMMANDER, TEAM_POLICE, TEAM_POLICECHIEF}, ply:Team())
        end,
        CustomCheckFailMsg = "This entity is for police only!",
    })

    DarkRP.createEntity("Aspirin", {
        ent = "durgz_aspirin",
        model = "models/jaanus/aspbtl.mdl",
        price = 5000,
        max = 1,
        cmd = "buyaspirin",
        customCheck = function(ply) return
            table.HasValue({TEAM_DRUGDEALER}, ply:Team())
        end,
        CustomCheckFailMsg = "This entity is for the drug dealer only!",
    })


    DarkRP.createEntity("Cocaine", {
        ent = "durgz_cocaine",
        model = "models/gdrugs/cocaine/cocaine.mdl",
        price = 20000,
        max = 1,
        cmd = "buycocaine",
        customCheck = function(ply) return
            table.HasValue({TEAM_DRUGDEALER}, ply:Team())
        end,
        CustomCheckFailMsg = "This entity is for the drug dealer only!",
    })


    DarkRP.createEntity("Heroin", {
        ent = "durgz_heroine",
        model = "models/katharsmodels/syringe_out/syringe_out.mdl",
        price = 2000,
        max = 1,
        cmd = "buyheroin",
        customCheck = function(ply) return
            table.HasValue({TEAM_DRUGDEALER}, ply:Team())
        end,
        CustomCheckFailMsg = "This entity is for the drug dealer only!",
    })


    DarkRP.createEntity("LSD", {
        ent = "durgz_lsd",
        model = "models/smile/smile.mdl",
        price = 2000,
        max = 1,
        cmd = "buylsd",
        customCheck = function(ply) return
            table.HasValue({TEAM_DRUGDEALER}, ply:Team())
        end,
        CustomCheckFailMsg = "This entity is for the drug dealer only!",
    })


    DarkRP.createEntity("Marijuana", {
        ent = "durgz_weed",
        model = "models/gdrugs/weed/weed.mdl",
        price = 2000,
        max = 1,
        cmd = "buyweed",
        customCheck = function(ply) return
            table.HasValue({TEAM_DRUGDEALER}, ply:Team())
        end,
        CustomCheckFailMsg = "This entity is for the drug dealer only!",
    })


    DarkRP.createEntity("Mushroom", {
        ent = "durgz_mushroom",
        model = "models/ipha/mushroom_small.mdl",
        price = 2000,
        max = 1,
        cmd = "buyshroom",
        customCheck = function(ply) return
            table.HasValue({TEAM_DRUGDEALER}, ply:Team())
        end,
        CustomCheckFailMsg = "This entity is for the drug dealer only!",
    })


    DarkRP.createEntity("PCP", {
        ent = "durgz_pcp",
        model = "models/marioragdoll/super mario galaxy/star/star.mdl",
        price = 2000,
        max = 1,
        cmd = "buypcp",
        customCheck = function(ply) return
            table.HasValue({TEAM_DRUGDEALER}, ply:Team())
        end,
        CustomCheckFailMsg = "This entity is for the drug dealer only!",
    })

    if (ECL.CustomModels.Stove) then
       DarkRP.createEntity("Portable Stove", {
           ent = "ecl_stove",
           model = "models/srcocainelab/portablestove.mdl",
           price = 1000,
           max = 4,
           cmd = "eclbuyst",
           category = "Cocaine Supplies",
    else
       DarkRP.createEntity("Stove", {
           ent = "ecl_stove",
           model = "models/props_c17/furnitureStove001a.mdl",
           price = 5000,
           max = 1,
           cmd = "eclbuyst",
           category = "Cocaine Supplies",
       })
    end
    end

    DarkRP.createEntity("Pot for cooking Cocaine", {
       ent = "ecl_pot",
       model = "models/props_c17/metalPot001a.mdl",
       price = 500,
       max = 4,
       cmd = "eclbuyp",
       category = "Cocaine Supplies",
    })

    DarkRP.createEntity("Box for collecting leaves", {
       ent = "ecl_leafbox",
       model = "models/props_junk/cardboard_box004a.mdl",
       price = 150,
       max = 5,
       cmd = "eclbuycl",
       category = "Cocaine Supplies",
    })

    DarkRP.createEntity("Kerosin", {
       ent = "ecl_kerosin",
       model = "models/props_junk/metal_paintcan001a.mdl",
       price = 750,
       max = 8,
       cmd = "eclbuyks",
       category = "Cocaine Supplies",
    })

    if (ECL.CustomModels.Gascan) then
       DarkRP.createEntity("Gascan", {
           ent = "ecl_gas",
           model = "models/srcocainelab/gascan.mdl",
           price = 500,
           max = 5,
           cmd = "eclbuygs",
           category = "Cocaine Supplies",
       })
    else
       DarkRP.createEntity("Gas for Stove", {
           ent = "ecl_gas",
           model = "models/props_junk/propane_tank001a.mdl",
           price = 500,
           max = 5,
           cmd = "eclbuygs",
           category = "Cocaine Supplies",
       })
    end;

    DarkRP.createEntity("Gasoline", {
       ent = "ecl_gasoline",
       model = "models/props_junk/metalgascan.mdl",
       price = 1000,
       max = 2,
       cmd = "eclbuygl",
       category = "Cocaine Supplies",
    })

    DarkRP.createEntity("Water for Drufing Leaves", {
       ent = "ecl_drafted",
       model = "models/props_junk/plasticbucket001a.mdl",
       price = 500,
       max = 4,
       cmd = "eclbuydl",
       category = "Cocaine Supplies",
    })

    DarkRP.createEntity("Sulfuric Acid", {
       ent = "ecl_sulfuric_acid",
       model = "models/props_junk/garbage_milkcarton001a.mdl",
       price = 1000,
       max = 2,
       cmd = "eclbuysa",
       category = "Cocaine Supplies",
    })

    DarkRP.createEntity("Pot for growing Coca Plant", {
       ent = "ecl_plant_pot",
       model = "models/props_junk/terracotta01.mdl",
       price = 150,
       max = 5,
       cmd = "eclbuypp",
       category = "Cocaine Supplies",
    })

    DarkRP.createEntity("Seed for pot", {
       ent = "ecl_seed",
       model = "models/props/cs_office/plant01_gib1.mdl",
       price = 150,
       max = 5,
       cmd = "eclbuyseed",
       category = "Cocaine Supplies",
    })

    DarkRP.createEntity("CCTV System", {
        ent = "tbfy_cctv_camera",
        model = "models/tobadforyou/cctv_camera.mdl",
        price = 300,
        max = 5,
        cmd = "buycctvsystem",
       category = "Other"
    })
     
  3. Sir Klutch

    Sir Klutch Active Member

    You can create a shipment in any shared file. I don't think it would matter if it was in entities.lua.
     
    System likes this.

Share This Page