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
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