Advertisement
Guest User

Untitled

a guest
Oct 19th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.56 KB | None | 0 0
  1. RegisterNUICallback('callEvent', function(data, cb)
  2.   local plyPos = GetEntityCoords(GetPlayerPed(-1), true)
  3.   if data.eventName ~= 'cancel' then
  4.     if data.data ~= nil then
  5.       --TriggerServerEvent("call:makeCall", "police", {x=plyPos.x,y=plyPos.y,z=plyPos.z},ResultMotifAdd,GetPlayerServerId(player))
  6.       TriggerServerEvent("call:makeCall", data.eventName, {x=plyPos.x,y=plyPos.y,z=plyPos.z}, data.data, GetPlayerServerId(player))
  7.       if data.eventName == "police" then
  8.         ShowNotificationMenuCivil2("~h~Vous avez appelé la ~b~POLICE")
  9.       elseif data.eventName == "taxi" then
  10.         ShowNotificationMenuCivil2("~h~Vous avez appelé un ~b~TAXI")
  11.       elseif data.eventName == "depan" then
  12.         ShowNotificationMenuCivil2("~h~Vous avez appelé un ~b~DEPANNEUR")
  13.       elseif data.eventName == "CNN" then
  14.         ShowNotificationMenuCivil2("~h~Vous avez appelé un ~b~JOURNALISTE")
  15.       elseif data.eventName == "medic" then
  16.         ShowNotificationMenuCivil2("~h~Vous avez appelé un ~b~AMBULANCIER")
  17.       elseif data.eventName == "brinks" then
  18.         ShowNotificationMenuCivil2("~h~Vous avez appelé un ~b~agent de la BRINKS")
  19.       end
  20.  
  21.  
  22.  
  23.  
  24.     else
  25.       local limit = data.limit or 255
  26.       local text = data.text or ''
  27.       if data.eventName ~= "RESPAWN" then
  28.         DisplayOnscreenKeyboard(1, "FMMC_MPM_NA", "", text, "", "", "", limit)
  29.         while (UpdateOnscreenKeyboard() == 0) do
  30.             DisableAllControlActions(0);
  31.             Wait(0);
  32.         end
  33.         if (GetOnscreenKeyboardResult()) then
  34.             text = GetOnscreenKeyboardResult()
  35.         end
  36.         TriggerServerEvent("call:makeCall", data.eventName, {x=plyPos.x,y=plyPos.y,z=plyPos.z}, text, GetPlayerServerId(player))
  37.         if data.eventName == "police" then
  38.           ShowNotificationMenuCivil2("~h~Vous avez appelé la ~b~POLICE")
  39.         elseif data.eventName == "taxi" then
  40.           ShowNotificationMenuCivil2("~h~Vous avez appelé un ~b~TAXI")
  41.         elseif data.eventName == "depan" then
  42.           ShowNotificationMenuCivil2("~h~Vous avez appelé un ~b~DEPANNEUR")
  43.         elseif data.eventName == "CNN" then
  44.           ShowNotificationMenuCivil2("~h~Vous avez appelé un ~b~JOURNALISTE")
  45.         elseif data.eventName == "medic" then
  46.           ShowNotificationMenuCivil2("~h~Vous avez appelé un ~b~AMBULANCIER")
  47.         elseif data.eventName == "brinks" then
  48.           ShowNotificationMenuCivil2("~h~Vous avez appelé un ~b~agent de la BRINKS")
  49.         end
  50.       else
  51.         TriggerEvent('es_em:cl_respawn')
  52.       end
  53.     end
  54.     cb()
  55.   end
  56. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement