[Release] Disable Wanted Level


#1

This script disables Wanted Levels for all players serverwide, so you won’t have to deal with players who didn’t turn on Never Wanted on a trainer. Great for RP servers.

Download is here.

Installation:

  1. Go to your server directory
  2. Open up your citmp-server.yml
  3. At the buttom of the AutoStartResources, add:
  • NeverWanted
  1. Open your resources directory
  2. Extract the downloaded zip into this directory
  3. Turn on the server and enjoy the silence

nowanted.lua

Citizen.CreateThread(function()
    while true do
        Citizen.Wait(0)
        if GetPlayerWantedLevel(PlayerId()) ~= 0 then
            SetPlayerWantedLevel(PlayerId(), 0, false)
            SetPlayerWantedLevelNow(PlayerId(), false)
        end
    end
end)

[REQUEST] Script nerver wanted
[Release] Not Wanted
[Release] Scammer's Script Collection (09/03/17)
[Release] Additional Server Synchronization and ACL [1.0.6]
#2

Please also put code here.


#3

Great Script! Keep it up!


#4

Added it as requested.


#5

You could have just only used this instead without a loop.

  `SetMaxWantedLevel(0)`

#6

Huh, I tried this at the beginning and it didn’t work. I must have had a typo when writing it then.

Edit: Just tried it out, it doesn’t work.


#7

any way to just make the police despawn or still have a wanted level like SetPoliceIgnorePlayer but still have stars? So we can use arrest script


#8

Sorry for the thread necro, but you can accomplish that by using

local player = PlayerId()

SetPoliceIgnorePlayer(player, true)
SetDispatchCopsForPlayer(player, false)

The cops will ignore the player and not dispatch after you for crimes, but the wanted levels remain.


#9

how the script look then? I have been looking for a way to keep wanted levels in and just disable the ai cops so how would that script work?


#11

local player = PlayerId()

Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
if GetPlayerWantedLevel(PlayerId()) ~= 0 then
SetPoliceIgnorePlayer(player, true)
SetDispatchCopsForPlayer(player, false)
end
end
end)
There you go, You can get stars, but police will not spawn.
Can somebody make sure that the stars do not disappear after 1 min.?


[HELP] Disable ped police, doctor and fireman
#12

@UncleBoss the stars do eventually disappear, not sure if it’s one minute though. I will have the wanted level set to trigger a chat message " player name has a wanted level of X stars in (insert location here). So as long as the on duty police see the CAD call they will pursue.


#13

If you want the wanted level to stay until manually reset, you could probably use the native function–

PLAYER::SET_PLAYER_WANTED_LEVEL_NO_DROP

SetPlayerWantedLevelNoDrop(player, curWantedLevel, false)

Though I haven’t used that function yet at all.


#14

Okey thank you, there is only one problem left, this script only applies for the first joined user.


#15

@UncleBoss try using playerId instead of player. I can’t confirm if that’s a fix, as all the testing I do on my server is on my PC and by myself. So if you could test it, would be good to know.


#16

Yeah sorry, I was ‘extending’ the script in your previous post. Sometimes things that make sense in my own head don’t make sense to others.

local player = PlayerId()

Try calling those functions after the player has loaded and spawned too. Do you use essentialmode by chance @Uncleboss?


#17

@Anarchy_Rising I didn’t use the local player = playerId(). I used SetPoliceIgnorePlayer(playerId(), true)
SetDispatchCopsForPlayer(playerId(), false).
I used Mr.scammers format changing a few lines. Will test tonight with multiple players.


#18

No, i don’t use essentialmode, why?


#19

Doesn’t work for me, about 1 min and 20 sec after committing the stars disappear.


#20

@UncleBoss If you don’t mind me asking. Why do you need the stars to remain?


#21

@HST it’s already in the essentialmode??