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.

Release Gas Station Remover

Discussion in 'DarkRP Addon & Plugin Releases' started by MaccyD, Feb 11, 2017.

  1. MaccyD

    MaccyD Member

    So in the past few weeks ive had a ton of people come up to me and ask how they remove the gas station props from gas stations in evocity maps or other maps for that matter, so now im just gonna release my code, its real simple and easy to config ;)

    Configs Included:
    rp_evocity_v33x

    I Will Add Other Map Configs Soon For Those Who Are Confused By The Code
    Just make a request either on github or below


    GitHub Download

    Instructions are on GitHub
     
    Last edited: Feb 12, 2017
  2. Pab14567

    Pab14567 Well-Known Member

    Or I can get the vmf and remove it entirely , and just post it here :D It's what I did with rockford
    I removed gas pumps and added williams car dealers gas pumps since they work, and I added some extra detail inside the stores, and I added another theater room,

    I expanded the map opening the skybox some more allowed the use of helicopters.

    I added a helipad Near the south side of the map ( I'm going by when you spawn and look towards the front of the city hall doors )

    I changed spawns from inside to outside.

    I'm going to be updating my profile with all the changes I've made to it, soon.

    Along with my other projects
     
  3. MaccyD

    MaccyD Member

    That is the alternate version but that also means the players have to download YOUR version of the map itself
    --- Double Post Merged, Feb 12, 2017 ---
    because GMod checks if the maps are the same, if they arent, Shiz you cant connect
    --- Double Post Merged, Feb 12, 2017 ---
    All this mini-script is, is something small but useful for the community, for the majority who dont know how to do it
     
  4. Pab14567

    Pab14567 Well-Known Member

    Yes but most of the maps are already available and all you need to do is just ask the OG creator of the map for permission to post the map ( unless he says so where he posted the vmf ) and I could simply just upload it to workshop :)
     
  5. MaccyD

    MaccyD Member

    Yes i understand that, im just saying, my way is more efficient as it doesnt require the users to download a small edit of v33x without gas stations
     
  6. Pab14567

    Pab14567 Well-Known Member

    True, but I could always add some more secret things like more optimization :)
     
  7. MaccyD

    MaccyD Member

    true but itd only do that if i focused my time on that one server with a popular playerbase, ive only ever made a custom map or edited map for my zombies gamemode which has 25 players regularly
     
  8. Sir Klutch

    Sir Klutch Active Member

    Pretty big table...

    Code (Lua):

    local gasprops={
        585,
        584,
        583,
        582,
        581,
        303,
        642,
        645,
        643,
        644,
        648,
        646,
        647,
        649
    }
    hook.Add("InitPostEntity","RemoveShittyGasStations",function()
        local gaspump = gasprops[v:EntIndex()]
            for k, v in pairs(ents.FindByClass("prop_dynamic")) do
                if gaspump then v:Remove() end
            end
    end)
    ^ More optimized version =)
     
    Last edited: Feb 13, 2017
  9. (FPtje) Atheos

    (FPtje) Atheos Main Developer Staff Member

    That's not a big table though.
     
  10. Sir Klutch

    Sir Klutch Active Member

    Explain what would be a 'big table' in your eyes? I personally never use table.HasValue(). I understand using it in InitPostEntity wouldn't be a big issue as it's only ran once ALL the entities have loaded in. For instance, if it was ran in a Think hook or something else that is being called every frame can/will be an issue.
     
  11. MaccyD

    MaccyD Member

    I didnt actually think about optimization when i made this script, however i took into account what you all have said, and the prop_dynamic table is a pretty f***ing big table if you ask me, so, now it is only checking against Entitys in my gasprops table :)


    New Hook:
    Code (Text):

    hook.Add("InitPostEntity","RemoveShittyGasStations",function()
    for k, v in pairs(gasprops) do
    if Entity(k) && IsValid(Entity(k)) then Entity(k):Remove() end
    end
    end)
     
     
    Sir Klutch likes this.
  12. anathemA

    anathemA New Member

    You could use GetModel to make sure it equals the gas pump, in case something messes up the id.

    @Sir Klutch
    local outfits = {
    {"Colorable Hazmat","models/player/Hazmat/colorable_hazmat.mdl"},
    {"EC Female_01","models/player/zelpa/female_01.mdl"},
    {"EC Female_01_b","models/player/zelpa/female_01_b.mdl"},
    {"EC Female_02","models/player/zelpa/female_02.mdl"},
    {"EC Female_02_b","models/player/zelpa/female_02_b.mdl"},
    {"EC Female_03","models/player/zelpa/female_03.mdl"},
    {"EC Female_03_b","models/player/zelpa/female_03_b.mdl"},
    {"EC Female_04","models/player/zelpa/female_04.mdl"},
    {"EC Female_04_b","models/player/zelpa/female_04_b.mdl"},
    {"EC Female_06","models/player/zelpa/female_06.mdl"},
    {"EC Female_06_b","models/player/zelpa/female_06_b.mdl"},
    {"EC Female_07","models/player/zelpa/female_07.mdl"},
    {"EC Female_07_b","models/player/zelpa/female_07_b.mdl"},
    {"EC Male_01","models/player/zelpa/male_01.mdl"},
    {"EC Male_02","models/player/zelpa/male_02.mdl"},
    {"EC Male_03","models/player/zelpa/male_03.mdl"},
    {"EC Male_04","models/player/zelpa/male_04.mdl"},
    {"EC Male_05","models/player/zelpa/male_05.mdl"},
    {"EC Male_06","models/player/zelpa/male_06.mdl"},
    {"EC Male_07","models/player/zelpa/male_07.mdl"},
    {"EC Male_08","models/player/zelpa/male_08.mdl"},
    {"EC Male_09","models/player/zelpa/male_09.mdl"},
    {"EC Male_10","models/player/zelpa/male_10.mdl"},
    {"EC Male_11","models/player/zelpa/male_11.mdl"},
    {"ECX Female_01","models/player/zelpa/female_01_extended.mdl"},
    {"ECX Female_01_b","models/player/zelpa/female_01_b_extended.mdl"},
    {"ECX Female_02","models/player/zelpa/female_02_extended.mdl"},
    {"ECX Female_02_b","models/player/zelpa/female_02_b_extended.mdl"},
    {"ECX Female_03","models/player/zelpa/female_03_extended.mdl"},
    {"ECX Female_03_b","models/player/zelpa/female_03_b_extended.mdl"},
    {"ECX Female_04","models/player/zelpa/female_04_extended.mdl"},
    {"ECX Female_04_b","models/player/zelpa/female_04_b_extended.mdl"},
    {"ECX Female_06","models/player/zelpa/female_06_extended.mdl"},
    {"ECX Female_06_b","models/player/zelpa/female_06_b_extended.mdl"},
    {"ECX Female_07","models/player/zelpa/female_07_extended.mdl"},
    {"ECX Female_07_b","models/player/zelpa/female_07_b_extended.mdl"},
    {"ECX Male_01","models/player/zelpa/male_01_extended.mdl"},
    {"ECX Male_02","models/player/zelpa/male_02_extended.mdl"},
    {"ECX Male_03","models/player/zelpa/male_03_extended.mdl"},
    {"ECX Male_04","models/player/zelpa/male_04_extended.mdl"},
    {"ECX Male_05","models/player/zelpa/male_05_extended.mdl"},
    {"ECX Male_06","models/player/zelpa/male_06_extended.mdl"},
    {"ECX Male_07","models/player/zelpa/male_07_extended.mdl"},
    {"ECX Male_08","models/player/zelpa/male_08_extended.mdl"},
    {"ECX Male_09","models/player/zelpa/male_09_extended.mdl"},
    {"ECX Male_10","models/player/zelpa/male_10_extended.mdl"},
    {"ECX Male_11","models/player/zelpa/male_11_extended.mdl"},
    {"Merriweather1","models/kerry/merriweather1.mdl"},
    {"Merriweather2","models/kerry/merriweather2.mdl"},
    {"Merriweather3","models/kerry/merriweather3.mdl"},
    {"Merriweather4","models/kerry/merriweather4.mdl"},
    {"Merriweather5","models/kerry/merriweather5.mdl"},
    {"Merriweather6","models/kerry/merriweather6.mdl"},
    {"Merriweather7","models/kerry/merriweather7.mdl"},
    {"Merriweather8","models/kerry/merriweather8.mdl"},
    {"PD2_Cloaker_Zeal","models/mark2580/payday2/pd2_cloaker_zeal_player.mdl"},
    {"PD2_HeavySWAT_Zeal","models/mark2580/payday2/pd2_swat_heavy_zeal_player.mdl"},
    {"PD2_bulldozer_Zeal","models/mark2580/payday2/pd2_bulldozer_zeal_player.mdl"},
    {"PD2_heavy_fbi","models/payday2/units/heavy_fbi_player.mdl"},
    {"PD2_swat_fbi","models/payday2/units/swat_fbi_player.mdl"},
    {"Robber_1","models/player/Suits/robber_open.mdl"},
    {"Robber_2","models/player/Suits/robber_shirt.mdl"},
    {"Robber_3","models/player/Suits/robber_shirt_2.mdl"},
    {"Robber_4","models/player/Suits/robber_tie.mdl"},
    {"Robber_5","models/player/Suits/robber_tuckedtie.mdl"},
    {"Suit_1a","models/player/Suits/male_01_closed_coat_tie.mdl"},
    {"Suit_1b","models/player/Suits/male_01_closed_tie.mdl"},
    {"Suit_1c","models/player/Suits/male_01_open.mdl"},
    {"Suit_1d","models/player/Suits/male_01_open_tie.mdl"},
    {"Suit_1e","models/player/Suits/male_01_open_waistcoat.mdl"},
    {"Suit_1f","models/player/Suits/male_01_shirt.mdl"},
    {"Suit_1g","models/player/Suits/male_01_shirt_tie.mdl"},
    {"Suit_2a","models/player/Suits/male_02_closed_coat_tie.mdl"},
    {"Suit_2b","models/player/Suits/male_02_closed_tie.mdl"},
    {"Suit_2c","models/player/Suits/male_02_open.mdl"},
    {"Suit_2d","models/player/Suits/male_02_open_tie.mdl"},
    {"Suit_2e","models/player/Suits/male_02_open_waistcoat.mdl"},
    {"Suit_2f","models/player/Suits/male_02_shirt.mdl"},
    {"Suit_2g","models/player/Suits/male_02_shirt_tie.mdl"},
    {"Suit_3a","models/player/Suits/male_03_closed_coat_tie.mdl"},
    {"Suit_3b","models/player/Suits/male_03_closed_tie.mdl"},
    {"Suit_3c","models/player/Suits/male_03_open.mdl"},
    {"Suit_3d","models/player/Suits/male_03_open_tie.mdl"},
    {"Suit_3e","models/player/Suits/male_03_open_waistcoat.mdl"},
    {"Suit_3f","models/player/Suits/male_03_shirt.mdl"},
    {"Suit_3g","models/player/Suits/male_03_shirt_tie.mdl"},
    {"Suit_4a","models/player/Suits/male_04_closed_coat_tie.mdl"},
    {"Suit_4b","models/player/Suits/male_04_closed_tie.mdl"},
    {"Suit_4c","models/player/Suits/male_04_open.mdl"},
    {"Suit_4d","models/player/Suits/male_04_open_tie.mdl"},
    {"Suit_4e","models/player/Suits/male_04_open_waistcoat.mdl"},
    {"Suit_4f","models/player/Suits/male_04_shirt.mdl"},
    {"Suit_4g","models/player/Suits/male_04_shirt_tie.mdl"},
    {"Suit_5a","models/player/Suits/male_05_closed_coat_tie.mdl"},
    {"Suit_5b","models/player/Suits/male_05_closed_tie.mdl"},
    {"Suit_5c","models/player/Suits/male_05_open.mdl"},
    {"Suit_5d","models/player/Suits/male_05_open_tie.mdl"},
    {"Suit_5e","models/player/Suits/male_05_open_waistcoat.mdl"},
    {"Suit_5g","models/player/Suits/male_05_shirt_tie.mdl"},
    {"Suit_6a","models/player/Suits/male_06_closed_coat_tie.mdl"},
    {"Suit_6b","models/player/Suits/male_06_closed_tie.mdl"},
    {"Suit_6c","models/player/Suits/male_06_open.mdl"},
    {"Suit_6d","models/player/Suits/male_06_open_tie.mdl"},
    {"Suit_6e","models/player/Suits/male_06_open_waistcoat.mdl"},
    {"Suit_6f","models/player/Suits/male_06_shirt.mdl"},
    {"Suit_6g","models/player/Suits/male_06_shirt_tie.mdl"},
    {"Suit_7a","models/player/Suits/male_07_closed_coat_tie.mdl"},
    {"Suit_7b","models/player/Suits/male_07_closed_tie.mdl"},
    {"Suit_7c","models/player/Suits/male_07_open.mdl"},
    {"Suit_7d","models/player/Suits/male_07_open_tie.mdl"},
    {"Suit_7e","models/player/Suits/male_07_open_waistcoat.mdl"},
    {"Suit_7f","models/player/Suits/male_07_shirt.mdl"},
    {"Suit_7g","models/player/Suits/male_07_shirt_tie.mdl"},
    {"Suit_8a","models/player/Suits/male_08_closed_coat_tie.mdl"},
    {"Suit_8b","models/player/Suits/male_08_closed_tie.mdl"},
    {"Suit_8c","models/player/Suits/male_08_open.mdl"},
    {"alyx","models/player/alyx.mdl"},
    {"barney","models/player/barney.mdl"},
    {"breen","models/player/breen.mdl"},
    {"charple","models/player/charple.mdl"},
    {"chell","models/player/p2_chell.mdl"},
    {"combine","models/player/combine_soldier.mdl"},
    {"combineelite","models/player/combine_super_soldier.mdl"},
    {"combineprison","models/player/combine_soldier_prisonguard.mdl"},
    {"corpse","models/player/corpse1.mdl"},
    {"css_arctic","models/player/arctic.mdl"},
    {"css_gasmask","models/player/gasmask.mdl"},
    {"css_guerilla","models/player/guerilla.mdl"},
    {"css_leet","models/player/leet.mdl"},
    {"css_phoenix","models/player/phoenix.mdl"},
    {"css_riot","models/player/riot.mdl"},
    {"css_swat","models/player/swat.mdl"},
    {"css_urban","models/player/urban.mdl"},
    {"dod_american","models/player/dod_american.mdl"},
    {"dod_german","models/player/dod_german.mdl"},
    {"eli","models/player/eli.mdl"},
    {"female01","models/player/Group01/female_01.mdl"},
    {"female02","models/player/Group01/female_02.mdl"},
    {"female03","models/player/Group01/female_03.mdl"},
    {"female04","models/player/Group01/female_04.mdl"},
    {"female05","models/player/Group01/female_05.mdl"},
    {"female06","models/player/Group01/female_06.mdl"},
    {"female07","models/player/Group03/female_01.mdl"},
    {"female08","models/player/Group03/female_02.mdl"},
    {"female09","models/player/Group03/female_03.mdl"},
    {"female10","models/player/Group03/female_04.mdl"},
    {"female11","models/player/Group03/female_05.mdl"},
    }

    Your table is tiny compared to others. This is more of an array, but meh.
     
  13. Pab14567

    Pab14567 Well-Known Member

    ... I don't... I know what to say... it's magnificent
     
  14. Sir Klutch

    Sir Klutch Active Member

    So you're saying basically if the gas pump model is spawned remove it? Sure, that is a way. Although, if that is in fact the case... anyone who wanted to spawn the gas pump prop to build with won't be able too.
     
  15. MaccyD

    MaccyD Member

    nope not if its run in initpostentity :) but anyway i dont exactly like that idea because its looping through all of the entitys on the map :p and if there was 2 different gas stations that used 2 different models? or an addon which used that model?
    --- Double Post Merged, Feb 15, 2017 ---
    i also never said my table was big, any my closet system uses a bigger table than that :)
    --- Double Post Merged, Feb 15, 2017 ---
    id also like to ask you to take a second look at that code ;) your setting the gas pump before the forloop :O

    if you were to use that method id change this line to something like this
    Code (Text):

      if gasprops[v:EntIndex()] && IsValid(v) then v:Remove() end
     
     
  16. Pab14567

    Pab14567 Well-Known Member

    See this is why my way is easier :) You don't need to worry about any tables or coding, just simple, configure, compile, upload to workshop, bam.
     
  17. anathemA

    anathemA New Member

    Clearly you didn't see whom I tagged.
    Don't try to start something when it wasn't even targeted at you.
    [​IMG]

    EDIT:
    If you're paranoid about player's spawning in the gas station prop(and it gets removed), then check to see if they own it.
     
  18. MaccyD

    MaccyD Member

    im not trying to start anything im just pointing stuff out that you clearly didnt notice, if you thought that was calling you out or even trying to start something, your not exactly mentally ready for the internet
    --- Double Post Merged, Feb 15, 2017 ---
    yeah but i dont like the fact i have to force a user to download a map just to play on my server, like i said id only do that if it 100% needed it and was f***ing with my servers cpu
     
  19. anathemA

    anathemA New Member

    I'm*
    I*
    You're*
    Didn't*

    I understand it's an online forum, grammar isn't important, but don't challenge someone about being mentally ready.



    I apologise for me coming off as aggressive when I made that comment, I woke up and really couldn't deal with anything.

    Sorry for coming across rude, should have said "I wasn't talking to you I was talking to x, sorry for the confusion.'
     
  20. MaccyD

    MaccyD Member

    I'm sorry that i do not care about my grammar, i graduated high school a long time ago and quite frankly i don't have any use for grammar unless I am talking to one of my sponsors, learn to deal with it
     

Share This Page