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:

    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={
        local gaspump = gasprops[v:EntIndex()]
            for k, v in pairs(ents.FindByClass("prop_dynamic")) do
                if gaspump then v:Remove() 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):

    for k, v in pairs(gasprops) do
    if Entity(k) && IsValid(Entity(k)) then Entity(k):Remove() 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"},

    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.

    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 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