Simple Extortion…
Long story short, this is a simple modification i attempted to allow some cops be become dirty and extort players who they deemed worthy (it made for some interesting RP with trouble players).
I currently have the command setup for Couch DB (User Permissions) thus, if you are using a different way of identifying authoritative figures in your server, simply change the parameters. Also, there is a $500 cap on extorting… if a cop attempts to extort more than 500 at once they get kicked for abusing their power (same goes for non cop players who attempt to run the command).
(Working on ES3 - Needs to be updated for ES4)
Client side
RegisterNetEvent("rc:extort")
AddEventHandler("rc:extort", function(receiverid, extort)
if true then
SetNotificationTextEntry("STRING")
AddTextComponentSubstringPlayerName("~y~If you feel the cost of your safety is ~r~too high~y~, feel free to call my supervisor at ~r~/911.")
SetNotificationMessage("CHAR_LEST_FRANK_CONF", "CHAR_LEST_FRANK_CONF", true, 4, "~h~Dirty Cop", "~r~You have been extorted!")
DrawNotification(false, true);
end
end)
Server Side
RegisterServerEvent('ap:extort')
AddEventHandler('ap:extort', function(receiverid, extort)
TriggerEvent('es:getPlayerFromId', receiverid, function(user)
local player = user.identifier
user:removeMoney((extort))
TriggerClientEvent("rc:extort", receiverid, extort)
end)
end)
TriggerEvent("es:addCommand", "extort", function(source, args, user)
if user.permission_level >= 3 and (args[2] ~= nil and tonumber(args[3]) > 0) then
local receiverid = tonumber(args[2])
local extort = tonumber(args[3])
TriggerEvent('ap:extort', receiverid, extort)
user:addMoney((extort))
if ((extort)) >= 501 then
DropPlayer(user.source, "Abuse of power!")
end
elseif user.permission_level <= 3 then
DropPlayer(user.source, "ATTEMPTED TO RUN COP COMMANDS!")
end
end)
Custom Chat Icon
char_lest_frank_conf.ytd (2.6 KB)