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.

Replacing registered var "wanted" with custom var

Discussion in 'DarkRP Modding Questions & Help' started by froggie the wise, May 28, 2019.

  1. froggie the wise

    froggie the wise New Member

    Firstly, yes, I am replacing "wanted" DarkRPVar ignoring warnings not to modify the base game.

    I am overriding the var with a custom one, as I want to make modifications to the system (I could still use wanted, and adjust net types but would rather rename this var).

    Where all instances of "wanted" i have replaced with the renamed var, which works fine and as intended.

    There is only one problem I am having is when modifying cl_hud, and displaying the new var when looking at a user by calling self:getDarkRPVar("new_var"). This, for some reason registers nil, even though it is set for each user (it is correctly displayed in my hud using LocalPlayer():getDarkRPVar("new_var")).

    Any indications?
     
  2. (FPtje) Atheos

    (FPtje) Atheos Main Developer Staff Member

    You're ignoring the warnings, but are you willing to ignore the song?
    https://corefiles.darkrp.eu/

    You can create your own wanted system probably by using hooks and overriding functions. "Replacing" DarkRPVars is a shitty way of doing it because you're making it impossible to stay up to date with DarkRP AND you're bound to hit problems like you are now with the wanted system being tightly interwoven with the rest of the gamemode.
     

Share This Page