1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. All darkrp.com services will be shut down 31/07/2020

    Thanks for sticking around this long. We are effectively closing darkrp.com on 31/07/2020. The forums will be in a read-only state until it is shut down. Please save your assets, guides and everything else you will need.

On successful job vote hook?

Discussion in 'DarkRP Modding Questions & Help' started by -MS-, Oct 24, 2013.

  1. -MS-

    -MS- New Member

    I've made a few entities/NPCs you can press E on and select jobs. Each job has its own NPC.
    In order to prevent players from becoming these jobs from anywhere in the map I'm checking the distance between the player and the NPC.

    My problem is, that when it's a job you have to vote for, on a successful vote you're usually not near the NPC anymore and you're denied from becoming the job.

    I've looked into the hooks on the DarkRP wiki, but can't seem to find any hook fitting and just wanted to ask here before creating an issue on Github.
  2. -MS-

    -MS- New Member

    Bump - Maybe I should just make the issue and see what FPtje says to it.
  3. (FPtje) Atheos

    (FPtje) Atheos Main Developer Staff Member

    Use the customCheck of the job. It's called before the vote is made.
  4. -MS-

    -MS- New Member

    I am using customCheck for checking the distance when they request the job change. The problem is that after the vote is finished, it calls customCheck again, where it checks the distance. At this point, the player won't be near the NPC, of cause.
  5. (FPtje) Atheos

    (FPtje) Atheos Main Developer Staff Member

    -MS- likes this.

Share This Page