SHARE
TWEET

Untitled

a guest Dec 14th, 2019 92 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local onServicePolice = {}
  2. local CountAPD = 0
  3. local CountAMC = 0
  4. local CountMEC = 0
  5.  
  6. RegisterServerEvent('OnService:countMembers')
  7. AddEventHandler('OnService:countMembers', function()
  8.   local user_id = vRP.getUserId(source)
  9.   local player = vRP.getUserSource(user_id)
  10.   local APDPermission = vRP.getUsersByPermission("policia.permissao")
  11.   local AMCPermission = vRP.getUsersByPermission("paramedico.permissao")
  12.   local MECPermission = vRP.getUsersByPermission("mec.permissao")
  13.   CountAPD = #APDPermission
  14.   CountAMC = #AMCPermission
  15.   CountMEC = #MECPermission
  16. end)
  17.  
  18. RegisterCommand('opo',function(source,args,rawCommand)
  19.     local user_id = vRP.getUserId(source)
  20.     local player = vRP.getUserSource(user_id)
  21.         CancelEvent();
  22.         if CountAPD >= 1 then
  23.             TriggerEvent("OnService:countMembers")
  24.             TriggerClientEvent("Notify",source,"aviso","<b>"..CountAPD.." membro(s) da PMERJ</b> em serviço no momento.")
  25.         else
  26.             TriggerEvent("OnService:countMembers")
  27.             TriggerClientEvent("Notify",source,"aviso","<b>Sem membros da PMERJ</b> em serviço no momento.")
  28.     end
  29. end)
  30.  
  31. RegisterCommand('opa',function(source,args,rawCommand)
  32.     local user_id = vRP.getUserId(source)
  33.     local player = vRP.getUserSource(user_id)
  34.         CancelEvent();
  35.         if CountAMC >= 1 then
  36.             TriggerEvent("OnService:countMembers")
  37.             TriggerClientEvent("Notify",source,"aviso","<b>"..CountAMC.." membro(s) do SAMU</b> em serviço no momento.")
  38.         else
  39.             TriggerEvent("OnService:countMembers")
  40.             TriggerClientEvent("Notify",source,"aviso","<b>Sem membros do SAMU</b> em serviço no momento.")
  41.     end
  42. end)
  43.  
  44. RegisterCommand('omec',function(source,args,rawCommand)
  45.     local user_id = vRP.getUserId(source)
  46.     local player = vRP.getUserSource(user_id)
  47.         CancelEvent();
  48.         if CountMEC >= 1 then
  49.             TriggerEvent("OnService:countMembers")
  50.             TriggerClientEvent("Notify",source,"aviso","<b>"..CountMEC.." mecânico(s)</b> em serviço no momento.")
  51.         else
  52.             TriggerEvent("OnService:countMembers")
  53.             TriggerClientEvent("Notify",source,"aviso","<b>Sem mecânicos</b> em serviço no momento.")
  54.     end
  55. end)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top