• [DarkRP] Possible to extends player's jail sentence
    7 replies, posted
So I have an idea for an addon but it would require the ability to extend a player's jail sentence while in jail. Changing the config would not work! I need to be able to add time to a jail sentence for only certain players. It is my understanding that jail time is not a changeable DarkrpVar. Would this be possible or only if I modify the base module?
Override this and you're set. https://github.com/FPtje/DarkRP/blob/3cd9964e122388edc53a16a46dad813f44ef86fb/gamemode/modules/police/sv_init.lua#L94
I really do apologize about me being a lua novice, but when you say override do you mean I can redefine the hook/function in a new file and the game will recognize my implementation or I will have to edit the already existing hook/function?
Correct. If you make sure that your override is ran after the gamemode is loaded (by running in a GM:GamemodeLoaded hook, for example), it will override the player metatable method. The real clean way to do this is to use the darkrp_modifications addon, but you can also put it in autorun folder if you're lazy. Something like this should work. https://pastebin.com/jm9BSQxX I don't know what would cause certain players to have special jail times, but all you would have to do is change the "time" variable accordingly.
Alright man that's perfect, thanks for your time
You can't override this easy as that. arrrestedPlayers table is local. You will have to re-integrate the whole module and disable it in darkrpmodification.
So it would require tampering with the module?
Overrding, yes.
Sorry, you need to Log In to post a reply to this thread.