1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. 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.

FA:S 2 Shipments not working

Discussion in 'DarkRP Modding Questions & Help' started by RalphORama, Apr 21, 2014.

  1. RalphORama

    RalphORama New Member

    I'm trying to create custom shipments for the FA:S 2 weapons with this code:
    Code (Lua):
    AddCustomShipment("AK-47", {
            model = "models/weapons/w_ak47.mdl", -- The model of the item that hovers above the shipment
            entity = "fas2_ak47", -- the entity that comes out of the shipment
            price = 2000, -- the price of one shipment
            amount = 10, -- how many of the item go in one purchased shipment
            separate = true, -- whether the item is sold separately (usually used for guns)
            pricesep = 190, -- the price of a separately sold item
            noship = false, -- whether this item has a shipment
            allowed = {TEAM_GUN}, -- OPTIONAL, which teams are allowed to buy this shipment/separate gun
            shipmodel = "models/items/item_item_crate.mdl", -- OPTIONAL, the model of the shipment (this crate is the default)
            -- customCheck = function(ply) return ply:Frags() < 10 end, -- OPTIONAL, extra conditions before people can purchase the shipment or separate item
            weight = 15, -- OPTIONAL, the weight of the shipment. The default is the weight of the shipment
            -- spareammo = 10, -- OPTIONAL, Add ammo to the default amount of ammo for every weapon
            -- clip1 = 10, -- OPTIONAL, The amount of bullets in the primary clip by default
            -- clip2 = 10, -- OPTIONAL, The amount of bullets in the secondary clip by default
            buttonColor = Color(255, 255, 255, 255), -- Optional: The color of the button in the F4 menu,
            -- label = "Super pistol", -- Optional: the text on the button in the F4 menu

            -- Advanced, optional
            -- shipmentClass = "spawned_shipment", -- The classname of the shipment entity. Use this if you have made a different shipment entity
            -- onBought = function(ply, shipment, ent) end, -- function that is called when the shipment is bought
            -- getPrice = function(ply, price) return ply:GetNWString("usergroup") == "donator" and price * 0.9 or price end, -- function to decide what the price is based on the player
    The shipment shows up in the F4 menu, and one can successfully buy it, but when someone presses E on the shipment to spawn a gun out of it, this happens:

    Every time a gun spawns out of a shipment, it creates a "ghost" gun with "amount: 0" printed on it. How can I fix this?
  2. [DG] Dr. CookieCaster

    [DG] Dr. CookieCaster Member Server Owner

    Either your model is wrong or your entity is wrong

    I think ak47's model was ak472 ? or
  3. RalphORama

    RalphORama New Member

    I don't think the model is wrong, since that's just what hovers over the shipment and that works fine, but I'm not sure what to do about fixing the entity. I found the ak47 under the entities menu and copied its name. I'm not sure how to fix it though.
  4. [DG] Dr. CookieCaster

    [DG] Dr. CookieCaster Member Server Owner

    It wouldn't hurt to try? I read somewhere that FAS world view model is broken and there is a css one in place as a sort of place holder? Try changing it to w_rif_ak47.mdl just for the purpose of testing it, I ran into this problem with m9k

    Sorry in advance if I'm wrong
  5. (FPtje) Atheos

    (FPtje) Atheos Main Developer Staff Member

    is it CSS not being mounted?
  6. RalphORama

    RalphORama New Member

    Nope, you're right! That fixed the issue. Now to just find css models for all the other FAS weapons...

    Nope, CSS mounts fine. I guess that the FAS worldmodels are just buggered.
  7. [DG] Dr. CookieCaster

    [DG] Dr. CookieCaster Member Server Owner

    I found a shipment list from facepunch, just steal the models

    Code (Text):
    AddCustomShipment("M249", "models/weapons/w_mach_m249para.mdl", "weapon_real_cs_m249", 10000, 10, true, 1000, false, {TEAM_GUN})
    AddCustomShipment("Galil", "models/weapons/w_rif_galil.mdl", "weapon_real_cs_galil", 9000, 10, true, 900, false, {TEAM_GUN})
    AddCustomShipment("AK47", "models/weapons/w_rif_ak47.mdl", "weapon_real_cs_ak47", 10000, 10, true, 1000, false, {TEAM_GUN})
    AddCustomShipment("M4A1", "models/weapons/w_rif_m4a1.mdl", "weapon_real_cs_m4a1", 10000, 10, true, 1000, false, {TEAM_GUN})
    AddCustomShipment("Famas", "models/weapons/w_rif_famas.mdl", "weapon_real_cs_famas", 9000, 10, true, 900, false, {TEAM_GUN})
    AddCustomShipment("AWP", "models/weapons/w_snip_awp.mdl", "weapon_real_cs_awp", 15000, 10, true, 1500, false, {TEAM_GUN})
    AddCustomShipment("Scout", "models/weapons/w_snip_scout.mdl", "weapon_real_cs_scout", 12000, 10, true, 1200, false, {TEAM_GUN})
    AddCustomShipment("SteyrAug", "models/weapons/w_rif_aug.mdl", "weapon_real_cs_aug", 9000, 10, true, 900, false, {TEAM_GUN})
    AddCustomShipment("SG552", "models/weapons/w_rif_sg552.mdl", "weapon_real_cs_sg552", 9000, 10, true, 900, false, {TEAM_GUN})
    AddCustomShipment("G3SG1", "models/weapons/w_snip_g3sg1.mdl", "weapon_real_cs_g3sg1", 10000, 10, true, 1000, false, {TEAM_GUN})
    AddCustomShipment("SG550", "models/weapons/w_snip_sg550.mdl", "weapon_real_cs_sg550", 9000, 10, true, 900, false, {TEAM_GUN})
    AddCustomShipment("UMP45", "models/weapons/w_smg_ump45.mdl", "weapon_real_cs_ump_45", 8000, 10, true, 800, false, {TEAM_GUN})
    AddCustomShipment("P90", "models/weapons/w_smg_p90.mdl", "weapon_real_cs_p90", 8000, 10, true, 800, false, {TEAM_GUN})
    AddCustomShipment("TMP", "models/weapons/w_smg_tmp.mdl", "weapon_real_cs_tmp", 7000, 10, true, 700, false, {TEAM_GUN})
    AddCustomShipment("MP5", "models/weapons/w_smg_mp5.mdl", "weapon_real_cs_mp5a5", 8000, 10, true, 800, false, {TEAM_GUN})
    AddCustomShipment("Mac10", "models/weapons/w_smg_mac10.mdl", "weapon_real_cs_mac10", 7500, 10, true, 750, false, {TEAM_GUN})
    AddCustomShipment("AutoShotgun", "models/weapons/w_shot_xm1014.mdl", "weapon_real_cs_xm1014", 11000, 10, true, 1100, false, {TEAM_GUN})
    AddCustomShipment("M3 Shotgun", "models/weapons/w_shot_m3super90.mdl", "weapon_real_cs_pumpshotgun", 9000, 10, true, 900, false, {TEAM_GUN})
    AddCustomShipment("Deagle", "models/weapons/w_pist_deagle.mdl", "weapon_real_cs_desert_eagle", 7500, 10, true, 750, false, {TEAM_GUN})
    AddCustomShipment("USP", "models/weapons/w_pist_usp.mdl", "weapon_real_cs_usp", 6000, 10, true, 600, false, {TEAM_GUN})
    AddCustomShipment("P228", "models/weapons/w_pist_p228.mdl", "weapon_real_cs_p228", 5500, 10, true, 550, false, {TEAM_GUN})
    AddCustomShipment("Glock", "models/weapons/w_pist_glock18.mdl", "weapon_real_cs_glock18", 5000, 10, true, 500, false, {TEAM_GUN})
    AddCustomShipment("FiveSeven", "models/weapons/w_pist_fiveseven.mdl", "weapon_real_cs_five-seven", 4500, 10, true, 450, false, {TEAM_GUN})
    AddCustomShipment("Knife", "models/weapons/w_knife_t.mdl", "weapon_real_cs_knife", 2500, 10, true, 250, false, {TEAM_GUN})
    [GG]Tense! likes this.
  8. RalphORama

    RalphORama New Member

    Thanks for the help!

    Edit: I forgot the comma.
    One other question: I'm trying to make certain printers unavailable for normal users (i.e. only donators, operators, admins, and superadmins). I copied the code I found on the wiki to do this, but it gives me an error when I implement it.
    Code (Lua):
    -- in addons/darkrpmodification/darkrp_customthings/entities.lua
    AddEntity("Emerald Money Printer", {
            ent = "money_emerald_printer",
            model = "models/props_lab/reciever01a.mdl",
            price = 10000,
            max = 2,
            cmd = "/emeraldprinter"
            customCheck = (function(ply) return ply:IsUserGroup("supporter") end)     -- supporter (donator) only
    The error:
    Code (Text):
    [ERROR] addons/darkrpmodification/lua/darkrp_customthings/entities.lua:70: '}' expected (to close '{' at line 64) near 'customCheck'
      1. unknown - addons/darkrpmodification/lua/darkrp_customthings/entities.lua:0
    I have 2 questions about this: 1) What is causing the error? 2) How do I add additional groups to the check?
  9. [DG] Dr. CookieCaster

    [DG] Dr. CookieCaster Member Server Owner

    You randomly put a "(" in front of function and ")" at the end of end

    Try this, to add additional groups add commas so I'll put an example below

    customCheck = function(ply) return ply:IsUserGroup("supporter", "admin", "donator") end -- supporter (donator) only

    edit: fixed
    Last edited: Apr 22, 2014
  10. nzkfc

    nzkfc Member

    I can tell you 100% it's because FAS2 has no world models.

    Therefore shipments will break like this. You have to make the entity spawn as a CSS model rather then FAS2 then when the user picks this up they get the FAS2 weapon on their screen etc. But if you drop a gun it will look like a CSS weapon.

    I raised this with the dev when it came out and he said nothing he can do unless FAS2 actual game creators make some world models.

    (My question at page 45/46)


Share This Page