[Release] Disable Wanted Level

@UncleBoss No it’s not. I don’t use essential mode. I ditched it because it didn’t work right for me. If you need stars because an arrest script relies on stars, wouldn’t it make more sense to modify the arrest script?

I just want more time before a wanted star disappear, for everyone. And finally a tracking system for cops that leads to the wanted players.

@UncleBoss ah I see. I haven’t done it yet but I plan to make a server wide chat message only available to moderators with level 1(cops on duty). Saying player name has a wanted level of X in (insert location here).

so we still need to extend the wanted time :slight_smile:

@UncleBoss I don’t see the need, for me at least. As soon as they are wanted the chat message will trigger. If the wanted level goes up another message will trigger. The trigger will be instant, no timeout. Not quite sure exactly how to yet, gotta check the natives. But I know it’s possible.

@HST Stars wil disappear between 40 sec. and 80 sec, it’s to short

@UncleBoss I’m sorry but I don’t see the need for that. As soon as they are wanted the message is triggered. Once wanted they are wanted until caught. The police will look for the player until they receive another CAD call. A warrant will be issued by the sheriff for the arrest of the player. Even if it’s just suspicion and for questioning. I feel any other way would ruin the RP immersion. The cops can’t say “you robbed that bank but we didn’t catch you in time so, shucks”.

Yeah I’m using messages for player law enforcement to look out for. I don’t see a need to actually keep the wanted levels especially if AI cops are turned off.

1 Like

@Anarchy_Rising I am still very new to Lua coding. I found the natives i need (i think) can you point me in the right direction on how to trigger a server wide message? Its server wide, so i wouldn’t use trigger client chat message. here are the natives.
GetPlayerName(player)
GetPlayerWantedLevel(player)
GetPlayerWantedCentrePosition(player)

any help you could offer would be greatly appreciated. I would prefer if only admins>=1 could see the message. less chance of meta.

@HST Well I use EssentialMode for all communication so I don’t think any method I could offer would help you. Didn’t you say you couldn’t get it to work?

As far as a server wide “broadcast” is concerned, I don’t think there is an all in one method to do it. How I would go about it is to get all players connected and send a client message to them independently.

This is just pseudocode from the top of my head but using this from a server script –

function sendMessageToAllClients(msg)
  for i = 0,32 do
    local cur = GetPlayerFromServerId(i)
    if NetworkIsPlayerActive(cur) then
      TriggerClientEvent('chatMessage', cur, {255, 255, 255}, msg)
    end
  end
end

Is that what you mean? You dont have to use chat message you could trigger any client event that way.

such as

client.lua

RegisterNetEvent('msgHandler')
AddEventHandler('msgHandler', function(msg)
  -- do something with the msg
end)

Sorry if I’m confusing.

@HST Here you go. Only tested with the local player but in theory it should work fine for more.

-- CLIENT
RegisterNetEvent('cGetPlayers')
AddEventHandler('cGetPlayers', function()
  TriggerServerEvent('sGetPlayers', getPlayers())
end)

function getPlayers()
  local playerList = {}
  
  for i = 0,32 do
    if NetworkIsPlayerActive(GetPlayerFromServerId(i)) then
      table.insert(playerList, GetPlayerFromServerId(i))
    end
  end
  
  return playerList
end

RegisterNetEvent('setplayerstuff')
AddEventHandler('setplayerstuff', function()
  local player = PlayerId()
  
  local name = GetPlayerName(player)
  local wl = GetPlayerWantedLevel(player)
  local wlcp = GetPlayerWantedCentrePosition(player)
  
  -- testing
  --TriggerEvent('chatMessage', "SYSTEM", {255, 0, 0}, tostring(name))
  
  -- This is the final destination, do stuff with the data here
end)

-- SERVER

-- This is the EssentialMode command system that I use to process commands.. If you aren't using ES, you would trigger it from a different place
TriggerEvent('es:addGroupCommand', 'test', "admin", function(source, args, user)
  TriggerClientEvent('cGetPlayers', source)
end, function(source, args, user)
  -- invalid credentials
end)

RegisterServerEvent('sGetPlayers')
AddEventHandler('sGetPlayers', function(list)
  for i = 1, #list do
    local id = tonumber(list[i]) - 1
    TriggerClientEvent('setplayerstuff', id)
  end
end)

1 Like

This line doesn’t work at all unfortunately “SetPlayerWantedLevelNoDrop(playerId, curWantedLevel, false)”

@Anarchy_Rising appreciate that man. I’ll see what I can do. I don’t use essentials, my commands/triggers are ran from my main.lua.

How can we disable police peds from spawn or just despawn them at once and restrict further spawn?

Anyone else have this stop working for them as well after last update??? Can someone tell me what changed so we can possibly get a fix…

Thanks

how do i find my server directory with the citmp-server.yml in it

where is my citmp-server.yml

how fix jobpolice not wanted

enable users wanted

Where is the citmp-server.yml because I cannot find it in the server files.