Giter Site home page Giter Site logo

Comments (7)

FPtje avatar FPtje commented on August 16, 2024

The fact that many servers have this is no reason to add it by default.
Let servers give their own twist to it.

from darkrpmodification.

fantasticaneer avatar fantasticaneer commented on August 16, 2024

Not everyone knows how to code lua. It was my understanding the DarkRPModification addon was to make it so that you just need to know how to change values to make the changes you would generally want to make to customize your server easily and without extraneous coding.

I don't want it to be added by default and have to make people turn it off - it can be off by default, I just think it's something common enough that it should be included for the good of the script.

Anyway, if you're willing to help, I have this in my lua/autorun/server/assassinated.lua:

hook.Add("PlayerDeath","DemoteMayor",function(ply)
if (ply:Team() == TEAM_MAYOR) then
ply:ChangeTeam(TEAM_CITIZEN,true);
for k, v in ipairs(player.GetAll()) do
v:PrintMessage(HUD_PRINTCENTER,"The current Mayor of the city has been Assassinated!");
if v:Team() == TEAM_MAYORGUARD then
v:ChangeTeam(TEAM_CITIZEN,true);
end;
end;
end;
end);

It doesn't do anything when the mayor dies.

from darkrpmodification.

FPtje avatar FPtje commented on August 16, 2024

So the trick is that you want it for your server, and instead of making it yourself you ask me to put it in DarkRP by default.

from darkrpmodification.

fantasticaneer avatar fantasticaneer commented on August 16, 2024

I want it on other servers as well. This used to be something I'd see a lot and it makes a lot of sense so shitty mayors can be overthrown, but in the more recent versions of darkRP i've seen hosted, it hasn't been a feature just because it's not included. I think it should be an option like dropping cash on death or not, or voting on job changes or not.

If you don't want to code it I'd appreciate you telling me how to fix the version I want to implement, because apparently it's super easy (this code worked before but you removed the main.lua file I had it in) but I just don't know much, if you insist on not including it. I know it's not your job to implement every little feature I ask or tell me how to do it if you don't, but as a lua coder this is child's play to you, so the only reason you wouldn't just tell me is to be defensive about not wanting to do the work to put it in the script as a default.

Which would be easier than arguing!

from darkrpmodification.

fantasticaneer avatar fantasticaneer commented on August 16, 2024

I would learn gmod lua myself because it'd be easier than basically begging you for help on this ticket system when I run into simple issues but there's no resource anymore for learning the kind of lua at work in gmod today because Garry keeps fucking changing it and breaking everything and refactoring things to be 'easier' and 'better' and then people get sick of making documentation for it again and now there's no tutorials or intros to lua or anything. If you can point me to a good one go ahead.

from darkrpmodification.

fantasticaneer avatar fantasticaneer commented on August 16, 2024

On a less assholey note on my part, here's an error i'm getting on that code executing:

[ERROR] addons/darkrpmodification/lua/darkrp_modules/extragoodies/sv_models.lua:3: attempt to call method 'ChangeTeam' (a nil value)

  1. fn - addons/darkrpmodification/lua/darkrp_modules/extragoodies/sv_models.lua:3
    1. unknown - addons/ulib/lua/ulib/shared/hook.lua:183

if you just tell me what i'm supposed to be using here I'll go away.

from darkrpmodification.

Bo98 avatar Bo98 commented on August 16, 2024

Should be changeTeam (lowercase C).

from darkrpmodification.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.