Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2019
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.58 KB | None | 0 0
  1. MySQL.createCommand("vRP/ples_raport", "UPDATE `vrp_users` SET `raport` = `raport` + 1 WHERE `id` = @sender_id")
  2. MySQL.createCommand("vRP/ples_resetraport", "UPDATE `vrp_users` SET `raport` = 0")
  3. MySQL.createCommand("vRP/ples_getraport", "SELECT `raport`, `id` FROM `vrp_users` WHERE `raport` != 0")
  4. RegisterCommand('resetraport', function(source, args, msg)
  5.     local user_id = vRP.getUserId(source)
  6.     if vRP.hasGroup(user_id, "Fondator") then
  7.         vRPclient.notify(source, {"~g~Rapoartele au fost resetate cu succes"})
  8.         MySQL.execute("vRP/ples_resetraport")
  9.     end
  10. end)
  11. RegisterCommand('rapoarte', function(source, args, msg)
  12.     local user_id = vRP.getUserId(source)
  13.     if vRP.hasGroup(user_id, "Fondator") then
  14.         MySQL.query("vRP/ples_getraport", {}, function(rows, affected)
  15.             local content = "<em><b>RAPORT STAFF</b></em>"
  16.             for i, v in pairs(rows) do
  17.                 content = content .. "<br/><em>ID: " .. v.id .. " -> " .. v.raport .. " rapoarte</em>"
  18.             end
  19.             vRPclient.setDiv(source,{"ples_raport",".div_ples_raport{ background-color: rgba(0,0,0,0.75); color: white; font-weight: bold; width: 500px; padding: 10px; margin: auto; margin-top: 150px; }",content})
  20.             Wait(10000)
  21.             vRPclient.removeDiv(source,{"ples_raport"})
  22.         end)
  23.     end
  24. end)
  25. local function ch_calladmin(player,choice)
  26.   local user_id = vRP.getUserId(player)
  27.   if user_id ~= nil then
  28.     vRP.prompt(player,"Describe your problem:","",function(player,desc)
  29.       desc = desc or ""
  30.       if desc ~= nil and desc ~= "" then
  31.       local answered = false
  32.       local players = {}
  33.       for k,v in pairs(vRP.rusers) do
  34.         local player = vRP.getUserSource(tonumber(k))
  35.         if vRP.hasPermission(k,"admin.tickets") and player ~= nil then
  36.           table.insert(players,player)
  37.         end
  38.       end
  39.       for k,v in pairs(players) do
  40.         vRP.request(v,"Admin ticket (user_id = "..user_id..") take/TP to ?: "..htmlEntities.encode(desc), 60, function(v,ok)
  41.           if ok then -- take the call
  42.             if not answered then
  43.               -- answer the call
  44.               vRPclient.notify(player,{"An admin took your ticket."})
  45.               vRPclient.getPosition(player, {}, function(x,y,z)
  46.                 vRPclient.teleport(v,{x,y,z})
  47.               end)
  48.               answered = true
  49.                   local sender_id = vRP.getUserId(v)
  50.                   MySQL.query("vRP/ples_raport", {sender_id = sender_id})
  51.             else
  52.               vRPclient.notify(v,{"Ticket already taken."})
  53.             end
  54.           end
  55.         end)
  56.       end
  57.       else
  58.         vRPclient.notify(player,{"Empty Admin Call."})
  59.       end
  60.     end)
  61.   end
  62. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement