Advertisement
Foxmice

CG call kode

Aug 20th, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.70 KB | None | 0 0
  1. AddEventHandler("vRP:playerJoinGroup", function(user_id, group, gtype)
  2.     if gtype == "job" then
  3.         local source = vRP.getUserSource({user_id})
  4.         if users[source] ~= nil then
  5.             PhoneNumbers[users[source].job].sources[tostring(source)] = nil
  6.             users[source] = nil
  7.         end
  8.         addToPhoneNumbers(group,source)
  9.         users[source] = {userid = user_id, job = group}
  10.     end
  11. end)
  12.  
  13. RegisterServerEvent('service:startCall')
  14. AddEventHandler('service:startCall', function (number, message, coords)
  15.     local source = source
  16.     local user_id = vRP.getUserId({source})
  17.     if number == "Politi-Job" or number == "EMS-Job" then
  18.         vRP.getUserIdentity({user_id, function(identity)
  19.             local discord = "https://discordapp.com/api/webhooks/612549618693308446/_4K-IbciILLATH6VGpa6ap5otJusC0IngLbJzRjBJouzK0BH72yAZ3zqZoZUBg195i40"
  20.             if number == "EMS-Job" then
  21.                 discord = "https://discordapp.com/api/webhooks/612549812688125962/MjQxQn5pNUD9_G6TD_qSzkWBplVcQ5mz5t5l-R51sHOR1juWAmKHO253VE6av57KOypi"
  22.             end
  23.             webhookDiscord(identity.phone.." - "..identity.firstname.." "..identity.name,message,discord)
  24.         end})
  25.     end
  26.     if PhoneNumbers[number] ~= nil then
  27.         vRP.getUserIdentity({user_id, function(identity)
  28.             local phone = identity.phone
  29.             notifyAlertSMS(number, {
  30.                 message = message,
  31.                 coords = (number == "Politi-Job" or number == "EMS-Job" or number == "Mekaniker-Job" or number == "Taxi") == true and coords or nil,
  32.                 numero = phone,
  33.                 userid = user_id,
  34.             }, PhoneNumbers[number].sources)
  35.         end})
  36.     end
  37. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement