pNotify help

Hello.

I am trying to edit all my vRP notifications to use pNotify.
I have a small code here.

AddEventHandler("chatMessage", function(s, n, m)
  local message = string.lower(m)
  local user_id = vRP.getUserId({s})
  local source = vRP.getUserSource({user_id})
  local bankbalance = vRP.getBankMoney({user_id})

  command = splitString(message)

  if command[1] == "/bank" then
    TriggerClientEvent("chatMessage", s, "BANK", {0, 200, 0}, "Your current account balance: ^3$" .. bankbalance)
    TriggerClientEvent("banking:updateBalance", source, bankbalance)
    CancelEvent()
  end

The questing is how can i make that use pNotify

  • Best regards.
AddEventHandler("chatMessage", function(s, n, m)
  local message = string.lower(m)
  local user_id = vRP.getUserId({s})
  local source = vRP.getUserSource({user_id})
  local bankbalance = vRP.getBankMoney({user_id})

  command = splitString(message)

  if command[1] == "/bank" then
    TTriggerClientEvent("pNotify:SendNotification", source,{text = "Bank | Nuværrende balance: "..bankbalance.." DKK", type = "error", queue = "global", timeout = 4000, layout = "bottomCenter",animation = {open = "gta_effects_fade_in", close = "gta_effects_fade_out"}})
        TriggerClientEvent("banking:updateBalance", source, bankbalance)
    CancelEvent()
  end

What if i want to use pNotify here

  • And how do i send pNotify as Client message?
vRPclient.notify(player,{"un-whitelisted user "..id})

What’s the error in this code too

local function ch_whitelist(player,choice)
  local user_id = vRP.getUserId(player)
  if user_id ~= nil and vRP.hasPermission(user_id,"player.whitelist") then
    vRP.prompt(player,"User id to whitelist: ","",function(player,id)
      id = parseInt(id)
      vRP.setWhitelisted(id,true)
            TriggerEvent("pNotify:SetQueueMax","lmao", 1)
      TriggerClientEvent("pNotify:SendNotification", player,{text = "System | Whitelistet ID: "..id.." ", type = "success", queue = "lmao", timeout = 4000, layout = "bottomCenter",animation = {open = "gta_effects_fade_in", close = "gta_effects_fade_out"}})
    end)
  end
end
local function ch_whitelist(player,choice)
  local user_id = vRP.getUserId(player)
  if user_id ~= nil and vRP.hasPermission(user_id,"player.whitelist") then
    vRP.prompt(player,"USER ID: ","",function(player,id)
      id = parseInt(id)
      vRP.setWhitelisted(id,true)
	  TriggerClientEvent("pNotify:SendNotification", player,{text = "You whitelisted #"..id, type = "success", queue = "global", timeout = 3000, layout = "bottomCenter",animation = {open = "gta_effects_fade_in", close = "gta_effects_fade_out"}})       
    end)
  end
end

If you want to use a CLIENT-SIDE file, and put in a message there(client.lua eg.)

TriggerEvent("pNotify:SendNotification",{text = "No <b style='color:#ff0000'>nearby</b> vehicle found",type = "warning",timeout = (3000),layout = "centerLeft",queue = "global",animation = {open = "gta_effects_fade_in", close = "gta_effects_fade_out"}})

How do i add this to use pNotify?

vRPclient.notify(player,{group.." removed from user "..id})

I tried with:

    TriggerClientEvent("pNotify:SendNotification", player,{text = "System | Added: "..group" to ID: "..id, type = "success", queue = "global", timeout = 4000, layout = "bottomCenter",animation = {open = "gta_effects_fade_in", close = "gta_effects_fade_out"}}) 

But it dident work, what i am doing wrong here?

 TriggerClientEvent("pNotify:SendNotification", player,{
text = "System | Added: " .. group .. " to ID: " .. id, 
type = "success", 
queue = "global", 
timeout = 4000,
Layout = "bottomCenter",
animation = {open = "gta_effects_fade_in", 
close = "gta_effects_fade_out"}
})

Is it also possible to add a color to the variables group and id?
I have big problems getting ~r~ and ~s~ to work.

I’ve tried HMTL but I changes the formatting of the text and breaks lines or makes the notification larger than default…