Advertisement
Guest User

Untitled

a guest
Jan 16th, 2017
391
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 188.56 KB | None | 0 0
  1. local con = exports.mta_connection:getConnection()
  2.  
  3. local time= getRealTime()
  4. local hour = time.hour
  5. local minute = time.minute
  6. local sec = time.second
  7.  
  8. local rovid = "#7cc576[ExternalGaming]:#FFFFFF"
  9. local exinfo = "#1E8BC3[Információ]:#ffffff "
  10. local exhiba = "#dc143c[Hiba]:#ffffff "
  11. local adminlog = "INSERT INTO adminlog SET admin_name=?, adminacc_id=?, tevkod=?, chatlog=?, target_name=?, targetacc_id=?, date=CURDATE(), time=CURTIME()"
  12.  
  13. function findVehicle(id)
  14.     for k,v in ipairs(getElementsByType("vehicle")) do
  15.         local vid = tonumber(getElementData(v, "veh:id")) or -1
  16.         if vid == tonumber(id) then
  17.             return v
  18.         end
  19.     end
  20.     return nil
  21. end
  22.  
  23. function findJobVehicle(id)
  24.     for k,v in ipairs(getElementsByType("vehicle")) do
  25.         local vid = tonumber(getElementData(v, "veh:jobid")) or -1
  26.         if vid == tonumber(id) then
  27.             return v
  28.         end
  29.     end
  30.     return nil
  31. end
  32.  
  33. local getPlayerAdminName = function(p)
  34.     local name = tostring(getElementData(p, "char:anick")) or ""
  35.     return name
  36. end
  37.  
  38. function runString (commandstring, outputTo, source)
  39.     local sourceName
  40.     if source then
  41.         sourceName = getPlayerName(source)
  42.     else
  43.         sourceName = "Console"
  44.     end
  45.     function getLocalPlayer( )
  46.         return source
  47.     end
  48.     _G['source'] = source
  49.     if getElementType(source) == 'player' then
  50.         vehicle = getPedOccupiedVehicle(source) or getPedContactElement(source)
  51.         car = vehicle
  52.     end
  53.     local notReturned
  54.     local commandFunction,errorMsg = loadstring("return "..commandstring)
  55.     if errorMsg then
  56.         notReturned = true
  57.         commandFunction, errorMsg = loadstring(commandstring)
  58.     end
  59.     if errorMsg then
  60.         outputChatBox("Hiba: "..errorMsg, outputTo)
  61.         return
  62.     end
  63.     results = { pcall(commandFunction) }
  64.     if not results[1] then
  65.         outputChatBox("Hiba: "..results[2], outputTo)
  66.         return
  67.     end
  68.     if not notReturned then
  69.         local resultsString = ""
  70.         local first = true
  71.         for i = 2, #results do
  72.             if first then
  73.                 first = false
  74.             else
  75.                 resultsString = resultsString..", "
  76.             end
  77.             local resultType = type(results[i])
  78.             if isElement(results[i]) then
  79.                 resultType = "element:"..getElementType(results[i])
  80.             end
  81.             resultsString = resultsString..tostring(results[i]).." ["..resultType.."]"
  82.         end
  83.         outputChatBox("Eredmény: "..resultsString, outputTo)
  84.     elseif not errorMsg then
  85.         outputChatBox("Parancs lefuttatva!", outputTo)
  86.     end
  87. end
  88.  
  89. addCommandHandler("run321", function (player, command, ...)
  90.     return runString(table.concat({...}, " "), rootElement, player)
  91. end)
  92.  
  93.  
  94. addCommandHandler("srun321", function (player, command, ...)
  95.     return runString(table.concat({...}, " "), player, player)
  96. end)
  97.  
  98. function auncuff(thePlayer, commandName, targetPlayer)
  99.     if getElementData(thePlayer, "acc:admin") >= 1 then
  100.    
  101.         if not (targetPlayer) then
  102.             outputChatBox("#7cc576Használat:#ffffff /" .. commandName .. " [Név / ID]", thePlayer, 255, 255, 255, true)
  103.         else
  104.        
  105.             local targetPlayer, targetPlayerName = exports.mta_main:findPlayer(thePlayer, targetPlayer)
  106.            
  107.             if (targetPlayer) then
  108.            
  109.                 if getElementData(targetPlayer, "char.Cuffed") == 1 then
  110.                     setElementData(targetPlayer, "char.Cuffed", 0)
  111.                     setElementFrozen(targetPlayer, false)
  112.                     toggleControl(targetPlayer,'previous_weapon',true)
  113.                     toggleControl(targetPlayer,'fire',true)
  114.                     toggleControl(targetPlayer,'aim_weapon',true)
  115.                     toggleAllControls(targetPlayer, true, true, true)
  116.                     outputChatBox(exinfo .. "Sikeresen leszedted a bilincset #7cc576" .. targetPlayerName:gsub("_"," ") .. "#fffffff játékosról.", thePlayer, 255, 255, 255, true)
  117.                     outputChatBox(exinfo .. " #7cc576" .. getPlayerName(thePlayer):gsub("_"," ") .. "#fffffff leszedte rólad a bilincset.", targetPlayer, 255, 255, 255, true)
  118.                     outputAdminMessage("#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff leszedte a bilincset #7cc576" .. targetPlayerName:gsub("_"," ") .. "#ffffff játékosról.")
  119.                 else
  120.                     outputChatBox(exhiba .. "A játékos nincs megbilincselve.", thePlayer, 255 ,255, 255, true)
  121.                 end
  122.             else
  123.                 outputChatBox(exhiba .. "Nincs ilyen játékos.", thePlayer, 255, 255, 255, true)
  124.             end
  125.         end
  126.     end
  127. end
  128. addCommandHandler("auncuff", auncuff, false, false)
  129.  
  130. function reloadacl(source, command)
  131.     if getElementData(source, "acc:admin") >= 8 then
  132.        
  133.         local reload = aclReload()
  134.        
  135.         if (reload) then
  136.             outputAdminMessage("#7cc576" .. getPlayerAdminName(source) .. "#ffffff újratöltötte az ACL-t.")
  137.         else
  138.             outputChatBox("Hiba.", source)
  139.         end
  140.     end
  141. end
  142. addCommandHandler("reloadacl", reloadacl, false, false)
  143.  
  144. addEvent("setElementPosition",true)
  145. addEventHandler("setElementPosition",getRootElement(),
  146.     function(element,x,y,z,int,dim,rx,ry,rz)
  147.         setElementPosition(element,x,y,z)
  148.         setElementInterior(element,int)
  149.         setElementDimension(element,dim)
  150.         setElementRotation(element,rx,ry,rz)
  151.     end
  152. )
  153.  
  154. function adminDuty(player)
  155. if getElementData(player, "acc:admin") >= 1 then
  156.        
  157.         local value = getElementData(player,"char:adminduty")
  158.         if value == 0 then
  159.             exports.mta_notifications:createNotification(root, getPlayerAdminName(player) .. " adminszolgálatba lépett", 1)
  160.             setElementData(player, "char:oldName", getPlayerName(player))
  161.             setPlayerName(player, getPlayerAdminName(player))
  162.             setElementData(player, "char:adminduty", 1)
  163.            
  164.             local adutyTimer = setTimer(function()
  165.            
  166.                 if isElement(player) and getElementData(player, "char:adminduty") == 1 then
  167.                     local adutytime = getElementData(player, "aduty:time") or 0
  168.                     adutytime = adutytime + 1
  169.                     --outputChatBox(adutytime .. getPlayerName(player))
  170.                     setElementData(player, "aduty:time", adutytime)
  171.                     dbExec(con, "UPDATE characters SET adutyTime=? WHERE id='" .. getElementData(player, "char:id") .. "'", adutytime)
  172.                 end
  173.                
  174.             end, 60000, 0)
  175.             setElementData(player, "aduty:timer", adutyTimer)
  176.         elseif value == 1 then
  177.             exports.mta_notifications:createNotification(root, getPlayerAdminName(player) .. " kilépett az adminszolgálatból", 1)
  178.             setPlayerName(player, getElementData(player, "char:oldName"))
  179.             setElementData(player, "char:adminduty", 0)
  180.            
  181.             if isTimer(getElementData(player, "aduty:timer")) then
  182.                 killTimer(getElementData(player, "aduty:timer"))
  183.             end
  184.            
  185.         end
  186.        
  187.     end
  188. end
  189. addCommandHandler("adminduty", adminDuty, false, false)
  190.  
  191. --[[function saveAdutyTime(dataName,oldValue)
  192.     if getElementType(source) == "player" then
  193.         if (dataName == "char:adminduty") and isElement(source) and getElementData(source, "acc:admin") >= 1 then
  194.             local adutyTime = getElementData(source, "aduty:time") or 0
  195.             --outputChatBox(adutyTime .. " " .. getPlayerName(source))
  196.             dbExec(con, "UPDATE characters SET adutyTime=? WHERE id='" .. getElementData(source, "acc:id") .. "'", adutyTime)
  197.             outputDebugString(getPlayerName(source) .. " adminduty ideje mentve! (" .. adutyTime .. ")")
  198.         end
  199.     end
  200. end
  201. addEventHandler("onElementDataChange",getRootElement(),saveAdutyTime)]]
  202.  
  203. addEvent("outputAdminMessage",true)
  204. addEventHandler("outputAdminMessage",getRootElement(),
  205.     function(msg)
  206.         for k,v in ipairs(getElementsByType("player")) do
  207.             if (msg) and isElement(v) and getElementData(v, "loggedin") and tonumber(getElementData(v,"acc:admin") or 0) >= 1 then
  208.                 outputChatBox("#dc143c[Napló]:#ffffff ".. msg,v,255,255,255,true)
  209.             end
  210.         end
  211.         end
  212. )
  213.  
  214. function outputDeveloperMessage(msg)
  215.     for k, v in ipairs(getElementsByType("player")) do
  216.         if (msg) and isElement(v) and getElementData(v, "loggedin") and tonumber(getElementData(v, "acc:admin") or 0) >= 6 then
  217.             outputChatBox("#D64541[Napló Dev/FA/SA]#ffffff " ..msg, v,255, 255, 255, true)
  218.         end
  219.     end
  220. end
  221.  
  222.  
  223. function outputAdminMessage(msg)
  224.     for k,v in ipairs(getElementsByType("player")) do
  225.         if (msg) and isElement(v) and getElementData(v, "loggedin") and tonumber(getElementData(v,"acc:admin") or 0) >= 1 then
  226.             outputChatBox("#dc143c[Napló]:#ffffff ".. msg,v,255,255,255,true)
  227.         end
  228.     end
  229. end
  230.  
  231. addCommandHandler("freeze",
  232.     function(playerSource, cmd, player)
  233.         if (tonumber(getElementData(playerSource, "acc:admin")) >= 1) then
  234.             if player then
  235.                 local targetPlayer,targetPlayerName = exports["mta_main"]:findPlayer(playerSource, player)
  236.                 if targetPlayer then
  237.                     local veh = getPedOccupiedVehicle(targetPlayer)
  238.                     if (veh) then
  239.                         setElementFrozen(veh, true)
  240.                         toggleAllControls(targetPlayer, false, true, false)
  241.                         outputChatBox(exinfo .. "#7cc576"..getPlayerAdminName(playerSource).." #fffffflefagyasztott téged.", targetPlayer,0,0,0,true)
  242.                         outputChatBox("#ffffffLefagyasztottad #7cc576" .. targetPlayerName:gsub("_"," ") .. "#ffffff játékost.", playerSource,255,255,255,true)
  243.                     else
  244.                         --toggleAllControls(targetPlayer, false, true, false)
  245.                         setElementFrozen(targetPlayer, true)
  246.                         setPedWeaponSlot(targetPlayer, 0)
  247.                         setElementData(targetPlayer, "freeze", 1)
  248.                         outputChatBox(exinfo .. "#7cc576"..getPlayerAdminName(playerSource).." #fffffflefagyasztott téged.", targetPlayer,0,0,0,true)
  249.                         outputChatBox("#ffffffLefagyasztottad #7cc576" .. targetPlayerName:gsub("_"," ") .. "#ffffff játékost.", playerSource,255,255,255,true)
  250.                     end
  251.                     outputAdminMessage("#7cc576" .. getPlayerAdminName(playerSource) .. "#ffffff lefagyasztotta #7cc576" .. targetPlayerName:gsub("_"," ") .. "#ffffff játékost.")
  252.                 else
  253.                     outputChatBox(exhiba .. "Nincs ilyen játékos.", playerSource, 255, 255, 255, true)
  254.                 end
  255.             else
  256.                 outputChatBox("#7cc576Használat:#ffffff /"..cmd.." [Név / ID] ", playerSource,166,196,103,true)          
  257.             end
  258.         end
  259.     end
  260. )
  261.  
  262. addCommandHandler("unfreeze",
  263.     function(playerSource, cmd, player)
  264.         if (tonumber(getElementData(playerSource, "acc:admin")) >= 1) then
  265.             if player then
  266.                 local targetPlayer,targetPlayerName = exports["mta_main"]:findPlayer(playerSource, player)
  267.                 if targetPlayer then
  268.                     local veh = getPedOccupiedVehicle(targetPlayer)
  269.                     if (veh) then
  270.                         setElementFrozen(veh, false)
  271.                         toggleAllControls(targetPlayer, true, true, true)
  272.                         outputChatBox(exinfo .. "#7cc576"..getPlayerAdminName(playerSource).." #ffffffkiolvasztott téged.", targetPlayer,0,0,0,true)
  273.                         outputChatBox("#ffffffKiolvasztottad " .. targetPlayerName:gsub("_"," ") .. "#ffffff játékost.", playerSource,255,255,255,true)
  274.                     else
  275.                         setElementFrozen(targetPlayer, false)
  276.                         setElementData(targetPlayer, "freeze", 0)
  277.                         outputChatBox(exinfo .. "#7cc576"..getPlayerAdminName(playerSource).." #ffffffkiolvasztott téged.", targetPlayer,0,0,0,true)
  278.                         outputChatBox("#ffffffKiolvasztottad #7cc576" .. targetPlayerName:gsub("_"," ") .. "#ffffff játékost.", playerSource,255,255,255,true)
  279.                     end
  280.                     outputAdminMessage("#7cc576" .. getPlayerAdminName(playerSource) .. "#ffffff kiolvasztotta #7cc576" .. targetPlayerName:gsub("_"," ") .. "#ffffff játékost.")
  281.                 else
  282.                     outputChatBox(exhiba .. "Nincs ilyen játékos.", playerSource, 255, 255, 255, true)
  283.                 end
  284.             else
  285.                 outputChatBox("#7cc576Használat:#ffffff /"..cmd.." [Név / ID] ", playerSource,166,196,103,true)          
  286.             end
  287.         end
  288.     end
  289. )
  290.  
  291. enabledSerials = {
  292.     ["C6939C21860FF6AAB9CF590705775BF4"]=true, --djalmasi
  293. }
  294.  
  295. cmdList = {
  296.     ["shutdown"]=true,
  297.     ["register"]=true,
  298.     ["msg"]=true,
  299.     ["login"]=true,
  300.     ["restart"]=true,
  301.     ["start"]=true,
  302.     ["stop"]=true,
  303.     ["refresh"]=true,
  304.     ["aexec"]=true,
  305.     ["refreshall"]=true,
  306.     ["debugscript"]=true,
  307. }
  308.  
  309. addEventHandler("onPlayerCommand", root,
  310. function(cmdName)
  311.     if cmdList[cmdName] and not enabledSerials[getPlayerSerial(source)] then
  312.         cancelEvent()
  313.     end
  314. end)
  315.  
  316. adminSerials = {
  317.  
  318.     ["C6939C21860FF6AAB9CF590705775BF4"]=true, -- djalmasi
  319.  
  320.  
  321. addEventHandler ( "onElementDataChange", getRootElement(),
  322. function ( dataName )
  323.     if getElementType ( source ) == "player" and dataName == "acc:admin" then
  324.         if getElementData(source, "acc:admin") >= 6 then
  325.             if not adminSerials[getPlayerSerial(source)] then
  326.                 setElementData(source, "acc:admin", 0)
  327.                 outputAdminMessage("#7cc576" .. getElementData(source, "char:name") .. "#ffffff elvettük az admint bugoltatás végett. #00ced1(ID: "..getElementData(source, "playerid")..")")
  328.             end
  329.         end
  330.     end
  331. end
  332. )
  333.  
  334. addCommandHandler("asay",
  335.     function(playerSource, cmd, ...)
  336.         if (tonumber(getElementData(playerSource, "acc:admin")) >= 1) then
  337.             if getElementData(playerSource,"loggedin") then
  338.                 if not (...) then
  339.                     outputChatBox("#7cc576Használat:#ffffff /" .. cmd .. " [Szöveg]",playerSource, 255, 194, 14, true)
  340.                 else
  341.                     local msg = table.concat({...}, " ")
  342.                     outputChatBox(" ",getRootElement(),255,255,255,true)
  343.                     outputChatBox("#dc143c[Admin felhívás]: #7cc576" .. getPlayerAdminLevel(playerSource) .. " ".. getPlayerAdminName(playerSource) .."#ffffff: ".. msg,getRootElement(),255,255,255,true)
  344.                     triggerClientEvent(root, "asaySound", root)
  345.                 end
  346.             end
  347.         end
  348.     end
  349. )
  350.  
  351. -- RECON
  352. addCommandHandler("recon",
  353.     function(thePlayer, commandName, targetPlayer)
  354.         if (tonumber(getElementData(thePlayer, "acc:admin")) >= 1) then
  355.             if not (targetPlayer) then
  356.                 local rx = getElementData(thePlayer, "reconx")
  357.                 local ry = getElementData(thePlayer, "recony")
  358.                 local rz = getElementData(thePlayer, "reconz")
  359.                 local reconrot = getElementData(thePlayer, "reconrot")
  360.                 local recondimension = getElementData(thePlayer, "recondimension")
  361.                 local reconinterior = getElementData(thePlayer, "reconinterior")
  362.                
  363.                 if not (rx) or not (ry) or not (rz) or not (reconrot) or not (recondimension) or not (reconinterior) then
  364.                         outputChatBox("#7cc576Használat: #ffffff/" .. commandName .. " [Név / ID]",thePlayer, 255, 194, 14, true)
  365.                 else
  366.                     detachElements(thePlayer)
  367.                
  368.                     setElementPosition(thePlayer, rx, ry, rz)
  369.                     setPedRotation(thePlayer, reconrot)
  370.                     setElementDimension(thePlayer, recondimension)
  371.                     setElementInterior(thePlayer, reconinterior)
  372.                     setCameraInterior(thePlayer, reconinterior)
  373.                    
  374.                     setElementData(thePlayer, "reconx", nil)
  375.                     setElementData(thePlayer, "recony", nil, false)
  376.                     setElementData(thePlayer, "reconz", nil, false)
  377.                     setElementData(thePlayer, "reconrot", nil, false)
  378.                     setCameraTarget(thePlayer, thePlayer)
  379.                     setElementAlpha(thePlayer, 255)
  380.                     --outputChatBox("#7cc576[ExternalGaming]:#ffffff Recon kikapcsolva.", thePlayer,  255, 194, 14,true)
  381.                     setElementData(thePlayer, "invisible", false)
  382.                 end
  383.             else
  384.                 local targetPlayer, targetPlayerName =  exports["mta_main"]:findPlayer(thePlayer, targetPlayer)
  385.                
  386.                 if targetPlayer then
  387.                     local logged = getElementData(targetPlayer, "loggedin")
  388.                    
  389.                     if (logged==0) then
  390.                         outputChatBox("#7cc576[ExternalGaming]:#ffffff A játékos nincs bejelentkezve.", thePlayer, 210, 77, 87)
  391.                     else
  392.                         setElementAlpha(thePlayer, 0)
  393.                        
  394.                         if ( not getElementData(thePlayer, "reconx") or getElementData(thePlayer, "reconx") == true ) and not getElementData(thePlayer, "recony") then
  395.                             local x, y, z = getElementPosition(thePlayer)
  396.                             local rot = getPedRotation(thePlayer)
  397.                             local dimension = getElementDimension(thePlayer)
  398.                             local interior = getElementInterior(thePlayer)
  399.                             setElementData(thePlayer, "reconx", x)
  400.                             setElementData(thePlayer, "recony", y, false)
  401.                             setElementData(thePlayer, "reconz", z, false)
  402.                             setElementData(thePlayer, "reconrot", rot, false)
  403.                             setElementData(thePlayer, "recondimension", dimension, false)
  404.                             setElementData(thePlayer, "reconinterior", interior, false)
  405.                         end
  406.                         setPedWeaponSlot(thePlayer, 0)
  407.                        
  408.                         local playerdimension = getElementDimension(targetPlayer)
  409.                         local playerinterior = getElementInterior(targetPlayer)
  410.                        
  411.                         setElementDimension(thePlayer, playerdimension)
  412.                         setElementInterior(thePlayer, playerinterior)
  413.                         setCameraInterior(thePlayer, playerinterior)
  414.                        
  415.                         local x, y, z = getElementPosition(targetPlayer)
  416.                         setElementPosition(thePlayer, x - 10, y - 10, z - 5)
  417.                         local success = attachElements(thePlayer, targetPlayer, -10, -10, -5)
  418.                         if not (success) then
  419.                             success = attachElements(thePlayer, targetPlayer, -5, -5, -5)
  420.                             if not (success) then
  421.                                 success = attachElements(thePlayer, targetPlayer, 5, 5, -5)
  422.                             end
  423.                         end
  424.                        
  425.                         if not (success) then
  426.                             outputChatBox("#7cc576[ExternalGaming]: #ffffffNem sikerült kapcsolódni a játékoshoz.", thePlayer, 210, 77, 87, true)
  427.                         else
  428.                             setCameraTarget(thePlayer, targetPlayer)
  429.                             outputAdminMessage("#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff elkezdte reconolni #7cc576" .. targetPlayerName:gsub("_"," ") .. "#ffffff játékost. ")
  430.                             setElementData(thePlayer, "invisible", true)
  431.                             --outputChatBox("#7cc576[ExternalGaming]: #ffffffElkezdted reconolni #7cc576" .. string.gsub(targetPlayerName, "_", " ") .. "#ffffff játékost.", thePlayer,  255, 194, 14,true)
  432.                         end
  433.                     end
  434.                 end
  435.             end
  436.         end
  437.     end
  438. )
  439.  
  440. addCommandHandler("srecon",
  441.     function(thePlayer, commandName, targetPlayer)
  442.         if (tonumber(getElementData(thePlayer, "acc:admin")) >= 7) then
  443.             if not (targetPlayer) then
  444.                 local rx = getElementData(thePlayer, "reconx")
  445.                 local ry = getElementData(thePlayer, "recony")
  446.                 local rz = getElementData(thePlayer, "reconz")
  447.                 local reconrot = getElementData(thePlayer, "reconrot")
  448.                 local recondimension = getElementData(thePlayer, "recondimension")
  449.                 local reconinterior = getElementData(thePlayer, "reconinterior")
  450.                
  451.                 if not (rx) or not (ry) or not (rz) or not (reconrot) or not (recondimension) or not (reconinterior) then
  452.                         outputChatBox("#7cc576Használat: #ffffff/" .. commandName .. " [Név / ID]",thePlayer, 255, 194, 14, true)
  453.                 else
  454.                     detachElements(thePlayer)
  455.                
  456.                     setElementPosition(thePlayer, rx, ry, rz)
  457.                     setPedRotation(thePlayer, reconrot)
  458.                     setElementDimension(thePlayer, recondimension)
  459.                     setElementInterior(thePlayer, reconinterior)
  460.                     setCameraInterior(thePlayer, reconinterior)
  461.                    
  462.                     setElementData(thePlayer, "reconx", nil)
  463.                     setElementData(thePlayer, "recony", nil, false)
  464.                     setElementData(thePlayer, "reconz", nil, false)
  465.                     setElementData(thePlayer, "reconrot", nil, false)
  466.                     setCameraTarget(thePlayer, thePlayer)
  467.                     setElementAlpha(thePlayer, 255)
  468.                     setElementData(thePlayer, "invisible", false)
  469.                     outputChatBox("#D64541[SRECON]#ffffff Recon kikapcsolva.", thePlayer,  255, 194, 14,true)
  470.                                                
  471.                 end
  472.             else
  473.                 local targetPlayer, targetPlayerName =  exports["mta_main"]:findPlayer(thePlayer, targetPlayer)
  474.                
  475.                 if targetPlayer then
  476.                     local logged = getElementData(targetPlayer, "loggedin")
  477.                    
  478.                     if (logged==0) then
  479.                         outputChatBox("#D64541[SRECON]#ffffff A játékos nincs bejelentkezve.", thePlayer, 210, 77, 87)
  480.                     else
  481.                         setElementAlpha(thePlayer, 0)
  482.                        
  483.                         if ( not getElementData(thePlayer, "reconx") or getElementData(thePlayer, "reconx") == true ) and not getElementData(thePlayer, "recony") then
  484.                             local x, y, z = getElementPosition(thePlayer)
  485.                             local rot = getPedRotation(thePlayer)
  486.                             local dimension = getElementDimension(thePlayer)
  487.                             local interior = getElementInterior(thePlayer)
  488.                             setElementData(thePlayer, "reconx", x)
  489.                             setElementData(thePlayer, "recony", y, false)
  490.                             setElementData(thePlayer, "reconz", z, false)
  491.                             setElementData(thePlayer, "reconrot", rot, false)
  492.                             setElementData(thePlayer, "recondimension", dimension, false)
  493.                             setElementData(thePlayer, "reconinterior", interior, false)
  494.                         end
  495.                         setPedWeaponSlot(thePlayer, 0)
  496.                        
  497.                         local playerdimension = getElementDimension(targetPlayer)
  498.                         local playerinterior = getElementInterior(targetPlayer)
  499.                        
  500.                         setElementDimension(thePlayer, playerdimension)
  501.                         setElementInterior(thePlayer, playerinterior)
  502.                         setCameraInterior(thePlayer, playerinterior)
  503.                        
  504.                         local x, y, z = getElementPosition(targetPlayer)
  505.                         setElementPosition(thePlayer, x - 10, y - 10, z - 5)
  506.                         local success = attachElements(thePlayer, targetPlayer, -10, -10, -5)
  507.                         if not (success) then
  508.                             success = attachElements(thePlayer, targetPlayer, -5, -5, -5)
  509.                             if not (success) then
  510.                                 success = attachElements(thePlayer, targetPlayer, 5, 5, -5)
  511.                             end
  512.                         end
  513.                        
  514.                         if not (success) then
  515.                             outputChatBox("#D64541[SRECON] #ffffffNem sikerült kapcsolódni a játékoshoz.", thePlayer, 210, 77, 87, true)
  516.                         else
  517.                             setCameraTarget(thePlayer, targetPlayer)
  518.                             --outputAdminMessage("#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff elkezdte reconolni " .. targetPlayerName:gsub("_"," ") .. " játékost. ")
  519.                            
  520.                             for i, v in ipairs(getElementsByType("player")) do
  521.                                 if tonumber(getElementData(v, "acc:admin") or 0) >= 7 and getElementData(v, "loggedin") then
  522.                                     if getPlayerName(thePlayer) ~= getPlayerName(v) then
  523.                                         outputChatBox("#D64541[SRECON]#7cc576 " .. getPlayerAdminName(thePlayer) .. "#ffffff megfigyeli #7cc576" .. getPlayerName(targetPlayer) .. "#ffffff játékost.", v, 255, 255, 255, true)
  524.                                     end
  525.                                 end
  526.                             end
  527.                             setElementData(thePlayer, "invisible", true)
  528.                             outputChatBox("#D64541[SRECON]#ffffff Megfigyeled #7cc576" .. string.gsub(targetPlayerName, "_", " ") .. "#ffffff játékost.", thePlayer,  255, 194, 14,true)
  529.                         end
  530.                     end
  531.                 end
  532.             end
  533.         end
  534.     end
  535. )
  536.  
  537. function fuckRecon(thePlayer, commandName, targetPlayer)
  538.     if (tonumber(getElementData(thePlayer, "acc:admin")) >= 1) then
  539.         local rx = getElementData(thePlayer, "reconx")
  540.         local ry = getElementData(thePlayer, "recony")
  541.         local rz = getElementData(thePlayer, "reconz")
  542.         local reconrot = getElementData(thePlayer, "reconrot")
  543.         local recondimension = getElementData(thePlayer, "recondimension")
  544.         local reconinterior = getElementData(thePlayer, "reconinterior")
  545.         local Rotation = getPedRotation(thePlayer)
  546.        
  547.         detachElements(thePlayer)
  548.         setCameraTarget(thePlayer, thePlayer)
  549.         setElementAlpha(thePlayer, 255)
  550.        
  551.         if rx and ry and rz then
  552.             setElementPosition(thePlayer, rx, ry, rz)
  553.             if reconrot then
  554.                 setPedRotation(thePlayer, Rotation)
  555.             end
  556.            
  557.             if recondimension then
  558.                 setElementDimension(thePlayer, recondimension)
  559.             end
  560.            
  561.             if reconinterior then
  562.                 setElementInterior(thePlayer, reconinterior)
  563.                 setCameraInterior(thePlayer, reconinterior)
  564.             end
  565.         end
  566.        
  567.         setElementData(thePlayer, "reconx", nil)
  568.         setElementData(thePlayer, "recony", nil, false)
  569.         setElementData(thePlayer, "reconz", nil, false)
  570.         setElementData(thePlayer, "reconrot", nil, false)
  571.         outputChatBox("#7cc576[ExternalGaming] #ffffffRecon sikeresen kikapcsolva.", thePlayer,  255, 194, 14,true)
  572.     end
  573. end
  574. addCommandHandler("stoprecon", fuckRecon, false, false)
  575. ----
  576.  
  577.  
  578. -- /unflip
  579. function unflipCar(thePlayer, commandName, targetPlayer)
  580.     if (tonumber(getElementData(thePlayer, "acc:admin")) >= 1) then
  581.         if not targetPlayer then
  582.             if not (isPedInVehicle(thePlayer)) then
  583.                 outputChatBox(exhiba .. "Nem vagy járműben.", thePlayer,210, 77, 87, true)
  584.             else
  585.                 local veh = getPedOccupiedVehicle(thePlayer)
  586.                 local rx, ry, rz = getVehicleRotation(veh)
  587.                 setVehicleRotation(veh, 0, 0, 0)
  588.                 outputChatBox(exinfo .. "Helyreállítottad a járművedet.", thePlayer, 0, 255, 0, true)
  589.             end
  590.         else
  591.             local targetPlayer,targetPlayerName =  exports["mta_main"]:findPlayer(thePlayer, targetPlayer)
  592.             if targetPlayer then
  593.                 local logged = getElementData(targetPlayer, "loggedin")
  594.                 local username = getPlayerName(thePlayer):gsub("_"," ")
  595.                
  596.                 if (not logged) then
  597.                     outputChatBox("#7cc576[ExternalGaming]:#ffffff A játékos nincs bejelentkezve.", thePlayer, 255, 0, 0, true)
  598.                 else
  599.                     local pveh = getPedOccupiedVehicle(targetPlayer)
  600.                     if pveh then
  601.                         local rx, ry, rz = getVehicleRotation(pveh)
  602.                         setVehicleRotation(pveh, 0, 0, 0)
  603.                         outputChatBox(exinfo .. "#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff helyreállította a járművedet.", targetPlayer,  255, 194, 14,true)
  604.                         outputChatBox(exinfo .. "Helyreállítottad #7cc576" .. targetPlayerName:gsub("_"," ") .. "#ffffff jármûvét.", thePlayer,  255, 194, 14,true)
  605.                     else
  606.                         outputChatBox(exhiba .. "" ..targetPlayerName:gsub("_"," ") .. "#ffffff nincs jármûben.", thePlayer, 210, 77, 87, true)
  607.                     end
  608.                 end
  609.             end
  610.         end
  611.     end
  612. end
  613. addCommandHandler("unflip", unflipCar, false, false)
  614.  
  615. addCommandHandler("nearbyvehicles",
  616. function(playerSource, cmd)
  617.     if (tonumber(getElementData(playerSource, "acc:admin")) >= 1) then
  618.         local pX,pY,pZ = getElementPosition(playerSource)
  619.         for k,v in ipairs(getElementsByType("vehicle")) do
  620.             vX,vY,vZ = getElementPosition(v)
  621.             local dist = getDistanceBetweenPoints3D(pX,pY,pZ,vX,vY,vZ)
  622.             local id = getElementData(v,"veh:id") or "ismeretlen"
  623.             local owner = getElementData(v,"veh:owner") or "ismeretlen"
  624.             local oname = getElementData(v, "veh:oname") or "ismeretlen"
  625.             local interior = getElementInterior(playerSource)
  626.             local dimension = getElementDimension(playerSource)        
  627.             local interior1 = getElementInterior(v)
  628.             local dimension1 = getElementDimension(v)
  629.             if dist <= 15 and interior == interior1 and dimension == dimension1 then
  630.                 if (getElementData(v, "rent.Owner") or false) then oname = getPlayerName(getElementData(v, "rent.Owner")) .. " [Bérlés]" or "ismeretlen" end
  631.                 outputChatBox("#22A7F0[Járművek]#ffffff Jármű neve: #F89406"..getVehicleName(v).. " #F89406| #ffffffTávolság: #F89406" ..math.ceil(dist) .. " méter #F89406| #ffffffID:#F89406[" .. id .. "] | #ffffffTulajdonos: #F89406" .. oname, playerSource, 255,255,255,true)        
  632.             end
  633.         end
  634.     end
  635. end)
  636.  
  637. function getElementDataPlayerByAccountID(owner,elementDataName)
  638.     for k,v in ipairs(getElementsByType("player")) do
  639.         if getElementData(v,"acc:id") == owner then
  640.             return getElementData(v,elementDataName)
  641.         else
  642.             return "n/a"
  643.         end
  644.     end
  645. end
  646.  
  647. function toggleInvisibility(thePlayer)
  648.     if (tonumber(getElementData(thePlayer, "acc:admin")) >= 1) then
  649.         local enabled = getElementData(thePlayer, "invisible")
  650.         if (enabled == true) then
  651.             setElementAlpha(thePlayer, 255)
  652.             setElementData(thePlayer, "reconx", false)
  653.             outputChatBox(exinfo .. "Látható vagy.", thePlayer, 255, 0, 0,true)
  654.             setElementData(thePlayer, "invisible", false)
  655.         elseif (enabled == false or enabled == nil) then
  656.             setElementAlpha(thePlayer, 0)
  657.             setElementData(thePlayer, "reconx", true)
  658.             outputChatBox(exinfo .. "Láthatatlan vagy.", thePlayer, 0, 255, 0,true)
  659.             setElementData(thePlayer, "invisible", true)
  660.         else
  661.             outputChatBox("Elõbb kapcsold ki az Admin TV-t.", thePlayer, 255, 0, 0)
  662.         end
  663.     end
  664. end
  665. addCommandHandler("disappear", toggleInvisibility)
  666. addCommandHandler("vanish", toggleInvisibility)
  667.  
  668. addCommandHandler("kick",
  669.     function(player, cmd, target, ...)
  670.         --if getElementData(player,"loggedin") then
  671.         if getElementData(player, "acc:admin") >= 1 then
  672.                 if not (target) or not (...) then
  673.                     outputChatBox("#7cc576Használat:#ffffff /" .. cmd .. " [Név / ID] [Szöveg]",player, 255, 194, 14, true)
  674.                 else
  675.                 local targetPlayer,targetPlayerName = exports["mta_main"]:findPlayer(player, target)
  676.                 local name = table.concat({...}, " ")
  677.                
  678.                     if targetPlayer then
  679.                        
  680.                         if ((getElementData(targetPlayer, "acc:admin") or 0) > getElementData(player, "acc:admin")) then
  681.                             outputChatBox(exhiba .. "Nincs jogosultságod kirúgni " .. targetPlayerName:gsub("_", " ") .. " játékost. Hibakód: KICKAD", player, 255, 255, 255, true)
  682.                             --adminlog helye
  683.                             dbExec(con ,adminlog, getPlayerAdminName(player), getElementData(player, "acc:id"), "KICKAD", getPlayerAdminName(player) .. " megprobalta kickelni " .. targetPlayerName .. " (" .. getPlayerAdminName(targetPlayer) .. ") jatekost. Indok: " .. name .. " [ACCES DENIED]", getPlayerName(targetPlayer), getElementData(targetPlayer, "acc:id") or 0)
  684.                             return
  685.                         end
  686.                        
  687.                         local kick = setTimer( function()
  688.                             kickPlayer( targetPlayer, getPlayerAdminName(player), name )
  689.                         end, 1000, 1)
  690.                         local id = getElementData(targetPlayer, "acc:id") or 0
  691.                        
  692.                         if (kick) then
  693.                          exports.mta_notifications:createNotification(root, "#7cc576" .. getPlayerAdminName(player) .. "#ffffff kirúgta a szerverről #7cc576" .. targetPlayerName:gsub("_"," ") .. "#ffffff játékost.\n#7cc576Indok:#ffffff " .. name, 5)
  694.                         dbExec(con ,adminlog, getPlayerAdminName(player), getElementData(player, "acc:id"), "KICK", getPlayerAdminName(player) .. " kirúgta " .. targetPlayerName .. " játékost. Indok: " .. name .. "", targetPlayerName, id)
  695.                         else
  696.                             outputChatBox(exhiba .. "Hiba történt. Hibakód: KICK1", player, 255, 255, 255, true)
  697.                             dbExec(con ,adminlog, getPlayerAdminName(player), getElementData(player, "acc:id"), "KICK1", getPlayerAdminName(player) .. " megprobalta kickelni " .. targetPlayerName .. " jatekost, de nem sikerult. [Hibakod: KICK1]", getPlayerName(targetPlayer), getElementData(targetPlayer, "acc:id") or 0)
  698.                         end
  699.                        
  700.                     end
  701.                 end
  702.         end
  703.     --end
  704.     end
  705. )
  706.  
  707. addCommandHandler("kick",
  708.     function(player, cmd, target, ...)
  709.         if getElementData(player,"loggedin") then
  710.             if getElementData(player, "acc:guard") >= 1 then
  711.                     if not (target) or not (...) then
  712.                         outputChatBox("#7cc576Használat:#ffffff /" .. cmd .. " [Név / ID] [Szöveg]",player, 255, 194, 14, true)
  713.                     else
  714.                     local targetPlayer,targetPlayerName = exports["mta_main"]:findPlayer(player, target)
  715.                     local name = table.concat({...}, " ")
  716.                    
  717.                         if targetPlayer then
  718.                            
  719.                             if (getElementData(targetPlayer, "acc:admin") > getElementData(player, "acc:admin")) then
  720.                                 outputChatBox(exhiba .. "Nincs jogosultságod kirúgni " .. targetPlayerName:gsub("_", " ") .. " játékost. Hibakód: KICKAD", player, 255, 255, 255, true)
  721.                                 --adminlog helye
  722.                                 dbExec(con ,adminlog, getPlayerName(player), getElementData(player, "acc:id"), "KICKAD", getPlayerName(player) .. " [Egy RP Őr] megprobalta kickelni " .. targetPlayerName .. " (" .. getPlayerAdminName(targetPlayer) .. ") jatekost. Indok: " .. name .. " [ACCES DENIED]", getPlayerName(targetPlayer), getElementData(targetPlayer, "acc:id"))
  723.                                 return
  724.                             end
  725.                            
  726.                             local kick = setTimer( function()
  727.                                 kickPlayer( targetPlayer, "Egy RP Őr", name )
  728.                             end, 1000, 1)
  729.                             local id = getElementData(targetPlayer, "acc:id")
  730.                            
  731.                             if (kick) then
  732.                              
  733.                              
  734.                             for k, v in ipairs(getElementsByType("player")) do  
  735.                                 if tonumber(getElementData(v, "acc:admin") or 0) >= 7 and getElementData(v, "loggedin") then
  736.                                     exports.mta_notifications:createNotification(v, "#7cc576" .. getPlayerName(player) .. " [Őr]#ffffff kirúgta a szerverről #7cc576" .. targetPlayerName:gsub("_"," ") .. "#ffffff játékost.\n#7cc576Indok:#ffffff " .. name, 5)
  737.                                 else
  738.                                     exports.mta_notifications:createNotification(v, "#7cc576Egy RP Őr#ffffff kirúgta a szerverről #7cc576" .. targetPlayerName:gsub("_"," ") .. "#ffffff játékost.\n#7cc576Indok:#ffffff " .. name, 5)
  739.                                 end
  740.                             end
  741.                            
  742.                             dbExec(con ,adminlog, getPlayerName(player), getElementData(player, "acc:id"), "KICK", getPlayerName(player) .. " [Egy RP Őr] kirúgta " .. targetPlayerName .. " játékost. Indok: " .. name .. "", targetPlayerName, id)
  743.                             else
  744.                                 outputChatBox(exhiba .. "Hiba történt. Hibakód: KICK1", player, 255, 255, 255, true)
  745.                                 dbExec(con ,adminlog, getPlayerName(player), getElementData(player, "acc:id"), "KICK1", getPlayerName(player) .. " [Egy RP Őr] megprobalta kickelni " .. targetPlayerName .. " jatekost, de nem sikerult. [Hibakod: KICK1]", getPlayerName(targetPlayer), getElementData(targetPlayer, "acc:id"))
  746.                             end
  747.                            
  748.                         end
  749.                     end
  750.             end
  751.         end
  752.     end
  753. )
  754.  
  755. function banPlayer(thePlayer, commandName, targetPlayer, ido, ...)
  756.     if tonumber(getElementData(thePlayer, "acc:admin") or 0) >= 2 then
  757.  
  758.         if not (targetPlayer) or not (ido) or not (...) then
  759.             outputChatBox("#7cc576Használat: #ffffff/" .. commandName .. " [Név / ID] [0 = 15év | 1 = 4év | 1> = X óra] [Indok]", thePlayer, 255, 255, 255, true)
  760.         else
  761.        
  762.             local targetPlayer, targetPlayerName = exports.mta_main:findPlayer(thePlayer, targetPlayer)
  763.             local ido = tonumber(ido)
  764.             local reason = table.concat({...}, " ")
  765.            
  766.             if tonumber(getElementData(targetPlayer, "acc:admin") or 0) > tonumber(getElementData(thePlayer, "acc:admin") or 0) then
  767.                 outputChatBox(exhiba .. "Nincs jogosultságod kitiltani a játékost. Hibakód: BANAD", thePlayer, 255, 255, 255, true)
  768.                 return
  769.             end
  770.            
  771.             if ido == 0 then
  772.                 local sql = dbExec(con, "INSERT INTO bans SET accountID=?, bannedBy=?, timeZone=NOW() + INTERVAL 15 YEAR, Date=NOW(), playerSerial=?, reason=?, playername=?, ipadress=?, status=?", getElementData(targetPlayer, "acc:id"), getPlayerAdminName(thePlayer), getPlayerSerial(targetPlayer), reason, getPlayerName(targetPlayer):gsub("_"," "), getPlayerIP(targetPlayer), 1)
  773.                 local adminlog = dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, "acc:id"), "BAN", getPlayerAdminName(thePlayer) .. " kitiltotta " .. targetPlayerName .. " játékost a szerverről. Indok: " .. reason .. " Időtartam: " ..  ido .. "", targetPlayerName, getElementData(targetPlayer, "acc:id"))
  774.                 local oldBan = dbExec(con, "INSERT INTO oldbans SET accountID=?, bannedBy=?, banEnd=NOW() + INTERVAL 15 YEAR, banStart=NOW(), playerSerial=?, reason=?, playername=?, ipadress=?, status=?", getElementData(targetPlayer, "acc:id"), getPlayerAdminName(thePlayer), getPlayerSerial(targetPlayer), reason, getPlayerName(targetPlayer), getPlayerIP(targetPlayer), 2)
  775.                 if (sql) then
  776.                      exports.mta_notifications:createNotification(root, "#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff kitiltotta a szerverről #7cc576" .. targetPlayerName:gsub("_"," ") .. "#ffffff játékost.\n#7cc576Indok: #ffffff" .. reason, 6)
  777.                     setTimer(function()
  778.                     kickPlayer(targetPlayer, getPlayerAdminName(thePlayer), "Ki lettél tiltva a szerverről")
  779.                     end, 500, 1)                end
  780.             elseif ido == 1 then
  781.                 local sql = dbExec(con, "INSERT INTO bans SET accountID=?, bannedBy=?, timeZone=NOW() + INTERVAL 5 YEAR, Date=NOW(), playerSerial=?, reason=?, playername=?, ipadress=?, status=?", getElementData(targetPlayer, "acc:id"), getPlayerAdminName(thePlayer), getPlayerSerial(targetPlayer), reason, getPlayerName(targetPlayer):gsub("_"," "), getPlayerIP(targetPlayer), 1)
  782.                 local adminlog = dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, "acc:id"), "BAN", getPlayerAdminName(thePlayer) .. " kitiltotta " .. targetPlayerName .. " játékost a szerverről. Indok: " .. reason .. " Időtartam: " ..  ido .. "", targetPlayerName, getElementData(targetPlayer, "acc:id"))
  783.                 local oldBan = dbExec(con, "INSERT INTO oldbans SET accountID=?, bannedBy=?, banEnd=NOW() + INTERVAL 5 YEAR, banStart=NOW(), playerSerial=?, reason=?, playername=?, ipadress=?, status=?", getElementData(targetPlayer, "acc:id"), getPlayerAdminName(thePlayer), getPlayerSerial(targetPlayer), reason, getPlayerName(targetPlayer), getPlayerIP(targetPlayer), 2)
  784.                 if (sql) then
  785.                      exports.mta_notifications:createNotification(root, "#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff kitiltotta a szerverről #7cc576" .. targetPlayerName:gsub("_"," ") .. "#ffffff játékost.\n#7cc576Indok: #ffffff" .. reason, 6)
  786.                     setTimer(function()
  787.                     kickPlayer(targetPlayer, getPlayerAdminName(thePlayer), "Ki lettél tiltva a szerverről")
  788.                     end, 500, 1)                end
  789.             elseif ido > 1 then
  790.                 local sql = dbExec(con, "INSERT INTO bans SET accountID=?, bannedBy=?, timeZone=NOW() + INTERVAL " .. ido .. " HOUR, Date=NOW(), playerSerial=?, reason=?, playername=?, ipadress=?, status=?", getElementData(targetPlayer, "acc:id"), getPlayerAdminName(thePlayer), getPlayerSerial(targetPlayer), reason, getPlayerName(targetPlayer):gsub("_"," "), getPlayerIP(targetPlayer), 1)
  791.                 local adminlog = dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, "acc:id"), "BAN", getPlayerAdminName(thePlayer) .. " kitiltotta " .. targetPlayerName .. " játékost a szerverről. Indok: " .. reason .. " Időtartam: " ..  ido .. "", targetPlayerName, getElementData(targetPlayer, "acc:id"))
  792.                 local oldBan = dbExec(con, "INSERT INTO oldbans SET accountID=?, bannedBy=?, banEnd=NOW() + INTERVAL " .. ido .. " HOUR, banStart=NOW(), playerSerial=?, reason=?, playername=?, ipadress=?, status=?", getElementData(targetPlayer, "acc:id"), getPlayerAdminName(thePlayer), getPlayerSerial(targetPlayer), reason, getPlayerName(targetPlayer), getPlayerIP(targetPlayer), 2)
  793.                 if (sql) then
  794.                      exports.mta_notifications:createNotification(root, "#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff kitiltotta a szerverről #7cc576" .. targetPlayerName:gsub("_"," ") .. "#ffffff játékost.\n#7cc576Indok:#ffffff " .. reason, 6)
  795.                     setTimer(function()
  796.                     kickPlayer(targetPlayer, getPlayerAdminName(thePlayer), "Ki lettél tiltva a szerverről")
  797.                     end, 500, 1)
  798.                 end
  799.             else
  800.                 outputChatBox(exhiba .. "Az időtartamok 0 és a felett értendőek", thePlayer, 255, 255, 255, true)
  801.             end
  802.         end
  803.     end
  804. end
  805. addCommandHandler("ban", banPlayer, false, false)
  806.  
  807. function oBan(thePlayer, commandName, targetPlayer, ido, ...)
  808.     if tonumber(getElementData(thePlayer, "acc:admin") or 0) >= 2 then
  809.    
  810.         if not (targetPlayer) or not (ido) or not (...) then
  811.             outputChatBox("#7cc576Használat: #ffffff/" .. commandName .. " [Teljes_nev] [0 = 15év | 1 = 5év | 1> = X óra] [Indok]", thePlayer ,255, 255, 255, true)
  812.         else
  813.        
  814.             local targetPlayer = targetPlayer:gsub("_", " ")
  815.             local ido = tonumber(ido)
  816.             local reason = table.concat({...}, " ")
  817.            
  818.             if targetPlayer then
  819.                 local qh = dbQuery(con, "SELECT * FROM characters WHERE charname='" .. targetPlayer .. "'")
  820.                 local result, num = dbPoll ( qh, -1 )
  821.  
  822.                 if num == 0 then outputChatBox("#dc143c[Hiba]:#ffffff Nincs ilyen találat.", thePlayer, 255, 255, 255, true) return end
  823.                 if result then
  824.                     for _, row in ipairs ( result ) do
  825.                    
  826.                         id = tonumber(row["id"])
  827.                         accountid = tonumber(row["account"])
  828.                    
  829.                     end
  830.                    
  831.                     if (accountid) then
  832.                         local qh2 = dbQuery(con, "SELECT * FROM accounts WHERE id='" .. accountid .. "'")
  833.                         local result2 = dbPoll ( qh2, -1 )
  834.                         if result2 then
  835.                             for _2, row2 in ipairs ( result2 ) do
  836.                            
  837.                                 admin = tonumber(row2["admin"])
  838.                                 serial = row2["mtaserial"]
  839.                                 ip = row2["ip"]
  840.                                 username = row2["username"]
  841.                            
  842.                             end
  843.                            
  844.                             if (admin) > (getElementData(thePlayer, "acc:admin")) then
  845.                                 outputChatBox(exhiba .. "Nincs jogosultságod kitiltani ".. targetPlayer .. " játékost. Hibakód: OBANAD", thePlayer, 255, 255, 255, true)
  846.                                 local adminlog = dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, "acc:id"), "OBANAD", getPlayerAdminName(thePlayer) .. " offline próbálta kitiltani " .. targetPlayer .. " játékost a szerverről. Indok: " .. reason .. " Időtartam: " ..  ido .. " [ACCES DENIED] [Hibakod: OBANAD]", targetPlayer, accountid)
  847.                                 return
  848.                             end
  849.                            
  850.                             if ido >= 0 then
  851.                            
  852.                                 if ido == 0 then
  853.                                     timeSave = "NOW() + INTERVAL 15 YEAR"
  854.                                 elseif ido == 1 then
  855.                                     timeSave = "NOW() + INTERVAL 5 YEAR"
  856.                                 elseif ido > 1 then
  857.                                     timeSave = "NOW() + INTERVAL " .. ido .. " HOUR"
  858.                                 end
  859.                                
  860.                                 local banSave = dbExec(con, "INSERT INTO bans SET accountID=?, bannedBy=?, timeZone=" .. timeSave .. ", Date=NOW(), playerSerial=?, reason=?, playername=?, ipadress=?, status=?", accountid, getPlayerAdminName(thePlayer), serial, reason, targetPlayer, ip, 1)
  861.                                 local adminlog = dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, "acc:id"), "OBAN", getPlayerAdminName(thePlayer) .. " offline kitiltotta " .. targetPlayer .. " játékost a szerverről. Indok: " .. reason .. " Időtartam: " ..  ido .. "", targetPlayer, accountid)
  862.                                 local oldBan = dbExec(con, "INSERT INTO oldbans SET accountID=?, bannedBy=?, banEnd=" .. timeSave .. ", banStart=NOW(), playerSerial=?, reason=?, playername=?, ipadress=?, status=?", accountid, getPlayerAdminName(thePlayer), serial, reason, targetPlayer, ip, 2)
  863.                                 if (banSave) then
  864.                                      exports.mta_notifications:createNotification(root, "#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff kitiltotta a szerverről #7cc576" .. targetPlayer .. "#ffffff játékost.\n#7cc576Indok:#ffffff " .. reason, 6)
  865.                                     dbFree(qh)
  866.                                     dbFree(qh2)
  867.                                 else
  868.                                     outputChatBox(exhiba .. "A játékos kitiltása sikertelen.", thePlayer, 255, 255, 255, true)
  869.                                 end
  870.                             end
  871.                         end
  872.                     end
  873.                 else
  874.                     outputChatBox(exhiba .. "Nincs találat.", thePlayer, 255, 255, 255, true)
  875.                 end
  876.             end
  877.         end
  878.     end
  879. end
  880. addCommandHandler("oban", oBan, false, false)
  881.  
  882. function unBanPlayer(thePlayer, commandName, targetPlayer)
  883.     if getElementData(thePlayer, "acc:admin") >= 2 then
  884.        
  885.         if not (targetPlayer) then
  886.             outputChatBox("#7cc576Használat:#ffffff /" .. commandName .. " [Teljes_nev]", thePlayer, 255, 255, 255, true)
  887.         else
  888.        
  889.             local targetPlayer = targetPlayer:gsub("_", " ")
  890.            
  891.             if (targetPlayer) then
  892.            
  893.                 local qh = dbQuery(con, "SELECT * FROM bans WHERE playername='" .. targetPlayer.. "'")
  894.                 local result, num = dbPoll ( qh, -1 )
  895.                
  896.                 if result and num>0 then
  897.                     for _, row in ipairs( result ) do
  898.                    
  899.                         accountid = tonumber(row["accountID"])
  900.                         bannedBy = row["bannedBy"]
  901.                         status = tonumber(row["status"])
  902.                    
  903.                     end
  904.                    
  905.                     if (accountid) then
  906.                        
  907.                         if getElementData(thePlayer, "acc:admin") < 6 then
  908.                             if getPlayerAdminName(thePlayer) == bannedBy then
  909.                                 local unban = dbExec(con, "DELETE FROM bans WHERE accountID=" .. accountid .. "")
  910.                                 local oldBan = dbExec(con, "UPDATE oldbans SET status=? WHERE accountID=" .. accountid .. "", 1)
  911.                                 local adminlog = dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, "acc:id"), "UNBAN", getPlayerAdminName(thePlayer) .. " feloldotta " .. targetPlayer .. " kitiltását a szerverről.", targetPlayer, accountid)
  912.                                 if (unban) then
  913.                                     outputAdminMessage("#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff feloldotta " .. targetPlayer .. " kitiltásait.")
  914.                                 else
  915.                                     outputChatBox(exhiba .. "Nem sikerült feloldani a játékos kitiltásait.", thePlayer, 255, 255, 255, true)
  916.                                 end
  917.                             else
  918.                                 outputChatBox(exhiba .. "Nincs jogosultságod unbannolni a játékost. Hibakód: UNBANAD", thePlayer, 255, 255, 255, true)
  919.                                 return
  920.                             end
  921.                         else
  922.                             local unban = dbExec(con, "DELETE FROM bans WHERE accountID=" .. accountid .. "")
  923.                             local oldBan = dbExec(con, "UPDATE oldbans SET status=? WHERE accountID=" .. accountid .. "", 1)
  924.                             local adminlog = dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, "acc:id"), "UNBAN", getPlayerAdminName(thePlayer) .. " feloldotta " .. targetPlayer .. " kitiltását a szerverről.", targetPlayer, accountid)
  925.                             if (unban) then
  926.                                 outputAdminMessage("#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff feloldotta " .. targetPlayer .. " kitiltásait.")
  927.                             else
  928.                                 outputChatBox(exhiba .. "Nem sikerült feloldani a játékos kitiltásait.", thePlayer, 255, 255, 255, true)
  929.                             end
  930.                         end
  931.                     else
  932.                         outputChatBox(exhiba .. "Nincs találat.", thePlayer, 255, 255, 255, true)
  933.                     end
  934.                     dbFree(qh)
  935.                 else
  936.                     outputChatBox(exhiba .. "Nincs találat.", thePlayer, 255, 255, 255, true)
  937.                 end
  938.             end
  939.         end
  940.     end
  941. end
  942. addCommandHandler("unban", unBanPlayer, false, false)
  943. ----------------------------------------------------------------------------------------------------------------------------------------
  944. -- /setadminnick, /setadminlevel, /sethelperlevel -- ADMINISZTRÁTOR, ADMINSEGÉD KEZELÉSI PARANCSOK
  945. ----------------------------------------------------------------------------------------------------------------------------------------
  946.  
  947. function setAdminNick(thePlayer, commandName, target, name)
  948.     if getElementData(thePlayer, "acc:admin") > 6 then
  949.        
  950.         if not (target) or not (name) then
  951.             outputChatBox("#7cc576Használat: #ffffff/" .. commandName .. " [Név / ID] [Adminnév]", thePlayer, 255, 255, 255, true)
  952.         else
  953.        
  954.             local targetPlayer, targetPlayerName = exports["mta_main"]:findPlayer(thePlayer, target)
  955.             local adminName = table.concat({name}, " ")
  956.             local theName = getPlayerAdminName(thePlayer) or ""
  957.             local targetOldName = getPlayerAdminName(targetPlayer) or ""
  958.                 if not getElementData(targetPlayer, "loggedin") then return end
  959.                
  960.                 if (targetPlayer) then
  961.                
  962.                 if getElementData(targetPlayer, "acc:aseged") > 0 then
  963.                     outputChatBox(exhiba .. "Adminsegédnek nincs jogosultságod adminnevet beállítani. Hibakód: SAN2", thePlayer, 255, 255, 255, true)
  964.                     return
  965.                 end
  966.                
  967.                 local sql = dbExec(con, "UPDATE characters SET anick='" .. adminName .. "' WHERE id='" .. getElementData(targetPlayer, "char:id") .. "'")
  968.                
  969.                 if (sql) then
  970.                     outputChatBox("#7cc576" .. theName .. "#ffffff megváltoztatta #7cc576" .. targetOldName .. "#ffffff adminisztrátori nevét. #7cc576(".. adminName ..")", root, 255, 255, 255, true)
  971.                     dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, "acc:id"), "SETADMINNICK", theName .. " megvaltoztatta " .. targetOldName .. " adminisztratori nevet. (".. adminName ..") [SETADMINNICK]", targetPlayerName, getElementData(targetPlayer, "acc:id"))
  972.                     setElementData(targetPlayer, "char:anick", adminName)
  973.                 else
  974.                     outputChatBox(exhiba .. "Nem sikerült megváltoztatni (elmenteni) " .. targetOldName .. " adminisztrátori nevét. Hibakód: SAN1", thePlayer, 255, 255, 255, true)
  975.                     dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, "acc:id"), "SETADMINNICK1", theName .. " nem tudta megvaltoztatni " .. targetOldName .. " adminisztratori nevet. [Hibakod: SAN1]", targetPlayerName, getElementData(targetPlayer, "acc:id"))
  976.  
  977.                 end
  978.             end
  979.  
  980.  
  981.         end
  982.     end
  983. end
  984. addCommandHandler("setadminnick", setAdminNick, false, false)
  985.  
  986. function setAdminLevel(thePlayer, commandName, targetPlayer, rank)
  987.     if getElementData(thePlayer, "acc:admin") >= 7 or enabledSerials[getPlayerSerial(thePlayer)] then
  988.        
  989.         if not (targetPlayer) or not (rank) then
  990.             outputChatBox("#7cc576Használat: #ffffff/" .. commandName .. " [Név / ID] [Rang]", thePlayer, 255, 255, 255, true)
  991.         else
  992.  
  993.             local targetPlayer, targetPlayerName = exports.mta_main:findPlayer(thePlayer, targetPlayer)
  994.             local rank = tonumber(rank)
  995.             local rank = math.floor(rank)
  996.             local oldRank = getElementData(targetPlayer, "acc:admin")
  997.            
  998.             if not getElementData(targetPlayer, "loggedin") then return end
  999.            
  1000.             if (targetPlayer) then
  1001.                 if (rank) > 10 or (rank) < 0 then
  1002.                     outputChatBox(exhiba .. "Adminisztrátori rangok csak 1 és 10 között vannak.", thePlayer, 255, 255, 255, true)
  1003.                     return
  1004.                 end
  1005.                 setElementData(targetPlayer, "char:adminduty", 0)
  1006.                
  1007.                 if (rank) < 7 then
  1008.                     if getElementData(targetPlayer, "acc:admin") >= 8 and getElementData(thePlayer, "acc:admin") < 10 and not enabledSerials[getPlayerSerial(thePlayer)] then
  1009.                         outputChatBox(exhiba .. "Nincs jogosultságod megváltoztatni #7cc576" .. getPlayerAdminName(targetPlayer) .. "#ffffff adminisztrátori szintjét. Hibakód: SALAD1", thePlayer, 255, 255, 255, true)
  1010.                         dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, "acc:id"), "SETADMINLEVELAD1", "" .. getPlayerAdminName(thePlayer) .. " megprobalta megvaltoztatni " .. getPlayerAdminName(targetPlayer) .. " adminisztratori szintjet. (" .. oldRank .. " => " .. rank ..") [ACCES DENIED]", targetPlayerName, getElementData(targetPlayer, "acc:id"))
  1011.                    
  1012.                     else
  1013.                        
  1014.                         if getElementData(targetPlayer, "acc:admin") < getElementData(thePlayer, "acc:admin") or enabledSerials[getPlayerSerial(thePlayer)] or getElementData(thePlayer, "acc:admin") == 10 then
  1015.                             local sql = dbExec(con, "UPDATE accounts SET admin='" .. rank .. "' WHERE id='".. getElementData(targetPlayer, "acc:id") .. "'")
  1016.  
  1017.                             if (sql) then
  1018.                                 outputChatBox("#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff megváltoztatta #7cc576" .. getPlayerAdminName(targetPlayer) .. "#ffffff adminisztrátori szintjét. #7cc576(" .. oldRank .. " => " .. rank ..")", root, 255, 255, 255, true)
  1019.                                 setElementData(targetPlayer, "acc:admin", rank)
  1020.                                 dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, "acc:id"), "SETADMINLEVEL", "" .. getPlayerAdminName(thePlayer) .. " megvaltoztatta " .. getPlayerAdminName(targetPlayer) .. " adminisztratori szintjet. (" .. oldRank .. " => " .. rank ..")", targetPlayerName, getElementData(targetPlayer, "acc:id"))
  1021.                                 if (rank) == 0 then
  1022.                                     setElementData(targetPlayer, "char:aduty", 0)
  1023.                                     dbExec(con, "UPDATE characters SET adminduty='0' WHERE id='" .. getElementData(targetPlayer, "char:id") .. "'")
  1024.                                 end
  1025.                             else
  1026.                                 outputChatBox(exhiba .. "Nem sikerült megváltoztatni (elmenteni) #7cc576" .. getPlayerAdminName(targetPlayer) .. "#ffffff adminisztrátori szintjét. Hibakód: SAL1", thePlayer, 255, 255, 255, true)
  1027.                             end
  1028.                         else
  1029.                             outputChatBox(exhiba .. "Nincs jogosultságod megváltoztatni #7cc576" .. getPlayerAdminName(targetPlayer) .. "#ffffff adminisztrátori szintjét. Hibakód: SALAD3", thePlayer, 255, 255, 255, true)
  1030.                             dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, "acc:id"), "SETADMINLEVELAD1", "" .. getPlayerAdminName(thePlayer) .. " megprobalta megvaltoztatni " .. getPlayerAdminName(targetPlayer) .. " adminisztratori szintjet. (" .. oldRank .. " => " .. rank ..") [ACCES DENIED]", targetPlayerName, getElementData(targetPlayer, "acc:id"))
  1031.                         end
  1032.                     end
  1033.                 elseif (rank) >= 7 then
  1034.                     if getElementData(thePlayer, "acc:admin") == 10 or enabledSerials[getPlayerSerial(thePlayer)] then
  1035.                         local sql = dbExec(con, "UPDATE accounts SET admin='" .. rank .. "' WHERE id='".. getElementData(targetPlayer, "acc:id") .. "'")
  1036.  
  1037.                         if (sql) then
  1038.                             outputChatBox("#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff megváltoztatta #7cc576" .. getPlayerAdminName(targetPlayer) .. "#ffffff adminisztrátori szintjét. #7cc576(" .. oldRank .. " => " .. rank ..")", root ,255, 255, 255, true)
  1039.                             setElementData(targetPlayer, "acc:admin", rank)
  1040.                             dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, "acc:id"), "SETADMINLEVEL", "" .. getPlayerAdminName(thePlayer) .. " megvaltoztatta " .. getPlayerAdminName(targetPlayer) .. " adminisztratori szintjet. (" .. oldRank .. " => " .. rank ..")", targetPlayerName, getElementData(targetPlayer, "acc:id"))
  1041.                         else
  1042.                             outputChatBox(exhiba .. "Nem sikerült megváltoztatni (elmenteni) #7cc576" .. getPlayerAdminName(targetPlayer) .. "#ffffff adminisztrátori szintjét. Hibakód: SAL2", thePlayer, 255, 255, 255, true)
  1043.                         end
  1044.                     elseif getElementData(thePlayer, "acc:admin") >= 8 and (rank) <= 7 and getElementData(targetPlayer, "acc:admin") < getElementData(thePlayer, "acc:admin") then
  1045.                         local sql = dbExec(con, "UPDATE accounts SET admin='" .. rank .. "' WHERE id='".. getElementData(targetPlayer, "acc:id") .. "'")
  1046.  
  1047.                         if (sql) then
  1048.                             outputChatBox("#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff megváltoztatta #7cc576" .. getPlayerAdminName(targetPlayer) .. "#ffffff adminisztrátori szintjét. #7cc576(" .. oldRank .. " => " .. rank ..")", root ,255, 255, 255, true)
  1049.                             setElementData(targetPlayer, "acc:admin", rank)
  1050.                             dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, "acc:id"), "SETADMINLEVEL", "" .. getPlayerAdminName(thePlayer) .. " megvaltoztatta " .. getPlayerAdminName(targetPlayer) .. " adminisztratori szintjet. (" .. oldRank .. " => " .. rank ..")", targetPlayerName, getElementData(targetPlayer, "acc:id"))
  1051.                         else
  1052.                             outputChatBox(exhiba .. "Nem sikerült megváltoztatni (elmenteni) #7cc576" .. getPlayerAdminName(targetPlayer) .. "#ffffff adminisztrátori szintjét. Hibakód: SAL2", thePlayer, 255, 255, 255, true)
  1053.                         end
  1054.                     else
  1055.                         outputChatBox(exhiba .. "Nincs jogosultságod megváltoztatni #7cc576" .. getPlayerAdminName(targetPlayer) .. "#ffffff adminisztrátori szintjét. Hibakód: SALAD2", thePlayer, 255, 255, 255, true)
  1056.                         dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, "acc:id"), "SETADMINLEVELAD1", "" .. getPlayerAdminName(thePlayer) .. " megprobalta megvaltoztatni " .. getPlayerAdminName(targetPlayer) .. " adminisztratori szintjet. (" .. oldRank .. " => " .. rank ..") [ACCES DENIED]", targetPlayerName, getElementData(targetPlayer, "acc:id"))
  1057.                     end
  1058.                 end
  1059.             end
  1060.         end
  1061.  
  1062.  
  1063.     end
  1064. end
  1065. addCommandHandler("setadminlevel", setAdminLevel, false, false)
  1066.  
  1067. function setHelperLevel(thePlayer, commandName, targetPlayer, level)
  1068.     if getElementData(thePlayer, "acc:admin") >= 3 or enabledSerials[getPlayerSerial(thePlayer)] then
  1069.    
  1070.         if not (targetPlayer) or not (level) then
  1071.             if getElementData(thePlayer, "acc:admin") >= 3 and getElementData(thePlayer, "acc:admin") <= 6 then
  1072.                 outputChatBox("#7cc576Használat: #ffffff/" .. commandName .. " [Név / ID] [0 = Játékos | 1 = Ideiglenes adminsegéd]", thePlayer, 255, 255, 255, true)
  1073.             else
  1074.                 outputChatBox("#7cc576Használat: #ffffff/" .. commandName .. " [Név / ID] [0 = Játékos | 1 = IDG adminsegéd | 2 = Örök AS]", thePlayer, 255, 255, 255, true)
  1075.             end
  1076.         else
  1077.        
  1078.             local targetPlayer, targetPlayerName = exports.mta_main:findPlayer(thePlayer, targetPlayer)
  1079.             local level = tonumber(level)
  1080.             local oldLevel = getElementData(targetPlayer, "acc:aseged")
  1081.            
  1082.             if not getElementData(targetPlayer, "loggedin") then return end
  1083.            
  1084.             local admin = getPlayerAdminName(thePlayer)
  1085.             local adminID = getElementData(thePlayer, "acc:id")
  1086.             local targetID = getElementData(targetPlayer, "acc:id")
  1087.             local targetN = targetPlayerName
  1088.            
  1089.             if level < 0 or level > 2 then
  1090.                 outputChatBox(exhiba .. "A adminsegédi szintek 0 és 2 között vannak.", thePlayer, 255, 255, 255, true)
  1091.                 return
  1092.             end
  1093.            
  1094.             if level == 0 then
  1095.                 if oldLevel == 2 then
  1096.                     if getElementData(thePlayer, "acc:admin") >= 6 or enabledSerials[getPlayerSerial(thePlayer)] then
  1097.                         local sql = dbExec(con, "UPDATE accounts SET aseged='" .. level .. "' WHERE id='" .. getElementData(targetPlayer, "acc:id") .. "'")
  1098.                         if (sql) then
  1099.                             outputChatBox("#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff megváltoztatta #7cc576" .. targetPlayerName:gsub("_", " ") .. "#ffffff adminsegéd szintjét. #7cc576(".. oldLevel .. " => " .. level .. ")", root, 255, 255, 255, true)
  1100.                             setElementData(targetPlayer, "acc:aseged", level)
  1101.                             --adminlog
  1102.                             dbExec(con, adminlog, admin, adminID, "SETHELPERLEVEL", "" .. getPlayerAdminName(thePlayer) .. " megvaltoztatta " .. targetPlayerName:gsub("_", " ") .. " adminsegedi szintjet. (".. oldLevel .. " => " .. level .. ")", targetN, targetID)
  1103.                         else
  1104.                             outputChatBox(exhiba .. "Nem sikerült megváltoztatni a játékos adminsegéd szintjét. Hibakód: SHL1", thePlayer, 255, 255, 255, true)
  1105.                             --adminlog
  1106.                             dbExec(con, adminlog, admin, adminID, "SETHELPERLEVEL1", "" .. getPlayerAdminName(thePlayer) .. " nem tudta megvaltoztatni " .. targetPlayerName:gsub("_", " ") .. " adminseged szintjet. (".. oldLevel .. " => " .. level .. ") [Hibakod: SHL1]", targetN, targetID)
  1107.  
  1108.                         end
  1109.                     else
  1110.                         outputChatBox(exhiba .. "Nincs jogosultságod elvenni a játékos adminsegéd szintjét. Hibakód: SHLAD1", thePlayer, 255, 255, 255, true)
  1111.                         --adminlog
  1112.                         dbExec(con, adminlog, admin, adminID, "SETHELPERLEVELAD1", "" .. getPlayerAdminName(thePlayer) .. " nem tudta megvaltoztatni " .. targetPlayerName:gsub("_", " ") .. " adminseged szintjet. (".. oldLevel .. " => " .. level .. ") [ACCES DENIED] [Hibakod: SHLAD1]", targetN, targetID)
  1113.                     end
  1114.                 else
  1115.                     local sql = dbExec(con, "UPDATE accounts SET aseged='" .. level .. "' WHERE id='" .. getElementData(targetPlayer, "acc:id") .. "'")
  1116.                     if (sql) then
  1117.                         outputChatBox("#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff megváltoztatta #7cc576" .. targetPlayerName:gsub("_", " ") .. "#ffffff adminsegéd szintjét. #7cc576(".. oldLevel .. " => " .. level .. ")", root, 255, 255, 255, true)
  1118.                         setElementData(targetPlayer, "acc:aseged", level)
  1119.                         --adminlog
  1120.                         dbExec(con, adminlog, admin, adminID, "SETHELPERLEVEL", "" .. getPlayerAdminName(thePlayer) .. " megvaltoztatta " .. targetPlayerName:gsub("_", " ") .. " adminsegedi szintjet. (".. oldLevel .. " => " .. level .. ")", targetN, targetID)
  1121.                     else
  1122.                         outputChatBox(exhiba .. "Nem sikerült megváltoztatni a játékos adminsegédi szintjét. Hibakód: SHL2", thePlayer, 255, 255, 255, true)
  1123.                         --adminlog
  1124.                         dbExec(con, adminlog, admin, adminID, "SETHELPERLEVEL2", "" .. getPlayerAdminName(thePlayer) .. " nem tudta megvaltoztatni " .. targetPlayerName:gsub("_", " ") .. " adminsegedi szintjet. (".. oldLevel .. " => " .. level .. ") [Hibakod: SHL2]", targetN, targetID)
  1125.                     end
  1126.                 end
  1127.             elseif level == 1 then
  1128.                 if oldLevel == 2 then
  1129.                     if getElementData(thePlayer, "acc:admin") >= 6 or enabledSerials[getPlayerSerial(thePlayer)] then
  1130.                         local sql = dbExec(con, "UPDATE accounts SET aseged='" .. level .. "' WHERE id='" .. getElementData(targetPlayer, "acc:id") .. "'")
  1131.                         if (sql) then
  1132.                             outputChatBox("#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff megvaltoztatta #7cc576" .. targetPlayerName:gsub("_", " ") .. "#ffffff adminsegéd szintjét. #7cc576(".. oldLevel .. " => " .. level .. ")", root, 255, 255, 255, true)
  1133.                             setElementData(targetPlayer, "acc:aseged", level)
  1134.                             dbExec(con, "UPDATE accounts SET aseged='0' WHERE id='" .. getElementData(targetPlayer, "acc:id") .. "'")
  1135.                            
  1136.                             --adminlog
  1137.                             dbExec(con, adminlog, admin, adminID, "SETHELPERLEVEL", "" .. getPlayerAdminName(thePlayer) .. " megvaltoztatta " .. targetPlayerName:gsub("_", " ") .. " adminsegedi szintjet. (".. oldLevel .. " => " .. level .. ")", targetN, targetID)
  1138.                         else
  1139.                             outputChatBox(exhiba .. "Nem sikerült megváltoztatni a játékos adminsegédi szintjét. Hibakód: SHL3", thePlayer, 255, 255, 255, true)
  1140.                            
  1141.                             --adminlog
  1142.                             dbExec(con, adminlog, admin, adminID, "SETHELPERLEVEL3", "" .. getPlayerAdminName(thePlayer) .. " nem tudta megvaltoztatni " .. targetPlayerName:gsub("_", " ") .. " adminsegedi szintjet. (".. oldLevel .. " => " .. level .. ") [Hibakod: SHL3]", targetN, targetID)
  1143.  
  1144.                         end
  1145.                     else
  1146.                         outputChatBox(exhiba .. "Nincs jogosultságod elvenni a játékos adminsegéd szintjét. Hibakód: SHLAD2", thePlayer, 255, 255, 255, true)
  1147.                        
  1148.                         --adminlog
  1149.                         dbExec(con, adminlog, admin, adminID, "SETHELPERLEVELAD2", "" .. getPlayerAdminName(thePlayer) .. " nem tudta megvaltoztatni " .. targetPlayerName:gsub("_", " ") .. " adminsegedi szintjet. (".. oldLevel .. " => " .. level .. ") [ACCES DENIED] [Hibakod: SHLAD2]", targetN, targetID)
  1150.  
  1151.                     end
  1152.                 else
  1153.                     outputChatBox("#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff megváltoztatta #7cc576" .. targetPlayerName:gsub("_", " ") .. "#ffffff adminsegéd szintjét. #7cc576(".. oldLevel .. " => " .. level .. ")", root, 255, 255, 255, true)
  1154.                     setElementData(targetPlayer, "acc:aseged", level)
  1155.                    
  1156.                     --adminlog
  1157.                     dbExec(con, adminlog, admin, adminID, "SETHELPERLEVEL", "" .. getPlayerAdminName(thePlayer) .. " megvaltoztatta " .. targetPlayerName:gsub("_", " ") .. " adminsegedi szintjet. (".. oldLevel .. " => " .. level .. ")", targetN, targetID)
  1158.                 end
  1159.             elseif level == 2 then
  1160.                 if getElementData(thePlayer, "acc:admin") >= 7 or enabledSerials[getPlayerSerial(thePlayer)] then
  1161.                     local sql = dbExec(con, "UPDATE accounts SET aseged='" .. level .. "' WHERE id='" .. getElementData(targetPlayer, "acc:id") .. "'")
  1162.                     if (sql) then
  1163.                         outputChatBox("#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff megváltoztatta #7cc576" .. targetPlayerName:gsub("_", " ") .. "#ffffff adminsegéd szintjét. #7cc576(".. oldLevel .. " => " .. level .. ")", root, 255, 255, 255, true)
  1164.                         setElementData(targetPlayer, "acc:aseged", level)
  1165.                        
  1166.                         --adminlog
  1167.                         dbExec(con, adminlog, admin, adminID, "SETHELPERLEVEL", "" .. getPlayerAdminName(thePlayer) .. " megvaltoztatta " .. targetPlayerName:gsub("_", " ") .. " adminsegedi szintjet. (".. oldLevel .. " => " .. level .. ")", targetN, targetID)
  1168.                     else
  1169.                         outputChatBox(exhiba .. "Nem sikerült megváltoztatni a játékos adminsegédi szintjét. Hibakód: SHL4", thePlayer, 255, 255, 255, true)
  1170.                        
  1171.                         --adminlog
  1172.                         dbExec(con, adminlog, admin, adminID, "SETHELPERLEVEL4", "" .. getPlayerAdminName(thePlayer) .. " nem tudta megvaltoztatni " .. targetPlayerName:gsub("_", " ") .. " adminsegedi szintjet. (".. oldLevel .. " => " .. level .. ") [Hibakod: SHL4]", targetN, targetID)
  1173.  
  1174.                     end
  1175.                 else
  1176.                     outputChatBox(exhiba .. "Nincs jogosultságod 2-esre változtatni a játékos adminsegéd szintjét. Hibakód: SHLAD3", thePlayer, 255, 255, 255, true)
  1177.                    
  1178.                     --adminlog
  1179.                     dbExec(con, adminlog, admin, adminID, "SETHELPERLEVELAD3", "" .. getPlayerAdminName(thePlayer) .. " nem tudta megvaltoztatni " .. targetPlayerName:gsub("_", " ") .. " adminsegedi szintjet. (".. oldLevel .. " => " .. level .. ") [ACCES DENIED] [Hibakod: SHLAD3]", targetN, targetID)
  1180.  
  1181.                 end
  1182.             end
  1183.         end
  1184.     end
  1185. end
  1186. addCommandHandler("sethelperlevel", setHelperLevel, false, false)
  1187.  
  1188. function privateMessage(thePlayer, commandName, targetPlayer, ...)
  1189.     if not getElementData(thePlayer, "loggedin") then
  1190.         outputChatBox("nem szabad", thePlayer)
  1191.         return
  1192.     end
  1193.  
  1194.     if not (targetPlayer) or not (...) then
  1195.         outputChatBox("#7cc576Használat: #ffffff/".. commandName .. " [Név / ID] [Üzenet]", thePlayer, 255, 255, 255, true)
  1196.     else
  1197.    
  1198.         local targetPlayer, targetPlayerName = exports.mta_main:findPlayer(thePlayer, targetPlayer)
  1199.         if not (targetPlayer) then return end
  1200.         local message = table.concat({...}, " ")
  1201.         local playerRank = tonumber(getElementData(thePlayer, "acc:admin")) or 0
  1202.         local targetRank = tonumber(getElementData(targetPlayer, "acc:admin")) or 0
  1203.         local targetHelper = tonumber(getElementData(targetPlayer, "acc:aseged")) or 0
  1204.         local adminduty = getElementData(targetPlayer, "char:adminduty")
  1205.         local playerName = getPlayerName(thePlayer):gsub("_", " ")
  1206.         local playerNameTarget = targetPlayerName:gsub("_", " ")
  1207.         local adminNameTarget = getPlayerAdminName(targetPlayer)
  1208.         local adminName = getPlayerAdminName(thePlayer)
  1209.         local playerID = getElementData(thePlayer, "playerid")
  1210.         local targetID = getElementData(targetPlayer, "playerid")
  1211.        
  1212.        
  1213.         if playerRank == 0 then
  1214.             if targetHelper > 0 then
  1215.                 outputChatBox("#ff9000[PM - Tőled]#ffffff #ffffff" .. playerNameTarget .. " (#ffffff" .. targetID .. "):#ff9000 " .. message, thePlayer, 255, 255, 255, true)
  1216.                 outputChatBox("#ff9000[PM - Neked]#ffffff #ffffff" .. playerName .. " (#ffffff" .. playerID .. "):#ff9000 " .. message, targetPlayer, 255, 255, 255, true)
  1217.                
  1218.                 triggerClientEvent(targetPlayer, "privatUzenetErkezett", targetPlayer)
  1219.                 triggerClientEvent(thePlayer, "enter", thePlayer)
  1220.             elseif targetRank > 0 then
  1221.                 if (adminduty) == 1 then
  1222.                     outputChatBox("#ff9000[PM - Tőled]#ffffff #ffffff" .. adminNameTarget .. " (#ffffff" .. targetID .. "):#ff9000 " .. message, thePlayer, 255, 255, 255, true)
  1223.                     outputChatBox("#ff9000[PM - Neked]#ffffff #ffffff" .. playerName .. " (#ffffff" .. playerID .. "):#ff9000 " .. message, targetPlayer, 255, 255, 255, true)
  1224.                
  1225.                     triggerClientEvent(thePlayer, "enter", thePlayer)
  1226.                     triggerClientEvent(targetPlayer, "privatUzenetErkezett", targetPlayer)
  1227.                 else
  1228.                     outputChatBox(exhiba .. "#ffffff" .. adminNameTarget .. "#ffffff nincs szolgálatban. Csak szolgálatban lévő adminra tudsz privát üzenetet írni.", thePlayer, 255, 255, 255, true)
  1229.                 end
  1230.             end
  1231.         elseif playerRank > 0 then
  1232.             if playerRank < 6 then
  1233.                 outputChatBox(exhiba .. "Nincs jogosultságod privát üzenetet írni. Használd a /vá parancsot! Hibakód: PMAD1", thePlayer, 255, 255, 255, true)
  1234.             else
  1235.                 if targetRank > 0 then
  1236.                     outputChatBox("#ff9000[PM - Tőled]#ffffff #ffffff" .. adminNameTarget .. " (#ffffff" .. targetID .. "):#ff9000 " .. message, thePlayer, 255, 255, 255, true)
  1237.                     outputChatBox("#ff9000[PM - Neked]#ffffff #ffffff" .. adminName .. " (#ffffff" .. playerID .. "):#ff9000 " .. message, targetPlayer, 255, 255, 255, true)
  1238.                 else
  1239.                     outputChatBox("#ff9000[PM - Tőled]#ffffff #ffffff" .. playerNameTarget .. " (#ffffff" .. targetID .. "):#ff9000 " .. message, thePlayer, 255, 255, 255, true)
  1240.                     outputChatBox("#ff9000[PM - Neked]#ffffff #ffffff" .. adminName .. " (#ffffff" .. playerID .. "):#ff9000 " .. message, targetPlayer, 255, 255, 255, true)
  1241.                 end
  1242.                
  1243.                 triggerClientEvent(thePlayer, "enter", thePlayer)
  1244.                 triggerClientEvent(targetPlayer, "privatUzenetErkezett", targetPlayer)
  1245.             end
  1246.         end
  1247.     end
  1248. end
  1249. addCommandHandler("pm", privateMessage, false, false)
  1250.  
  1251. function valasz(thePlayer, commandName, targetPlayer, ...)
  1252.     if getElementData(thePlayer, "acc:admin") >= 1 or getElementData(thePlayer, "acc:aseged") >= 1 then
  1253.    
  1254.         if not (targetPlayer) or not (...) then
  1255.             outputChatBox("#7cc576Használat: #ffffff/" .. commandName .. " [Név / ID] [Üzenet]", thePlayer, 255, 255, 255, true)
  1256.         else
  1257.        
  1258.             local targetPlayer, targetPlayerName = exports.mta_main:findPlayer(thePlayer, targetPlayer)
  1259.             local message = table.concat({...}, " ")
  1260.             local adminName = getPlayerAdminName(thePlayer)
  1261.            
  1262.             if (targetPlayer) then
  1263.            
  1264.                 if getElementData(thePlayer, "acc:admin") > 0 then
  1265.                     outputChatBox("#ff9000[Segítség]#ffffff " .. getPlayerAdminName(thePlayer) .. " (#ffffff" .. getElementData(thePlayer, "playerid") .. "#ffffff):#ffffff " .. message, targetPlayer, 255, 255, 255, true)
  1266.                     outputChatBox("#ff9000[Segítség => #ffffff" .. targetPlayerName:gsub("_", " ") .. " (#ffffff" .. getElementData(targetPlayer, "playerid") .. "#ffffff)#ff9000]:#ffffff " .. message, thePlayer, 255, 255, 255, true)
  1267.                    
  1268.                    
  1269.                     for k, v in ipairs(getElementsByType("player")) do
  1270.                         if tonumber(getElementData(v, "acc:admin") or 0) >= 1 and getElementData(v, "loggedin") then
  1271.                             if getElementData(v, "status:togva") == false then
  1272.                                 outputChatBox("#D64541[Segítségnyújtás] #7cc576"..getPlayerAdminName(thePlayer) .. "#ffffff válaszolt #7cc576" .. targetPlayerName:gsub("_", " ") .. "#ffffff játékosnak.", v, 255, 255, 255, true)
  1273.                                 outputChatBox("#D64541[Segítségnyújtás] #7cc576Szöveg: #ffffff" .. message, v, 255, 255, 255, true)
  1274.                             end
  1275.                         end
  1276.                     end
  1277.                    
  1278.                     triggerClientEvent(thePlayer, "enter", thePlayer)
  1279.                 elseif getElementData(thePlayer, "acc:aseged") > 0 then
  1280.                     outputChatBox("#ff9000[Segítség]#ffffff " .. getPlayerName(thePlayer):gsub("_", " ") .. " (#ffffff" .. getElementData(thePlayer, "playerid") .. "#ffffff):#ffffff " .. message, targetPlayer, 255, 255, 255, true)
  1281.                     outputChatBox("#ff9000[Segítség => " .. targetPlayerName:gsub("_", " ") .. " (#ffffff" .. getElementData(targetPlayer, "playerid") .. "#ffffff)#ff9000]:#ffffff " .. message, thePlayer, 255, 255, 255, true)
  1282.                    
  1283.                     for k, v in ipairs(getElementsByType("player")) do
  1284.                         if tonumber(getElementData(v, "acc:admin") or 0) >= 1 and getElementData(v, "loggedin") then
  1285.                             if not getElementData(v, "status:togva") then
  1286.                                 outputChatBox("#D64541[Segítségnyújtás] #7cc576"..getPlayerName(thePlayer):gsub("_"," ") .. "#ffffff válaszolt #7cc576" .. targetPlayerName:gsub("_", " ") .. "#ffffff játékosnak.", v, 255, 255, 255, true)
  1287.                                 outputChatBox("#D64541[Segítségnyújtás] #7cc576Szöveg: #ffffff" .. message, v, 255, 255, 255, true)
  1288.                             end
  1289.                         end
  1290.                     end
  1291.                    
  1292.                     triggerClientEvent(thePlayer, "enter", thePlayer)
  1293.                 end
  1294.             end
  1295.         end
  1296.     end
  1297. end
  1298. addCommandHandler("vá", valasz, false, false)
  1299.  
  1300. function togValaszolasok(thePlayer, commandName)
  1301.     if getElementData(thePlayer, "acc:admin") >= 1 then
  1302.    
  1303.         local allapot = getElementData(thePlayer, "status:togva")
  1304.        
  1305.         if allapot == false then
  1306.             outputChatBox("Kikapcsoltad a #7cc576/vá#ffffff parancs listázását.", thePlayer, 255, 255, 255, true)
  1307.             setElementData(thePlayer, "status:togva", 1)
  1308.         else
  1309.             outputChatBox("Bekapcsoltad a #7cc576/vá#ffffff parancs listázását.", thePlayer, 255, 255, 255, true)
  1310.             setElementData(thePlayer, "status:togva", false)
  1311.         end
  1312.     end
  1313. end
  1314. addCommandHandler("togvá", togValaszolasok, false, false)
  1315.  
  1316. -----------------------------[SET COLOR]---------------------------------
  1317. function setColor(player, commandName, r1, g1, b1, r2, g2, b2 )
  1318. if getElementData(player, "acc:admin") > 5 then
  1319.    
  1320.     if not (r1) or not (g1) or not (b1) then
  1321.         outputChatBox("#7cc576Használat: #ffffff/" .. commandName .. " [R] [G] [B]", player, 255, 255, 255, true)
  1322.     else
  1323.             local veh = getPedOccupiedVehicle(player)
  1324.                    
  1325.             if (veh) then
  1326.                     local r1, g1, b1, r2, g2, b2 = tonumber(r1), tonumber(g1), tonumber(b1), tonumber(r2), tonumber(g2), tonumber(b2)
  1327.                     local color = setVehicleColor(veh, r1, g1, b1, r2, g2, b2)
  1328.                     local sql = dbQuery(con, "UPDATE vehicle SET color=? WHERE id=?", toJSON({r1, g1, b1, r2, g2, b2}), getElementData(veh, "veh:id"))
  1329.                     dbFree(sql)
  1330.                    
  1331.                     if (color) or (sql) then
  1332.                         outputChatBox(exinfo .. "Sikeresen átszínezted a járművet.", player, 255, 255, 255, true)
  1333.                         outputAdminMessage(getPlayerAdminName(player) .. " átszínezett egy " .. getVehicleName(veh) .. " járművet. (ID: " .. getElementData(veh, "veh:id") .. ")")
  1334.                         -- id-t megadni
  1335.                     else
  1336.                         outputChatBox(exhiba .. "Nem sikerült átszínezni a járművet.", player, 255, 194, 14, true)
  1337.                     end
  1338.             end
  1339.         end
  1340.     end
  1341. end
  1342. addCommandHandler("setcolor", setColor, false, false)
  1343.  
  1344. ----------------------------------------------------------------------------------------------------------------------------------------
  1345. -- /goto, /gethere, /gotocar, /getcar, /fixveh, /fuelveh, /sethp, /setarmor, /sethunger, /setskin, /setdim, /setint, /setvehint, /setvehdim, /ajail, /unjail -- ADMINISZTRÁTORI PARANCSOK
  1346. ----------------------------------------------------------------------------------------------------------------------------------------
  1347.  
  1348. function gotoPlayer(thePlayer, commandName, targetPlayer)
  1349.     if getElementData(thePlayer, "acc:admin") >= 1 then
  1350.        
  1351.         if not (targetPlayer) then
  1352.             outputChatBox("#7cc576Használat:#ffffff /" .. commandName .. " [Név / ID]", thePlayer, 255, 255, 255, true)
  1353.         else
  1354.            
  1355.             local targetPlayer, targetPlayerName = exports.mta_main:findPlayer(thePlayer, targetPlayer)
  1356.             local x, y, z = getElementPosition(targetPlayer)
  1357.             local veh = getPedOccupiedVehicle(thePlayer)
  1358.            
  1359.             if not (targetPlayer) then outputChatBox(exhiba .. "Nincs ilyen játékos.", thePlayer, 255, 255, 255, true) return end
  1360.            
  1361.             if getElementData(targetPlayer, "loggedin") == true then
  1362.            
  1363.                 if isPedInVehicle(thePlayer) then
  1364.                     teleport = setElementPosition(veh, x, y+1, z)
  1365.                 else
  1366.                     teleport = setElementPosition(thePlayer, x, y+1, z)
  1367.                 end
  1368.                
  1369.                 if (teleport) then
  1370.                     setElementInterior(thePlayer, getElementInterior(targetPlayer))
  1371.                     setElementDimension(thePlayer, getElementDimension(targetPlayer))
  1372.                     outputChatBox("#ffffffSikeresen elteleportáltál #7cc576" .. targetPlayerName:gsub("_", " ") .. "#ffffff játékoshoz.", thePlayer, 255, 255, 255, true)
  1373.                     outputChatBox(" #7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff hozzád teleportált.", targetPlayer, 255, 255, 255, true)
  1374.                 else
  1375.                     outputChatBox(exhiba .. "Nem sikerült elteleportálni a játékoshoz. Hibakód: GOTO1", thePlayer, 255, 255, 255, true)
  1376.                 end
  1377.             else
  1378.                 outputChatBox(exhiba .. "A játékos nincs bejelentkezve.", thePlayer ,255, 255, 255, true)
  1379.             end
  1380.         end
  1381.     end
  1382. end
  1383. addCommandHandler("goto", gotoPlayer, false, false)
  1384.  
  1385. function SgotoPlayer(thePlayer, commandName, targetPlayer)
  1386.     if getElementData(thePlayer, "acc:admin") >= 1 then
  1387.        
  1388.         if not (targetPlayer) then
  1389.             outputChatBox("#7cc576Használat:#ffffff /" .. commandName .. " [Név / ID]", thePlayer, 255, 255, 255, true)
  1390.         else
  1391.            
  1392.             local targetPlayer, targetPlayerName = exports.mta_main:findPlayer(thePlayer, targetPlayer)
  1393.             local x, y, z = getElementPosition(targetPlayer)
  1394.             local veh = getPedOccupiedVehicle(thePlayer)
  1395.            
  1396.             if getElementData(targetPlayer, "loggedin") == true then
  1397.            
  1398.                 if isPedInVehicle(thePlayer) then
  1399.                     teleport = setElementPosition(veh, x, y+1, z)
  1400.                 else
  1401.                     teleport = setElementPosition(thePlayer, x, y+1, z)
  1402.                 end
  1403.                
  1404.                 if (teleport) then
  1405.                     setElementInterior(thePlayer, getElementInterior(targetPlayer))
  1406.                     setElementDimension(thePlayer, getElementDimension(targetPlayer))
  1407.                     outputChatBox("#ffffffSikeresen elteleportáltál #7cc576" .. targetPlayerName:gsub("_", " ") .. "#ffffff játékoshoz. #dc143c(Secret)", thePlayer, 255, 255, 255, true)
  1408.                     outputAdminMessage("#7cc576"..getPlayerAdminName(thePlayer) .. "#ffffff titokban elteleportált " .. targetPlayerName:gsub("_"," ") .. " játékoshoz.")
  1409.                     --outputChatBox(" #7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff hozzád teleportált.", targetPlayer, 255, 255, 255, true)
  1410.                 else
  1411.                     outputChatBox(exhiba .. "Nem sikerült elteleportálni a játékoshoz. Hibakód: SGOTO1", thePlayer, 255, 255, 255, true)
  1412.                 end
  1413.             else
  1414.                 outputChatBox(exhiba .. "A játékos nincs bejelentkezve.", thePlayer ,255, 255, 255, true)
  1415.             end
  1416.         end
  1417.     end
  1418. end
  1419. addCommandHandler("sgoto", SgotoPlayer, false, false)
  1420.  
  1421. function getPlayerHere(thePlayer, commandName, targetPlayer)
  1422.     if getElementData(thePlayer, "acc:admin") >=1 then
  1423.        
  1424.         if not (targetPlayer) then
  1425.             outputChatBox("#7cc576Használat: #ffffff/" .. commandName .. " [Név / ID]", thePlayer, 255, 255, 255, true)
  1426.         else
  1427.            
  1428.             local targetPlayer, targetPlayerName = exports.mta_main:findPlayer(thePlayer, targetPlayer)
  1429.             local x, y, z = getElementPosition(thePlayer)
  1430.            
  1431.             if getElementData(targetPlayer, "loggedin") == true then
  1432.            
  1433.                 if getElementData(targetPlayer, "adminjail") == 1 and getElementData(thePlayer, "acc:admin") < 6 then
  1434.                     outputChatBox(exhiba .. "A játékos adminjailban van. Nem tudod getelni.", thePlayer, 255, 255, 255, true)
  1435.                     return
  1436.                 end
  1437.                
  1438.                 if isPedInVehicle(targetPlayer) then
  1439.                     local veh = getPedOccupiedVehicle(targetPlayer)
  1440.                     teleport = setElementPosition(veh, x, y+1, z)
  1441.                 else
  1442.                     teleport = setElementPosition(targetPlayer, x, y+1, z)
  1443.                 end
  1444.            
  1445.                 if (teleport) then
  1446.                     setElementInterior(targetPlayer, getElementInterior(thePlayer))
  1447.                     setElementDimension(targetPlayer, getElementDimension(thePlayer))
  1448.                     outputChatBox("Sikeresen magadhoz teleportáltad #7cc576" .. targetPlayerName:gsub("_"," ") .. "#ffffff játékost.", thePlayer, 255, 255, 255, true)
  1449.                     outputChatBox(" #7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff magához teleportált téged.", targetPlayer, 255, 255, 255, true)
  1450.                 else
  1451.                     outputChatBox(exhiba .. "Nem sikerült magadhoz teleportálni a játékost. Hibakód: GETHERE1", thePlayer, 255, 255, 255, true)       
  1452.                 end
  1453.             else
  1454.                 outputChatBox(exhiba .. "A játékos nincs bejelentkezve.", thePlayer ,255, 255, 255, true)
  1455.             end
  1456.         end
  1457.     end
  1458. end
  1459. addCommandHandler("gethere", getPlayerHere, false, false)
  1460.  
  1461. function gotoCar(thePlayer, commandName, id)
  1462.     if getElementData(thePlayer, "acc:admin") >= 1 then
  1463.        
  1464.         if not (id) then
  1465.             outputChatBox("#7cc576Használat:#ffffff /" .. commandName .. " [Jármű ID]", thePlayer, 255, 255, 255, true)
  1466.         else
  1467.            
  1468.             local veh = findVehicle(id)
  1469.             local x, y, z = getElementPosition(veh)
  1470.            
  1471.             if not veh then
  1472.                 outputChatBox(exhiba .. "Hibás jármű ID.", thePlayer, 255, 255, 255, true)
  1473.                 return
  1474.             end
  1475.            
  1476.             local teleport = setElementPosition(thePlayer, x+2, y+2, z)
  1477.             local int = getElementInterior(veh)
  1478.             local dim = getElementDimension(veh)
  1479.             if getElementDimension(veh) >= 100000 then return end
  1480.            
  1481.             if (teleport) then
  1482.                 setElementInterior(thePlayer, int)
  1483.                 setElementDimension(thePlayer, dim)
  1484.                 outputChatBox("#ffffffSikeresen elteleportáltál a járműhöz. (ID: #7cc576" .. id .. "#ffffff)", thePlayer, 255, 255, 255, true)
  1485.             else
  1486.                 outputChatBox(exhiba .. "Nem sikerült elteleportálni a járműhöz. Hibakód: GOTOC1", thePlayer, 255, 255, 255, true)
  1487.             end
  1488.         end
  1489.     end
  1490. end
  1491. addCommandHandler("gotocar", gotoCar, false, false)
  1492.  
  1493. function getCar(thePlayer, commandName, id)
  1494.     if getElementData(thePlayer, "acc:admin") >= 1 then
  1495.        
  1496.         if not (id) then
  1497.             outputChatBox("#7cc576Használat:#ffffff /" .. commandName .. " [Jármű ID]", thePlayer, 255, 255, 255, true)
  1498.         else
  1499.            
  1500.             local veh = findVehicle(id)
  1501.            
  1502.             if not veh then
  1503.                 outputChatBox(exhiba .. "Hibás jármű ID.", thePlayer, 255, 255, 255, true)
  1504.                 return
  1505.             end
  1506.            
  1507.             local x, y, z = getElementPosition(thePlayer)
  1508.             local int = getElementInterior(thePlayer)
  1509.             local dim = getElementDimension(thePlayer)
  1510.             if getElementDimension(veh) >= 100000 then return end
  1511.             local teleport = setElementPosition(veh, x+2, y+2, z+1)
  1512.            
  1513.             if (teleport) then
  1514.                 setElementInterior(veh, int)
  1515.                 setElementDimension(veh, dim)
  1516.                 outputChatBox("#ffffffSikeresen magadhoz teleportáltad a járművet. (ID: #7cc576" .. id .. "#ffffff)", thePlayer, 255, 255, 255, true)
  1517.             else
  1518.                 outputChatBox(exhiba .. "Nem sikerült magadhoz teleportálni a járművet. Hibakód: GETCAR1", thePlayer, 255, 255, 255, true)
  1519.             end
  1520.         end
  1521.     end
  1522. end
  1523. addCommandHandler("getcar", getCar, false, false)
  1524.  
  1525. function fixPlayerVehicle(thePlayer, commandName, targetPlayer)
  1526.     if getElementData(thePlayer, "acc:admin") >=1 then
  1527.    
  1528.         if not (targetPlayer) then
  1529.             outputChatBox("#7cc576Használat: #ffffff/" .. commandName .. " [Név / ID]", thePlayer, 255, 255, 255, true)
  1530.         else       
  1531.             local targetPlayer, targetPlayerName = exports.mta_main:findPlayer(thePlayer, targetPlayer)
  1532.             local adminduty = getElementData(thePlayer, "char:adminduty")
  1533.             local alevel = getElementData(thePlayer, "acc:admin")
  1534.             local veh = getPedOccupiedVehicle(targetPlayer)
  1535.            
  1536.                 if not targetPlayer or not getElementData(targetPlayer, "loggedin") then return end
  1537.            
  1538.             if veh then
  1539.                 if (adminduty) == 0 then
  1540.                     if (alevel) >= 6 then
  1541.                         fixVehicle(veh)
  1542.                         triggerClientEvent(root, "setvehicleCompVisible", root, targetPlayer)
  1543.                         outputChatBox("#7cc576 " .. getPlayerAdminName(thePlayer) .. "#ffffff megjavította a járművedet. ", targetPlayer, 255, 255, 255, true)
  1544.                         outputChatBox("Sikeresen megjavítottad #7cc576" .. targetPlayerName:gsub("_", " ") .. "#ffffff járművét.", thePlayer, 255, 255, 255, true)
  1545.                         outputAdminMessage("#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff megjavította #7cc576" .. targetPlayerName:gsub("_"," ") .. "#ffffff járművét.")
  1546.                         --adminlog
  1547.                         dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, "acc:id"), "FIXVEH", "" .. getPlayerAdminName(thePlayer) .. " megjavította " .. targetPlayerName:gsub("_"," ") .. " járművét.", targetPlayerName, getElementData(targetPlayer, "acc:id"))
  1548.                     else
  1549.                         outputChatBox(exhiba .. "Nincs jogosultságod adminduty-n kívül megjavítani a járművet. Hibakód: FIXVEHAD1", thePlayer, 255, 255, 255, true)
  1550.                         --adminlog
  1551.                         dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, "acc:id"), "FIXVEHAD1", "" .. getPlayerAdminName(thePlayer) .. " megpróbálta megjavitani " .. targetPlayerName:gsub("_"," ") .. " járművét. [ACCES DENIED] [Hibakod: FIXVEHAD1]", targetPlayerName, getElementData(targetPlayer, "acc:id"))
  1552.                     end
  1553.                 else
  1554.                     triggerClientEvent(root, "setvehicleCompVisible", root, targetPlayer)
  1555.                     fixVehicle(veh)
  1556.                     outputChatBox("#7cc576 " .. getPlayerAdminName(thePlayer) .. "#ffffff megjavította a járművedet. ", targetPlayer, 255, 255, 255, true)
  1557.                     outputChatBox("Sikeresen megjavítottad #7cc576" .. targetPlayerName:gsub("_", " ") .. "#ffffff járművét.", thePlayer, 255, 255, 255, true)
  1558.                     outputAdminMessage("#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff megjavította #7cc576" .. targetPlayerName:gsub("_"," ") .. "#ffffff járművét.")
  1559.                     --adminlog
  1560.                     dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, "acc:id"), "FIXVEH", "" .. getPlayerAdminName(thePlayer) .. " megjavította " .. targetPlayerName:gsub("_"," ") .. " járművét.", targetPlayerName, getElementData(targetPlayer, "acc:id"))
  1561.                 end
  1562.             else
  1563.                 outputChatBox(exhiba .. "A játékos nincsen járműben.", thePlayer, 255, 255, 255, true)
  1564.             end
  1565.         end
  1566.     end
  1567. end
  1568. addCommandHandler("fixveh", fixPlayerVehicle, false, false)
  1569.  
  1570. function setVehicleHealth(thePlayer, commandName, targetPlayer, health)
  1571.     if getElementData(thePlayer, "acc:admin") >= 1 then
  1572.  
  1573.         if not (targetPlayer) or not (health) then
  1574.             outputChatBox("#7cc576Használat:#ffffff /" .. commandName .. " [Név / ID] [Szint]", thePlayer, 255, 255, 255, true)
  1575.         else
  1576.            
  1577.             local targetPlayer, targetPlayerName = exports.mta_main:findPlayer(thePlayer, targetPlayer)
  1578.             local health = tonumber(health)
  1579.             local veh = getPedOccupiedVehicle(targetPlayer)
  1580.            
  1581.             if not (targetPlayer) then outputChatBox(exhiba .. "Nincs ilyen játékos.", thePlayer, 255, 255, 255, true) return end
  1582.            
  1583.             if health < 0 or health > 1000 then
  1584.                 outputChatBox(exhiba .. "A szint csak 0 és 1000 között lehet.", thePlayer, 255, 255, 255, true)
  1585.                 return
  1586.             end
  1587.            
  1588.             if getElementData(thePlayer, "acc:admin") < 6 and getElementData(thePlayer, "char:adminduty") == 0 then
  1589.                 outputChatBox(exhiba .. "Nincs jogosultságod admindutyn kívül megváltoztatni egy játékos járművének az állapotát.", thePlayer, 255, 255, 255, true)
  1590.                 dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, "acc:id"), "SETCARHP1", "" .. getPlayerAdminName(thePlayer) .. " megpróbálta megváltoztatni " .. targetPlayerName:gsub("_"," ") .. " járművének az állapotát (" .. health .. "). [ACCES DENIED] [Hibakod: SETCHPAD]", targetPlayerName, getElementData(targetPlayer, "acc:id"))
  1591.                 return
  1592.             end
  1593.            
  1594.             if not (veh) then
  1595.                 outputChatBox(exhiba .. "A játékos nincs járműben.", thePlayer, 255, 255, 255, true)
  1596.             else
  1597.                 local sql = dbExec(con, "UPDATE vehicle SET hp='" .. health .. "' WHERE id='" .. getElementData(veh, "veh:id") .. "'")
  1598.                 if (sql) then
  1599.                     setElementHealth(veh, health)
  1600.                     outputChatBox("#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff megváltoztatta a járműved állapotát. (" .. health .. ")", targetPlayer, 255, 255, 255, true)
  1601.                     outputAdminMessage("#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff megváltoztatta #3399FF" .. targetPlayerName:gsub("_"," ") .. " #ffffffjárművének állapotát. #7cc576F(" .. health .. ")")
  1602.                     local adminlogsql = dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, "acc:id"), "SETCARHP", "" .. getPlayerAdminName(thePlayer) .. " megváltoztatta " .. targetPlayerName:gsub("_"," ") .. " járművének állapotát. (" .. health .. ")", targetPlayerName, getElementData(targetPlayer, "acc:id"))
  1603.                 else
  1604.                     outputChatBox(exhiba .. "Nem sikerült megváltoztatni a játékos járművének állapotát. Hibakód: SETCHP1", thePlayer, 255, 255, 255, true)
  1605.                 end
  1606.             end
  1607.         end
  1608.     end
  1609. end
  1610. addCommandHandler("setcarhp", setVehicleHealth, false, false)
  1611.  
  1612. function fuelPlayerVehicle(thePlayer, commandName, targetPlayer)
  1613.     if getElementData(thePlayer, "acc:admin") >=1 then
  1614.    
  1615.         if not (targetPlayer) then
  1616.             outputChatBox("#7cc586Használat: #ffffff/" .. commandName .. " [Név / ID]", thePlayer, 255, 255, 255, true)
  1617.         else
  1618.        
  1619.             local targetPlayer, targetPlayerName = exports.mta_main:findPlayer(thePlayer, targetPlayer)
  1620.             local adminduty = getElementData(thePlayer, "char:adminduty")
  1621.             local alevel = getElementData(thePlayer, "acc:admin")
  1622.             local veh = getPedOccupiedVehicle(targetPlayer)
  1623.            
  1624.                 if not getElementData(targetPlayer, "loggedin") then return end
  1625.                 if not (targetPlayer) then outputChatBox(exhiba .. "Nincs ilyen játékos.", thePlayer, 255, 255, 255, true) return end
  1626.            
  1627.             if isPedInVehicle(targetPlayer) then
  1628.            
  1629.                 if (adminduty) == 0 then
  1630.                     if (alevel) >= 6 then
  1631.                         setElementData(veh, "veh:fuel", 100)
  1632.                         outputChatBox("#7cc576 " .. getPlayerAdminName(thePlayer) .. "#ffffff megtankolta a járművedet. ", targetPlayer, 255, 255, 255, true)
  1633.                         outputChatBox("Sikeresen megtankoltad #7cc576" .. targetPlayerName:gsub("_", " ") .. "#ffffff járművét.", thePlayer, 255, 255, 255, true)
  1634.                         outputAdminMessage("#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff megtankolta #7cc576" .. targetPlayerName:gsub("_"," ") .. " #ffffffjárművét.")
  1635.                         --adminlog
  1636.                         dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, "acc:id"), "FUELVEH", "" .. getPlayerAdminName(thePlayer) .. " megtankolta " .. targetPlayerName:gsub("_"," ") .. " járművét.", targetPlayerName, getElementData(targetPlayer, "acc:id"))
  1637.                     else
  1638.                         outputChatBox(exhiba .. "Nincs jogosultságod adminduty-n kívül megtankolni a járművet. Hibakód: FUELVEHAD1", thePlayer, 255, 255, 255, true)
  1639.                         --adminlog
  1640.                         dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, "acc:id"), "FUELVEHAD1", "" .. getPlayerAdminName(thePlayer) .. " megpróbálta megtankolni " .. targetPlayerName:gsub("_"," ") .. " járművét. [ACCES DENIED] [Hibakod: FUELVEHAD1]", targetPlayerName, getElementData(targetPlayer, "acc:id"))
  1641.                     end
  1642.                 else
  1643.                     setElementData(veh, "veh:fuel", 100)
  1644.                     outputChatBox("#7cc576 " .. getPlayerAdminName(thePlayer) .. "#ffffff megtankolta a járművedet. ", targetPlayer, 255, 255, 255, true)
  1645.                     outputChatBox("Sikeresen megtankoltad #7cc576" .. targetPlayerName:gsub("_", " ") .. "#ffffff járművét.", thePlayer, 255, 255, 255, true)
  1646.                     outputAdminMessage("#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff megtankolta #7cc576" .. targetPlayerName:gsub("_"," ") .. "#ffffff járművét.")
  1647.                     --adminlog
  1648.                     dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, "acc:id"), "FUELVEH", "" .. getPlayerAdminName(thePlayer) .. " megtankolta " .. targetPlayerName:gsub("_"," ") .. " járművét.", targetPlayerName, getElementData(targetPlayer, "acc:id"))
  1649.                 end
  1650.                
  1651.             else
  1652.                 outputChatBox(exhiba .. "A játékos nincsen járműben.", thePlayer, 255, 255, 255, true)
  1653.             end
  1654.         end
  1655.     end
  1656. end
  1657. addCommandHandler("fuelveh", fuelPlayerVehicle, false, false)
  1658.  
  1659. function setPlayerHealth(thePlayer, commandName, targetPlayer, level)
  1660.     if getElementData(thePlayer, "acc:admin") >= 1 then
  1661.  
  1662.         if not (targetPlayer) or not (level) then
  1663.             outputChatBox("#7cc576Használat: #ffffff/" .. commandName .. " [Név / ID] [Életerő]", thePlayer, 255, 255, 255, true)
  1664.         else
  1665.            
  1666.             local targetPlayer, targetPlayerName = exports.mta_main:findPlayer(thePlayer, targetPlayer)
  1667.             local level = tonumber(level)
  1668.             if not (targetPlayer) then outputChatBox(exhiba .. "Nincs ilyen játékos.", thePlayer, 255, 255, 255, true) return end
  1669.            
  1670.            
  1671.             if (level) < 0 or (level) > 100 then
  1672.                 outputChatBox(exhiba .. "Az értékek 0 és 100 között vannak.", thePlayer, 255, 255, 255, true)
  1673.                 return false
  1674.             end
  1675.            
  1676.             local setHealth = setElementHealth(targetPlayer, level)
  1677.            
  1678.             if (setHealth) then
  1679.                 outputChatBox(exinfo .. "Sikeresen megváltoztattad #7cc576" .. targetPlayerName:gsub("_"," ") .. "#ffffff életerejét. (" .. level .. ")", thePlayer, 255, 255, 255, true)
  1680.                 outputAdminMessage("#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff megváltoztatta #7cc576" .. targetPlayerName:gsub("_"," ") .. " #fffffféleterejét. (" .. level .. ")")
  1681.                 dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, "acc:id"), "SETHP", "" .. getPlayerAdminName(thePlayer) .. " megváltoztatta " .. targetPlayerName:gsub("_"," ") .. " életerejét. (" .. level .. ")", targetPlayerName, getElementData(targetPlayer, "acc:id"))
  1682.             else
  1683.                 outputChatBox(exhiba .. "Nem sikerült megváltoztatni " .. targetPlayerName:gsub("_"," ") .. " életerejét. Hibakód: SHP1", thePlayer, 255, 255, 255, true)
  1684.             end
  1685.         end
  1686.     end
  1687. end
  1688. addCommandHandler("sethp", setPlayerHealth, false, false)
  1689.  
  1690. function setPlayerHealth1(thePlayer)   
  1691.  
  1692.         setElementHealth(thePlayer, 100)
  1693.         setPlayerArmor(thePlayer, 100)
  1694.  
  1695. end
  1696. addEvent("setPlayerHealth", true)
  1697. addEventHandler("setPlayerHealth", getRootElement(), setPlayerHealth1)
  1698.  
  1699. function setPlayerArmorLevel(thePlayer, commandName, targetPlayer, level)
  1700.     if getElementData(thePlayer, "acc:admin") >= 1 then
  1701.  
  1702.         if not (targetPlayer) or not (level) then
  1703.             outputChatBox("#7cc576Használat: #ffffff/" .. commandName .. " [Név / ID] [armor szint]", thePlayer, 255, 255, 255, true)
  1704.         else
  1705.            
  1706.             local targetPlayer, targetPlayerName = exports.mta_main:findPlayer(thePlayer, targetPlayer)
  1707.             local level = tonumber(level)  
  1708.             if not (targetPlayer) then outputChatBox(exhiba .. "Nincs ilyen játékos.", thePlayer, 255, 255, 255, true) return end        
  1709.            
  1710.            
  1711.             if (level) > 100 then
  1712.                 outputChatBox(exhiba .. "Az értékek 0 és 100 között vannak.", thePlayer, 255, 255, 255, true)
  1713.                 return false
  1714.             end
  1715.            
  1716.             local setArmor = setPlayerArmor(targetPlayer, level)
  1717.            
  1718.             if (setArmor) then
  1719.                 outputChatBox(exinfo .. "Sikeresen megváltoztattad #7cc576" .. targetPlayerName:gsub("_"," ") .. "#ffffff páncél szintjét. (" .. level .. ")", thePlayer, 255, 255, 255, true)
  1720.                 outputAdminMessage("#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff megváltoztatta #7cc576" .. targetPlayerName:gsub("_"," ") .. "#ffffff páncél szintjét. (" .. level .. ")")
  1721.                 dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, "acc:id"), "SETARMOR", "" .. getPlayerAdminName(thePlayer) .. " megváltoztatta " .. targetPlayerName:gsub("_"," ") .. " páncél szintjét. (" .. level .. ")", targetPlayerName, getElementData(targetPlayer, "acc:id"))
  1722.             else
  1723.                 outputChatBox(exhiba .. "Nem sikerült megváltoztatni " .. targetPlayerName:gsub("_"," ") .. " páncél szintjét. Hibakód: SARMOR1", thePlayer, 255, 255, 255, true)
  1724.             end
  1725.         end
  1726.     end
  1727. end
  1728. addCommandHandler("setarmor", setPlayerArmorLevel, false, false)
  1729.  
  1730. function setPlayerHungerLevel(thePlayer, commandName, targetPlayer, level)
  1731.     if getElementData(thePlayer, "acc:admin") >= 1 then
  1732.  
  1733.         if not (targetPlayer) or not (level) then
  1734.             outputChatBox("#7cc576Használat: #ffffff/" .. commandName .. " [Név / ID] [Éhségszint]", thePlayer, 255, 255, 255, true)
  1735.         else
  1736.            
  1737.             local targetPlayer, targetPlayerName = exports.mta_main:findPlayer(thePlayer, targetPlayer)
  1738.             local level = tonumber(level)
  1739.             if not (targetPlayer) then outputChatBox(exhiba .. "Nincs ilyen játékos.", thePlayer, 255, 255, 255, true) return end        
  1740.            
  1741.            
  1742.             if (level) > 100 then
  1743.                 outputChatBox(exhiba .. "Az értékek 0 és 100 között vannak.", thePlayer, 255, 255, 255, true)
  1744.                 return false
  1745.             end
  1746.            
  1747.             local setHunger = setElementData(targetPlayer, "char:hunger", level)
  1748.            
  1749.             if (setHunger) then
  1750.                 outputChatBox(exinfo .. "Sikeresen megváltoztattad #7cc576" .. targetPlayerName:gsub("_"," ") .. "#ffffff éhségszintjét. (" .. level .. ")", thePlayer, 255, 255, 255, true)
  1751.                 outputAdminMessage("#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff megváltoztatta #7cc576" .. targetPlayerName:gsub("_"," ") .. "#ffffff éhségszintjét. (" .. level .. ")")
  1752.                 dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, "acc:id"), "SETHUNGER", "" .. getPlayerAdminName(thePlayer) .. " megváltoztatta " .. targetPlayerName:gsub("_"," ") .. " éhség szintjét. (" .. level .. ")", targetPlayerName, getElementData(targetPlayer, "acc:id"))
  1753.             else
  1754.                 outputChatBox(exhiba .. "Nem sikerült megváltoztatni " .. targetPlayerName:gsub("_"," ") .. " éhségszintjét. Hibakód: SHUNGER1", thePlayer, 255, 255, 255, true)
  1755.             end
  1756.         end
  1757.     end
  1758. end
  1759. addCommandHandler("sethunger", setPlayerHungerLevel, false, false)
  1760.  
  1761. function setName(thePlayer, commandName, targetPlayer, ...)
  1762.     if getElementData(thePlayer, "acc:admin") >= 3 then
  1763.    
  1764.         if not (targetPlayer) or not (...) then
  1765.             outputChatBox("#7cc576Használat: #ffffff/" .. commandName .. " [Név / ID] [Új_nev]", thePlayer, 255, 255, 255, true)
  1766.         else
  1767.            
  1768.             local targetPlayer, targetPlayerName = exports.mta_main:findPlayer(thePlayer, targetPlayer)
  1769.             local newName = table.concat({...}, "_")
  1770.             if not (targetPlayer) then outputChatBox(exhiba .. "Nincs ilyen játékos.", thePlayer, 255, 255, 255, true) return end
  1771.            
  1772.             if not getElementData(targetPlayer, "loggedin") then return end
  1773.            
  1774.             local qh = dbQuery(con, "SELECT * FROM characters WHERE charname='" .. newName:gsub("_", " ") .. "'")
  1775.             local result, num = dbPoll(qh, -1)
  1776.             if num>0 then
  1777.                 outputChatBox(exhiba .. "Ez a név már használatban van.", thePlayer, 255, 255, 255, true)
  1778.                 return
  1779.             end
  1780.            
  1781.             local sql = dbExec(con, "UPDATE characters SET charname='" .. newName:gsub("_"," ") .. "' WHERE id='" .. getElementData(targetPlayer, "char:id") .. "'")
  1782.            
  1783.            
  1784.             if (sql) then
  1785.                 outputChatBox(exinfo .. "Sikeresen megváltoztattad " .. targetPlayerName:gsub("_"," ") .. " nevét. (" .. newName .. ")", thePlayer, 255, 255, 255, true)
  1786.                 outputAdminMessage("#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff megváltoztatta " .. targetPlayerName:gsub("_"," ") .. " nevét. (" .. newName .. ")")
  1787.                 dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, "acc:id"), "SETNAME", "" .. getPlayerAdminName(thePlayer) .. " megváltoztatta " .. targetPlayerName:gsub("_"," ") .. " nevét. (" .. newName .. ")", targetPlayerName, getElementData(targetPlayer, "acc:id"))
  1788.                 setPlayerName(targetPlayer, newName)
  1789.                 local newNameS = newName:gsub("_"," ")
  1790.                 setElementData(targetPlayer, "char:charname", newName)
  1791.                 setElementData(targetPlayer, "char:name", newNameS)
  1792.                 setElementData(targetPlayer, "char:oldName", newName)
  1793.             else
  1794.            
  1795.             end
  1796.         end
  1797.     end
  1798. end
  1799. addCommandHandler("setname", setName, false, false)
  1800.  
  1801. function setPlayerSkin(thePlayer, commandName, targetPlayer, skin)
  1802.     if getElementData(thePlayer, "acc:admin") >= 1 then
  1803.        
  1804.         if not (targetPlayer) or not (skin) then
  1805.             outputChatBox("#7cc576Használat:#ffffff /" .. commandName .. " [Név / ID] [Skin ID]", thePlayer, 255, 255, 255, true)
  1806.         else
  1807.        
  1808.             local targetPlayer, targetPlayerName = exports.mta_main:findPlayer(thePlayer, targetPlayer)
  1809.             local skin = tonumber(skin)
  1810.             if not (targetPlayer) then outputChatBox(exhiba .. "Nincs ilyen játékos.", thePlayer, 255, 255, 255, true) return end
  1811.            
  1812.             if getElementModel(targetPlayer) == skin then
  1813.                 outputChatBox(exhiba .. "A játékoson már ez a skin van.", thePlayer, 255, 255, 255, true)
  1814.                 return
  1815.             end
  1816.            
  1817.             if setElementModel(targetPlayer, skin) then
  1818.                 outputChatBox("Sikeresen megváltoztattad #7cc576" .. targetPlayerName:gsub("_"," ") .. "#ffffff skinjét.", thePlayer, 255, 255, 255, true)
  1819.                 outputAdminMessage("#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff megváltoztatta #7cc576" .. targetPlayerName:gsub("_"," ") .. " #ffffffskinjét.#ffffff (" .. skin .. ")")
  1820.                 dbExec(con, "UPDATE characters SET skin = ? WHERE ID = ?",skin,getElementData(targetPlayer, "acc:id"))
  1821.                 dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, "acc:id"), "SETSKIN", "" .. getPlayerAdminName(thePlayer) .. " megvaltoztatta " .. targetPlayerName:gsub("_"," ") .. " skinjet. (" .. skin .. ")", targetPlayerName, getElementData(targetPlayer, "acc:id"))
  1822.             else
  1823.                 outputChatBox(exhiba .. "Nem sikerült megváltoztatni #7cc576" .. targetPlayerName:gsub("_"," ") .. "#ffffff skinjét. Hibakód: SSKIN1", thePlayer, 255, 255, 255, true)
  1824.             end
  1825.         end
  1826.     end
  1827. end
  1828. addCommandHandler("setskin", setPlayerSkin, false, false)
  1829.  
  1830. --[[local factions = {
  1831.     [7]="Rendőrség",
  1832.     [8]="Mentőszolgálat",
  1833.     [9]="Sheriffség",
  1834.     [10]="SWAT",
  1835.     [11]="Szerelőtársaság",
  1836.     [12]="FBI",
  1837.     [13]="Taxi",
  1838.     [14]="Yakuza",
  1839.     [15]="Speed Fighters Team",
  1840.     [16]="Los Santos Piru Bloods",
  1841.     [17]="Mara Salvatrucha XIII",
  1842.     [18]="Torosyan Group",
  1843.     [19]="Dean Nigga'Z",
  1844. }
  1845.  
  1846. local factionSkins = {
  1847.     --skin id, frakció id
  1848.     {274, 8},
  1849. }
  1850.  
  1851. function checkSkin(player)
  1852.     for index, value in ipairs(factionSkins) do
  1853.        
  1854.    
  1855.  
  1856.     end
  1857. end]]
  1858.  
  1859. function setDim(thePlayer, commandName, targetPlayer, value)
  1860.     if getElementData(thePlayer, "acc:admin") >=1 then
  1861.    
  1862.         if not (targetPlayer) or not (value) then
  1863.             outputChatBox("#7cc576Használat:#ffffff /" .. commandName .. " [Név / ID] [Dimension ID]", thePlayer, 255, 255, 255, true)
  1864.         else
  1865.        
  1866.             local targetPlayer, targetPlayerName = exports.mta_main:findPlayer(thePlayer, targetPlayer)
  1867.             local dim = tonumber(value)
  1868.             if not (targetPlayer) then outputChatBox(exhiba .. "Nincs ilyen játékos.", thePlayer, 255, 255, 255, true) return end
  1869.        
  1870.             if setElementDimension(targetPlayer, dim) then
  1871.                 outputChatBox(exinfo .. "Sikeresen megváltoztattad " .. targetPlayerName:gsub("_"," ") .. " dimenzióját. (" .. dim .. ")", thePlayer, 255, 255, 255, true)
  1872.                 outputChatBox(" #7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff megváltoztatta a dimenziódat. (" .. dim .. ")", targetPlayer, 255, 255, 255, true)
  1873.             end
  1874.         end
  1875.     end
  1876. end
  1877. addCommandHandler("setdim", setDim, false, false)
  1878.  
  1879. function setInt(thePlayer, commandName, targetPlayer, value)
  1880.     if getElementData(thePlayer, "acc:admin") >=1 then
  1881.    
  1882.         if not (targetPlayer) or not (value) then
  1883.             outputChatBox("#7cc576Használat:#ffffff /" .. commandName .. " [Név / ID] [Dimension ID]", thePlayer, 255, 255, 255, true)
  1884.         else
  1885.        
  1886.             local targetPlayer, targetPlayerName = exports.mta_main:findPlayer(thePlayer, targetPlayer)
  1887.             local value = tonumber(value)
  1888.             if not (targetPlayer) then outputChatBox(exhiba .. "Nincs ilyen játékos.", thePlayer, 255, 255, 255, true) return end
  1889.        
  1890.             if setElementInterior(targetPlayer, value) then
  1891.                 outputChatBox(exinfo .. "Sikeresen megváltoztattad " .. targetPlayerName:gsub("_"," ") .. " interiorját. (" .. value .. ")", thePlayer, 255, 255, 255, true)
  1892.                 outputChatBox(" #7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff megváltoztatta a interiorodat. (" .. value .. ")", targetPlayer, 255, 255, 255, true)
  1893.             end
  1894.         end
  1895.     end
  1896. end
  1897. addCommandHandler("setint", setInt, false, false)
  1898.  
  1899. function setVehDim(thePlayer, commandName, id, value)
  1900.     if getElementData(thePlayer, "acc:admin") >=1 then
  1901.    
  1902.         if not (id) or not (value) then
  1903.             outputChatBox("#7cc576Használat:#ffffff /" .. commandName .. " [ID] [Dimension ID]", thePlayer, 255, 255, 255, true)
  1904.         else
  1905.        
  1906.             local veh = findVehicle(id)
  1907.             local dim = tonumber(value)
  1908.        
  1909.             if setElementDimension(veh, dim) then
  1910.                 outputChatBox(exinfo .. "Sikeresen megváltoztattad " .. id .. " dimenzióját. (" .. dim .. ")", thePlayer, 255, 255, 255, true)
  1911.             --  outputChatBox(" #7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff megváltoztatta a dimenziódat. (" .. dim .. ")", targetPlayer, 255, 255, 255, true)
  1912.             end
  1913.         end
  1914.     end
  1915. end
  1916. addCommandHandler("setvehdim", setVehDim, false, false)
  1917.  
  1918. function setVehInt(thePlayer, commandName, id, value)
  1919.     if getElementData(thePlayer, "acc:admin") >=1 then
  1920.    
  1921.         if not (id) or not (value) then
  1922.             outputChatBox("#7cc576Használat:#ffffff /" .. commandName .. " [ID] [Dimension ID]", thePlayer, 255, 255, 255, true)
  1923.         else
  1924.        
  1925.             local veh = findVehicle(id)
  1926.             local dim = tonumber(value)
  1927.        
  1928.             if setElementInterior(veh, dim) then
  1929.                 outputChatBox(exinfo .. "Sikeresen megváltoztattad " .. id .. " interiorját. (" .. dim .. ")", thePlayer, 255, 255, 255, true)
  1930.             --  outputChatBox(" #7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff megváltoztatta a dimenziódat. (" .. dim .. ")", targetPlayer, 255, 255, 255, true)
  1931.             end
  1932.         end
  1933.     end
  1934. end
  1935. addCommandHandler("setvehint", setVehInt, false, false)
  1936.  
  1937. function setVehInt(thePlayer, commandName, targetPlayer, value)
  1938.     if getElementData(thePlayer, "acc:admin") >=1 then
  1939.    
  1940.         if not (targetPlayer) or not (value) then
  1941.             outputChatBox("#7cc576Használat:#ffffff /" .. commandName .. " [Név / ID] [Dimension ID]", thePlayer, 255, 255, 255, true)
  1942.         else
  1943.        
  1944.             local targetPlayer, targetPlayerName = exports.mta_main:findPlayer(thePlayer, targetPlayer)
  1945.             local value = tonumber(value)
  1946.        
  1947.             if setElementInterior(targetPlayer, value) then
  1948.                 outputChatBox(exinfo .. "Sikeresen megváltoztattad " .. targetPlayerName:gsub("_"," ") .. " interiorját. (" .. value .. ")", thePlayer, 255, 255, 255, true)
  1949.                 outputChatBox(" #7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff megváltoztatta a interiorodat. (" .. value .. ")", targetPlayer, 255, 255, 255, true)
  1950.             end
  1951.         end
  1952.     end
  1953. end
  1954. addCommandHandler("setvehint", setInt, false, false)
  1955.  
  1956. function adminJail(thePlayer, commandName, targetPlayer, ido, ...)
  1957.     if getElementData(thePlayer, "acc:admin") >= 1 then
  1958.    
  1959.         if not (targetPlayer) or not (ido) or not (...) then
  1960.             outputChatBox("#7cc576Használat: #ffffff/" .. commandName .. " [Név / ID] [Perc] [Indok]", thePlayer, 255, 255, 255, true)
  1961.         else
  1962.            
  1963.             local targetPlayer, targetPlayerName = exports.mta_main:findPlayer(thePlayer, targetPlayer)
  1964.             local ido = tonumber(ido)
  1965.             local reason = table.concat({...}, " ")
  1966.            
  1967.                 if not (targetPlayer) then outputChatBox(exhiba .. "Nincs ilyen játékos.", thePlayer, 255, 255, 255, true) return end
  1968.                 if not getElementData(targetPlayer, "loggedin") then return end
  1969.            
  1970.             if (ido) <= 0 then
  1971.                 outputChatBox(exhiba .. "A percek 0 alatt nem adhatóak vannak.", thePlayer ,255, 255, 255, true)
  1972.                 return
  1973.             elseif (ido) > 120 and getElementData(thePlayer, "acc:admin") < 2 then
  1974.                 outputChatBox(exhiba .. "Nincs jogosultságod 120 percet meghaladó adminjailt osztani.", thePlayer, 255, 255, 255, true)
  1975.                 return
  1976.             elseif (ido) > 300 and getElementData(thePlayer, "acc:admin") < 3 then
  1977.                 outputChatBox(exhiba .. "Nincs jogosultságod 300 percet meghaladó adminjailt osztani.", thePlayer, 255, 255, 255, true)
  1978.                 return
  1979.             elseif (ido) > 400 and getElementData(thePlayer, "acc:admin") < 4 then
  1980.                 outputChatBox(exhiba .. "Nincs jogosultságod 400 percet meghaladó adminjailt osztani.", thePlayer, 255, 255, 255, true)
  1981.                 return
  1982.             elseif (ido) > 500 and getElementData(thePlayer, "acc:admin") < 5 then
  1983.                 outputChatBox(exhiba .. "Nincs jogosultságod 500 percet meghaladó adminjailt osztani.", thePlayer, 255, 255, 255, true)
  1984.                 return         
  1985.             elseif (ido) > 600 and getElementData(thePlayer, "acc:admin") < 6 then
  1986.                 outputChatBox(exhiba .. "Nincs jogosultságod 600 percet meghaladó adminjailt osztani.", thePlayer, 255, 255, 255, true)
  1987.                 return
  1988.             end
  1989.            
  1990.             if not (targetPlayer) then
  1991.                 return
  1992.             end
  1993.            
  1994.             --közbe
  1995.                 if getElementData(targetPlayer, "adminjail") == 1 then
  1996.                     outputChatBox(exhiba .. "A játékos már adminjailben van.", thePlayer, 255, 255, 255, true)
  1997.                     outputChatBox("Ha frissíteni szeretnéd a büntetést, először vedd ki a #7cc576/unjail#ffffff paranccsal, majd próbálkozz újra.", thePlayer, 255, 255, 255, true)
  1998.                     return
  1999.                 end
  2000.            
  2001.                 outputChatBox("#dc143c[AdminJail]:#7cc576 " .. getPlayerAdminName(thePlayer) .. "#ffffff bebörtönözte #7cc576" .. targetPlayerName:gsub("_"," ") .. "#ffffff játékost #1a75ff" .. ido .. "#ffffff percre.", root ,255, 255, 255, true)
  2002.                 outputChatBox("#dc143c[AdminJail]:#7cc576 Indok:#ffffff " .. reason, root ,255, 255, 255, true)
  2003.                 --outputChatBox("#ffffffA hátralévő bünetetésed lekérdezéséhez használd a #7cc576/börtönidő#ffffff parancsot.", targetPlayer, 255, 255, 255, true)
  2004.  
  2005.                 local theTimerCheck = getElementData(targetPlayer, "adminjail:theTimer")
  2006.                 local theTimerCheck2 = getElementData(targetPlayer, "adminjail:theTimerAccounts")
  2007.                
  2008.                 if isTimer(theTimerCheck) then
  2009.                     killTimer(theTimerCheck)
  2010.                 end
  2011.                
  2012.                 if isTimer(theTimerCheck2) then
  2013.                     killTimer(theTimerCheck2)
  2014.                 end
  2015.                
  2016.                 if isPedInVehicle(targetPlayer) then
  2017.                     removePedFromVehicle(targetPlayer)
  2018.                 end
  2019.                
  2020.                 fadeCamera(targetPlayer, false, 1.0)
  2021.                 showChat(targetPlayer, false)
  2022.                 setElementFrozen(targetPlayer, true)
  2023.                 if isPedInVehicle(targetPlayer) then
  2024.                     toggleAllControls(targetPlayer, false, false, false)
  2025.                 end
  2026.                
  2027.                 setTimer(function()
  2028.                     triggerClientEvent(targetPlayer, "triggerAdminjail", targetPlayer, thePlayer, reason, ido, 1, false)
  2029.                 end, 500, 1)
  2030.                
  2031.                 setTimer( function()
  2032.                     local idoTelik = setTimer(idoTelikLe, 60000, ido, targetPlayer)
  2033.                     local theTimer = setElementData(targetPlayer, "adminjail:theTimer", idoTelik)
  2034.                     local idoTelikMentes = setElementData(targetPlayer, "idoTelik", ido)
  2035.                     local idoLetelt = setElementData(targetPlayer, "idoLetelt", 0)
  2036.                     local setPosition = setElementPosition(targetPlayer, 198.0009765625, 175.1279296875, 1003.0234375)
  2037.                     local setInterior = setElementInterior(targetPlayer, 3)
  2038.                     local setDimension = setElementDimension(targetPlayer, 132+getElementData(targetPlayer, "acc:id"))
  2039.                    
  2040.                     local adminjailed = setElementData(targetPlayer, "adminjail", 1)
  2041.                     local adminjail_reason = setElementData(targetPlayer, "adminjail:reason", reason)
  2042.                     local alapido = setElementData(targetPlayer, "adminjail:ido", ido)
  2043.                     local admin = setElementData(targetPlayer, "adminjail:admin", getPlayerAdminName(thePlayer))
  2044.                     local adminSerial = setElementData(targetPlayer, "adminjail:adminSerial", getPlayerSerial(thePlayer))
  2045.                 end, 1500, 1)
  2046.                                
  2047.                 setTimer(function()
  2048.                     fadeCamera(targetPlayer, true, 2.5)
  2049.                     setElementFrozen(targetPlayer, false)
  2050.                     toggleAllControls(targetPlayer, true, true, true)
  2051.                     showChat(targetPlayer, true)
  2052.                 end, 7500, 1)
  2053.            
  2054.                 local sql = dbExec(con, "UPDATE characters SET adminjail = ?, adminjail_reason = ?, adminjail_idoTelik = ?, adminjail_alapIdo = ?, adminjail_admin = ?, adminjail_adminSerial = ? WHERE id = '" .. getElementData(targetPlayer, "char:id") .. "'", 1, reason, ido, ido, getPlayerAdminName(thePlayer), getPlayerSerial(thePlayer))
  2055.                 local ajailMentes = dbExec(con, "INSERT INTO adminjails SET jailed_player = ?, jailed_playerSerial = ?, jailed_accountID = ?, jailed_admin = ?, jailed_adminSerial = ?, jailed_reason = ?, jailed_ido = ?, jailed_idopont=CURDATE(), jailed_idopontora=CURTIME()", targetPlayerName:gsub("_"," "), getPlayerSerial(targetPlayer), getElementData(targetPlayer, "acc:id"),getPlayerAdminName(thePlayer), getPlayerSerial(thePlayer), reason, ido)
  2056.                 local adminlogSql = dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, "acc:id"), "AJAIL", getPlayerAdminName(thePlayer) .. " bebortonozte " .. targetPlayerName .. " jatekost " .. ido .. " percre. Indok:" .. reason .. "", targetPlayerName, getPlayerSerial(targetPlayer))
  2057.             --sql
  2058.            
  2059.        
  2060.         end
  2061.     end
  2062. end
  2063. addCommandHandler("ajail", adminJail, false, false)
  2064.  
  2065. function guardadminJail(thePlayer, commandName, targetPlayer, ido, ...)
  2066.     if tonumber(getElementData(thePlayer, "acc:guard") or 0) >= 1 then
  2067.    
  2068.         if not (targetPlayer) or not (ido) or not (...) then
  2069.             outputChatBox("#7cc576Használat: #ffffff/" .. commandName .. " [Név / ID] [Perc] [Indok]", thePlayer, 255, 255, 255, true)
  2070.         else
  2071.            
  2072.             local targetPlayer, targetPlayerName = exports.mta_main:findPlayer(thePlayer, targetPlayer)
  2073.             local ido = tonumber(ido)
  2074.             local reason = table.concat({...}, " ")
  2075.             if not (targetPlayer) then outputChatBox(exhiba .. "Nincs ilyen játékos.", thePlayer, 255, 255, 255, true) return end
  2076.            
  2077.                 if not getElementData(targetPlayer, "loggedin") then return end
  2078.            
  2079.             if (ido) <= 0 then
  2080.                 outputChatBox(exhiba .. "A percek 0 alatt nem adhatóak vannak.", thePlayer ,255, 255, 255, true)
  2081.                 return
  2082.             elseif (ido) > 60 and getElementData(thePlayer, "acc:guard") < 2 then
  2083.                 outputChatBox(exhiba .. "Nincs jogosultságod 60 percet meghaladó adminjailt osztani.", thePlayer, 255, 255, 255, true)
  2084.                 return
  2085.             elseif (ido) > 250 and getElementData(thePlayer, "acc:admin") < 3 then
  2086.                 outputChatBox(exhiba .. "Nincs jogosultságod 250 percet meghaladó adminjailt osztani.", thePlayer, 255, 255, 255, true)
  2087.                 return
  2088.             elseif (ido) > 500 and getElementData(thePlayer, "acc:admin") < 4 then
  2089.                 outputChatBox(exhiba .. "Nincs jogosultságod 500 percet meghaladó adminjailt osztani.", thePlayer, 255, 255, 255, true)
  2090.                 return
  2091.             end
  2092.            
  2093.             if not (targetPlayer) then
  2094.                 return
  2095.             end
  2096.            
  2097.             --közbe
  2098.                 if getElementData(targetPlayer, "adminjail") == 1 then
  2099.                     outputChatBox(exhiba .. "A játékos már adminjailben van.", thePlayer, 255, 255, 255, true)
  2100.                     outputChatBox("Ha frissíteni szeretnéd a büntetést, először vedd ki a #7cc576/unjail#ffffff paranccsal, majd próbálkozz újra.", thePlayer, 255, 255, 255, true)
  2101.                     return
  2102.                 end
  2103.            
  2104.                 for k, v in ipairs(getElementsByType("player")) do
  2105.                     if tonumber(getElementData(v, "acc:admin") or 0) >= 7 and getElementData(v, "loggedin") then
  2106.                         outputChatBox("#dc143c[AdminJail]:#7cc576 " .. getPlayerName(thePlayer) .. " [Őr]#ffffff bebörtönözte #7cc576" .. targetPlayerName:gsub("_"," ") .. "#ffffff játékost #1a75ff" .. ido .. "#ffffff percre.", v ,255, 255, 255, true)
  2107.                         outputChatBox("#dc143c[AdminJail]:#7cc576 Indok:#ffffff " .. reason, v ,255, 255, 255, true)
  2108.                     else
  2109.                         outputChatBox("#dc143c[AdminJail]:#7cc576 Egy RP Őr#ffffff bebörtönözte #7cc576" .. targetPlayerName:gsub("_"," ") .. "#ffffff játékost #1a75ff" .. ido .. "#ffffff percre.", v ,255, 255, 255, true)
  2110.                         outputChatBox("#dc143c[AdminJail]:#7cc576 Indok:#ffffff " .. reason, v ,255, 255, 255, true)
  2111.                     end
  2112.                 end
  2113.                 --outputChatBox("#ffffffA hátralévő bünetetésed lekérdezéséhez használd a #7cc576/börtönidő#ffffff parancsot.", targetPlayer, 255, 255, 255, true)
  2114.  
  2115.                 local theTimerCheck = getElementData(targetPlayer, "adminjail:theTimer")
  2116.                 local theTimerCheck2 = getElementData(targetPlayer, "adminjail:theTimerAccounts")
  2117.                
  2118.                 if isTimer(theTimerCheck) then
  2119.                     killTimer(theTimerCheck)
  2120.                 end
  2121.                
  2122.                 if isTimer(theTimerCheck2) then
  2123.                     killTimer(theTimerCheck2)
  2124.                 end
  2125.                
  2126.                 if isPedInVehicle(targetPlayer) then
  2127.                     removePedFromVehicle(targetPlayer)
  2128.                 end
  2129.                
  2130.                 fadeCamera(targetPlayer, false, 1.0)
  2131.                 showChat(targetPlayer, false)
  2132.                 setElementFrozen(targetPlayer, true)
  2133.                 if isPedInVehicle(targetPlayer) then
  2134.                     toggleAllControls(targetPlayer, false, false, false)
  2135.                 end
  2136.                
  2137.                 setTimer(function()
  2138.                     triggerClientEvent(targetPlayer, "triggerAdminjail", targetPlayer, "Egy RP Őr", reason, ido, 3, false)
  2139.                 end, 500, 1)
  2140.                
  2141.                 setTimer( function()
  2142.                     local idoTelik = setTimer(idoTelikLe, 60000, ido, targetPlayer)
  2143.                     local theTimer = setElementData(targetPlayer, "adminjail:theTimer", idoTelik)
  2144.                     local idoTelikMentes = setElementData(targetPlayer, "idoTelik", ido)
  2145.                     local idoLetelt = setElementData(targetPlayer, "idoLetelt", 0)
  2146.                     local setPosition = setElementPosition(targetPlayer, 198.0009765625, 175.1279296875, 1003.0234375)
  2147.                     local setInterior = setElementInterior(targetPlayer, 3)
  2148.                     local setDimension = setElementDimension(targetPlayer, 132+getElementData(targetPlayer, "acc:id"))
  2149.                    
  2150.                     local adminjailed = setElementData(targetPlayer, "adminjail", 1)
  2151.                     local adminjail_reason = setElementData(targetPlayer, "adminjail:reason", reason)
  2152.                     local alapido = setElementData(targetPlayer, "adminjail:ido", ido)
  2153.                     local admin = setElementData(targetPlayer, "adminjail:admin", "Egy RP Őr")
  2154.                     local adminSerial = setElementData(targetPlayer, "adminjail:adminSerial", getPlayerSerial(thePlayer))
  2155.                 end, 1500, 1)
  2156.                                
  2157.                 setTimer(function()
  2158.                     fadeCamera(targetPlayer, true, 2.5)
  2159.                     setElementFrozen(targetPlayer, false)
  2160.                     toggleAllControls(targetPlayer, true, true, true)
  2161.                     showChat(targetPlayer, true)
  2162.                 end, 7500, 1)
  2163.            
  2164.                 local sql = dbExec(con, "UPDATE characters SET adminjail = ?, adminjail_reason = ?, adminjail_idoTelik = ?, adminjail_alapIdo = ?, adminjail_admin = ?, adminjail_adminSerial = ? WHERE id = '" .. getElementData(targetPlayer, "char:id") .. "'", 1, reason, ido, ido, "Egy RP Őr", getPlayerSerial(thePlayer))
  2165.                 local ajailMentes = dbExec(con, "INSERT INTO adminjails SET jailed_player = ?, jailed_playerSerial = ?, jailed_accountID = ?, jailed_admin = ?, jailed_adminSerial = ?, jailed_reason = ?, jailed_ido = ?, jailed_idopont=CURDATE(), jailed_idopontora=CURTIME()", targetPlayerName:gsub("_"," "), getPlayerSerial(targetPlayer), getElementData(targetPlayer, "acc:id"),getPlayerName(thePlayer) .. " [Egy RP Őr]", getPlayerSerial(thePlayer), reason, ido)
  2166.                 local adminlogSql = dbExec(con, adminlog, getPlayerName(thePlayer), getElementData(thePlayer, "acc:id"), "AJAIL", getPlayerName(thePlayer) .. " [Egy RP Őr] bebortonozte " .. targetPlayerName .. " jatekost " .. ido .. " percre. Indok:" .. reason .. "", targetPlayerName, getPlayerSerial(targetPlayer))
  2167.             --sql
  2168.            
  2169.        
  2170.         end
  2171.     end
  2172. end
  2173. addCommandHandler("ajail", guardadminJail, false, false)
  2174.  
  2175. function offlineAdminJail(thePlayer, commandName, targetPlayer, ido, ...)
  2176.     if getElementData(thePlayer, "acc:admin") >= 3 then
  2177.    
  2178.         if not (targetPlayer) or not (ido) or not (...) then
  2179.             outputChatBox("#7cc576Használat: #ffffff/" .. commandName .. " [Teljes_nev] [Perc] [Indok]", thePlayer, 255, 255, 255, true)
  2180.         else
  2181.            
  2182.             local targetPlayer = targetPlayer:gsub("_"," ")
  2183.             local ido = tonumber(ido)
  2184.             local reason = table.concat({...}, " ")
  2185.             local charid = false
  2186.            
  2187.             local sql = dbQuery(con, "SELECT * FROM characters WHERE charname='" .. targetPlayer .. "' LIMIT 1")
  2188.             local result = dbPoll(sql, -1)
  2189.            
  2190.             if result then
  2191.                 for _, row in ipairs(result) do
  2192.                    
  2193.                     charid = row["id"]
  2194.                    
  2195.                 end
  2196.                
  2197.                 local sql = dbExec(con, "UPDATE characters SET adminjail = ?, adminjail_reason = ?, adminjail_idoTelik = ?, adminjail_alapIdo = ?, adminjail_admin = ?, adminjail_adminSerial = ? WHERE id = '" .. charid .. "'", 1, reason, ido, ido, getPlayerAdminName(thePlayer), getPlayerSerial(thePlayer))
  2198.                 local ajailMentes = dbExec(con, "INSERT INTO adminjails SET jailed_player = ?, jailed_playerSerial = ?, jailed_accountID = ?, jailed_admin = ?, jailed_adminSerial = ?, jailed_reason = ?, jailed_ido = ?, jailed_idopont=CURDATE(), jailed_idopontora=CURTIME()", targetPlayer, charid, charid, getPlayerAdminName(thePlayer), getPlayerSerial(thePlayer), reason, ido)
  2199.                 local adminlogSql = dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, "acc:id"), "OJAIL", getPlayerAdminName(thePlayer) .. " bebortonozte " .. targetPlayer .. " jatekost " .. ido .. " percre. Indok:" .. reason .. "", targetPlayer, charid)
  2200.            
  2201.                 if sql then
  2202.                     outputChatBox("#dc143c[Offline - AdminJail]:#ffffff #7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff bebörtönözte #7cc576" .. targetPlayer .. "#ffffff játékost #1a75ff" .. ido .. "#ffffff percre.", root ,255, 255, 255, true)
  2203.                     outputChatBox("#dc143c[Offline - AdminJail]:#ffffff #7cc576Indok: #ffffff" .. reason, root ,255, 255, 255, true)
  2204.                 end
  2205.             else
  2206.                 outputChatBox(exhiba .. "Nincs találat", thePlayer, 255, 255, 255, true)
  2207.             end
  2208.         end
  2209.     end
  2210. end
  2211. addCommandHandler("ojail", offlineAdminJail, false, false)
  2212.  
  2213. function SerialChange(thePlayer, commandName, targetPlayer, ...)
  2214.     if getElementData(thePlayer, "acc:admin") >= 2 then
  2215.         if not (targetPlayer) then
  2216.             outputChatBox("#7cc576Használat: #ffffff/" .. commandName .. " [Felhasználónév]", thePlayer, 255, 255, 255, true)
  2217.         else
  2218.            
  2219.             --local targetPlayer = targetPlayer
  2220.             local charid = 0
  2221.            
  2222.             local sql = dbQuery(con, "SELECT * FROM accounts WHERE username='" .. targetPlayer .. "' LIMIT 1")
  2223.             local result = dbPoll(sql, -1)
  2224.            
  2225.             if result then
  2226.                 for _, row in ipairs(result) do
  2227.                     if targetPlayer == row["username"] then
  2228.                         charid = row["id"]
  2229.                     end
  2230.                 end
  2231.                 if charid > 0 then
  2232.                     outputChatBox("#7cc576[Info] #ffffffSikeresen lenulláztad #7cc576" .. targetPlayer .. " #ffffffserialjat.", thePlayer, 255, 255, 255, true)
  2233.                     local sql = dbExec(con, "UPDATE accounts SET mtaserial = 0  WHERE id = '" .. charid .. "'")
  2234.                     local adminlogSql = dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, "acc:id"), "SerialChange", getPlayerAdminName(thePlayer) .. " Resetelte a  " .. targetPlayer .. " jatekos Serialját", charid)
  2235.                 else
  2236.                     outputChatBox(exhiba .. "Nem található ilyen felhasználó.", thePlayer, 255, 255, 255, true)
  2237.                 end
  2238.            
  2239.             else
  2240.                 outputChatBox(exhiba .. "Nem található ilyen felhasználó", thePlayer, 255, 255, 255, true)
  2241.             end
  2242.         end
  2243.     end
  2244. end
  2245. addCommandHandler("resetserial", SerialChange, false, false)
  2246.  
  2247. function offlineNameChange(thePlayer, commandName, targetPlayer, ...)
  2248.     if getElementData(thePlayer, "acc:admin") >= 2 then
  2249.    
  2250.         if not (targetPlayer)  or not (...) then
  2251.             outputChatBox("#7cc576Használat: #ffffff/" .. commandName .. " [Teljes_nev] [Új_Név] ", thePlayer, 255, 255, 255, true)
  2252.         else
  2253.            
  2254.             local targetPlayer = targetPlayer:gsub("_"," ")
  2255.             local NewName = table.concat({...}, " ")
  2256.             local charid = 0
  2257.            
  2258.             local sql = dbQuery(con, "SELECT * FROM characters WHERE charname='" .. targetPlayer .. "' LIMIT 1")
  2259.             local result = dbPoll(sql, -1)
  2260.            
  2261.             if result then
  2262.                 for _, row in ipairs(result) do
  2263.                     charid = row["id"]
  2264.                     local sql = dbQuery(con, "SELECT * FROM characters WHERE charname='" .. NewName:gsub("_", " ") .. "'")
  2265.                     local result, num  = dbPoll(sql, -1)
  2266.                     if num > 0 then
  2267.                         outputChatBox(exhiba .. "Ez a név már foglalt.", thePlayer, 255, 255, 255, true)
  2268.                         return
  2269.                     end
  2270.                 end
  2271.                 if charid > 0 then
  2272.                     local sql = dbExec(con, "UPDATE characters SET charname = ? WHERE id = '" .. charid .. "'", NewName:gsub("_"," "))
  2273.                     local adminlogSql = dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, "acc:id"), "OFFNAME", getPlayerAdminName(thePlayer) .. " megváltoztatta " .. targetPlayer .. " jatekos nevét :" .. NewName, targetPlayer, charid)
  2274.                     outputChatBox("#7cc576[Info] #ffffffSikeresen megváltoztattad #7cc576" .. targetPlayer .. " #ffffffnevét.", thePlayer, 255, 255, 255, true)
  2275.                 else
  2276.                     outputChatBox(exhiba .. "Nem található ilyen név.", thePlayer, 255, 255, 255, true)
  2277.                 end
  2278.             else
  2279.                 outputChatBox(exhiba .. "Nincs találat", thePlayer, 255, 255, 255, true)
  2280.             end
  2281.         end
  2282.     end
  2283. end
  2284. addCommandHandler("setnameoff", offlineNameChange, false, false)
  2285.  
  2286. function charname(thePlayer, commandName, targetPlayer, ...)
  2287.     if getElementData(thePlayer, "acc:admin") >= 2 then
  2288.    
  2289.         if not (targetPlayer)  then
  2290.             outputChatBox("#7cc576Használat: #ffffff/" .. commandName .. " [Teljes_nev]", thePlayer, 255, 255, 255, true)
  2291.         else
  2292.            
  2293.             local targetPlayer = targetPlayer:gsub("_"," ")
  2294.             local charid = 0
  2295.             local charname = ""
  2296.            
  2297.             local sql = dbQuery(con, "SELECT * FROM characters WHERE charname='" .. targetPlayer .. "' LIMIT 1")
  2298.             local result = dbPoll(sql, -1)
  2299.            
  2300.             if result then
  2301.                 for _, row in ipairs(result) do
  2302.                     charid = row["id"]
  2303.                     local sql = dbQuery(con, "SELECT * FROM accounts WHERE id='" .. charid .. "'")
  2304.                     local result  = dbPoll(sql, -1)
  2305.                     for _, rows in ipairs(result) do
  2306.                         charname = rows["username"]
  2307.                     end
  2308.                 end
  2309.                 if charid > 0 then
  2310.                     outputChatBox("#7cc576[Info] #52B3D9".. targetPlayer .." #ffffffkarakterének a felhasználóneve: #52B3D9".. charname ..".", thePlayer, 255, 255, 255, true)
  2311.                 else
  2312.                     outputChatBox(exhiba .. "Nem található ilyen név.", thePlayer, 255, 255, 255, true)
  2313.                 end
  2314.             else
  2315.                 outputChatBox(exhiba .. "Nincs találat", thePlayer, 255, 255, 255, true)
  2316.             end
  2317.         end
  2318.     end
  2319. end
  2320. addCommandHandler("accname", charname, false, false)
  2321.  
  2322. function accname(thePlayer, commandName, targetPlayer, ...)
  2323.     if getElementData(thePlayer, "acc:admin") >= 2 then
  2324.    
  2325.         if not (targetPlayer)  then
  2326.             outputChatBox("#7cc576Használat: #ffffff/" .. commandName .. " [account név]", thePlayer, 255, 255, 255, true)
  2327.         else
  2328.            
  2329.             --local targetPlayer = targetPlayer:gsub("_"," ")
  2330.             local charid = 0
  2331.             local charname = ""
  2332.            
  2333.             local sql = dbQuery(con, "SELECT * FROM accounts WHERE username='" .. targetPlayer .. "'")
  2334.             local result = dbPoll(sql, -1)
  2335.            
  2336.             if result then
  2337.                 for _, row in ipairs(result) do
  2338.                     charid = row["id"]
  2339.                     local sql = dbQuery(con, "SELECT * FROM characters WHERE id='" .. charid .. "'")
  2340.                     local result  = dbPoll(sql, -1)
  2341.                     for _, rows in ipairs(result) do
  2342.                         charname = rows["charname"]
  2343.                     end
  2344.                 end
  2345.                 if charid > 0 then
  2346.                     outputChatBox("#7cc576[Info] #52B3D9".. targetPlayer .." #ffffffaccountjának karakterneve: #52B3D9".. charname ..".", thePlayer, 255, 255, 255, true)
  2347.                 else
  2348.                     outputChatBox(exhiba .. "Nem található ilyen név.", thePlayer, 255, 255, 255, true)
  2349.                 end
  2350.             else
  2351.                 outputChatBox(exhiba .. "Nincs találat", thePlayer, 255, 255, 255, true)
  2352.             end
  2353.         end
  2354.     end
  2355. end
  2356. addCommandHandler("charname", accname, false, false)
  2357.  
  2358. function playerInfo(thePlayer, commandName, targetPlayer, ...)
  2359.     if getElementData(thePlayer, "acc:admin") >= 2 then
  2360.    
  2361.         if not (targetPlayer)  then
  2362.             outputChatBox("#7cc576Használat: #ffffff/" .. commandName .. " [Serial]", thePlayer, 255, 255, 255, true)
  2363.         else
  2364.            
  2365.             local charid = 0
  2366.             local charname = ""
  2367.             local username = ""
  2368.            
  2369.             local sql = dbQuery(con, "SELECT * FROM accounts WHERE mtaserial='" .. targetPlayer .. "'")
  2370.             local result = dbPoll(sql, -1)
  2371.            
  2372.             if result then
  2373.                 for _, row in ipairs(result) do
  2374.                     charid = row["id"]
  2375.                     username = row["username"]
  2376.                     local sql = dbQuery(con, "SELECT * FROM characters WHERE id='" .. charid .. "'")
  2377.                     local result  = dbPoll(sql, -1)
  2378.                     for _, rows in ipairs(result) do
  2379.                         charname = rows["charname"]
  2380.                     end
  2381.                 end
  2382.                 if charid > 0 then
  2383.                     outputChatBox("#7cc576[Info]#ffffff Karakterneve: #52B3D9".. charname .." #ffffffFehasználóneve: #52B3D9" .. username.. ".", thePlayer, 255, 255, 255, true)
  2384.                 else
  2385.                     outputChatBox(exhiba .. "Nem található ilyen név.", thePlayer, 255, 255, 255, true)
  2386.                 end
  2387.             else
  2388.                 outputChatBox(exhiba .. "Nincs találat", thePlayer, 255, 255, 255, true)
  2389.             end
  2390.         end
  2391.     end
  2392. end
  2393. addCommandHandler("ainfo", playerInfo, false, false)
  2394.  
  2395. function idoTelikLe(targetPlayer)
  2396.     if isElement(targetPlayer) and (getElementType(targetPlayer) == "player") then
  2397.        
  2398.         local idoTelik = tonumber(getElementData(targetPlayer, "idoTelik")) or false
  2399.         local idoLetelt = tonumber(getElementData(targetPlayer, "idoLetelt")) or false
  2400.        
  2401.         if (idoTelik) and (idoLetelt) then
  2402.             setElementData(targetPlayer, "idoTelik", idoTelik-1)
  2403.             setElementData(targetPlayer, "idoLetelt", idoLetelt+1)
  2404.            
  2405.             local x,y,z = getElementPosition(targetPlayer)
  2406.            
  2407.             local dist = getDistanceBetweenPoints3D(x,y,z, 198.0009765625, 175.1279296875, 1003.0234375)
  2408.             if dist > 10 then
  2409.                 setElementPosition(targetPlayer, 198.0009765625, 175.1279296875, 1003.0234375)
  2410.                 local setInterior = setElementInterior(targetPlayer, 3)
  2411.                 setElementDimension(targetPlayer, 132+getElementData(targetPlayer, "acc:id"))
  2412.                 outputChatBox(exinfo .. "Haver. Nálatok nem tanították hogy szökni nem túl jó dolog :D?", targetPlayer, 255, 255, 255, true)
  2413.             end
  2414.             --outputChatBox(idoTelik .. " van hátra | " ..  idoLetelt .. " letelt | " .. getPlayerName(targetPlayer)) --IDG, eltávolítható
  2415.             local sql = dbExec(con, "UPDATE characters SET adminjail_idoTelik = ? WHERE id = '" .. getElementData(targetPlayer, "char:id") .. "'", idoTelik)
  2416.  
  2417.        
  2418.             if (idoTelik) <= 1 then
  2419.  
  2420.                 outputChatBox(exinfo .. "Lejárt a büntetésed.", targetPlayer, 255, 255, 255, true)
  2421.                
  2422.                 --outputAdminMessage(getPlayerName(targetPlayer):gsub("_"," ") .. " adminjailje lejárt. [CHECK]") --IDG, eltávolítható
  2423.                
  2424.                 local theTimer = getElementData(targetPlayer, "adminjail:theTimer")
  2425.                
  2426.                 if not (theTimer) then
  2427.                     return false
  2428.                 end
  2429.                
  2430.                 killTimer(theTimer)
  2431.                 setElementData(targetPlayer, "adminjail:theTimer", false)
  2432.  
  2433.                
  2434.                 local adminjailed = setElementData(targetPlayer, "adminjail", false)
  2435.                 local adminjail_reason = setElementData(targetPlayer, "adminjail:reason", false)
  2436.                 local alapido = setElementData(targetPlayer, "adminjail:ido", false)
  2437.                 local admin = setElementData(targetPlayer, "adminjail:admin", false)
  2438.                 local adminSerial = setElementData(targetPlayer, "adminjail:adminSerial", false)
  2439.                
  2440.                 --sql
  2441.                 local sql = dbExec(con, "UPDATE characters SET adminjail = ?, adminjail_reason = ?, adminjail_idoTelik = ?, adminjail_alapIdo = ?, adminjail_admin = ?, adminjail_adminSerial = ? WHERE id = '" .. getElementData(targetPlayer, "char:id") .. "'", 0, false, false, false, false, false)
  2442.                 local idoTelikVege = setElementData(targetPlayer, "idoTelik", false)
  2443.                 local idoLeteltVege = setElementData(targetPlayer, "idoLetelt", false)
  2444.                
  2445.                 --pos
  2446.                 local setPosition = setElementPosition(targetPlayer, 1317.7186279297, -1377.9603271484, 13.75364780426)
  2447.                 local setInterior = setElementInterior(targetPlayer, 0)
  2448.                 local setDimension = setElementDimension(targetPlayer, 0)
  2449.             end
  2450.         end
  2451.     end
  2452. end
  2453.  
  2454. function unJail(thePlayer, commandName, targetPlayer)
  2455.     if getElementData(thePlayer, "acc:admin") >= 1 then
  2456.    
  2457.         if not (targetPlayer) then
  2458.             outputChatBox("#7cc576Használat#ffffff /" .. commandName .. " [Név / ID]", thePlayer, 255, 255, 255, true)
  2459.         else
  2460.             local targetPlayer, targetPlayerName = exports.mta_main:findPlayer(thePlayer, targetPlayer)
  2461.             if not (targetPlayer) then outputChatBox(exhiba .. "Nincs ilyen játékos.", thePlayer, 255, 255, 255, true) return end
  2462.            
  2463.             if getElementData(targetPlayer, "adminjail") == 1 then
  2464.            
  2465.                 local theTimerCheck = getElementData(targetPlayer, "adminjail:theTimer")
  2466.                 local theTimerCheck2 = getElementData(targetPlayer, "adminjail:theTimerAccounts")
  2467.  
  2468.                 if getElementData(targetPlayer, "adminjail:admin") == getPlayerAdminName(thePlayer) then
  2469.                        
  2470.                         if isTimer(theTimerCheck) then
  2471.                             killTimer(theTimerCheck)
  2472.                             setElementData(targetPlayer, "adminjail:theTimer", false)
  2473.                         end
  2474.                         if isTimer(theTimerCheck2) then
  2475.                             killTimer(theTimerCheck2)
  2476.                             setElementData(targetPlayer, "adminjail:theTimerAccounts", false)
  2477.                         end
  2478.                        
  2479.                         outputAdminMessage("#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff kiszedte " .. getPlayerName(targetPlayer) .." játékost az adminjailból.") --MARAD ÉS FIXELNI AZ EGÉSZ UNJAILT RANGOKRA
  2480.                         outputChatBox(exinfo .. "#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff kivett az adminjailból. ", targetPlayer ,255, 255, 255, true)
  2481.                                
  2482.                         local adminjailed = setElementData(targetPlayer, "adminjail", false)
  2483.                         local adminjail_reason = setElementData(targetPlayer, "adminjail:reason", false)
  2484.                         local alapido = setElementData(targetPlayer, "adminjail:ido", false)
  2485.                         local admin = setElementData(targetPlayer, "adminjail:admin", false)
  2486.                         local adminSerial = setElementData(targetPlayer, "adminjail:adminSerial", false)
  2487.                        
  2488.                         --sql
  2489.                         local sql = dbExec(con, "UPDATE characters SET adminjail = ?, adminjail_reason = ?, adminjail_idoTelik = ?, adminjail_alapIdo = ?, adminjail_admin = ?, adminjail_adminSerial = ? WHERE id = '" .. getElementData(targetPlayer, "char:id") .. "'", 0, false, false, false, false, false)
  2490.                        
  2491.                         local idoTelikVege = setElementData(targetPlayer, "idoTelik", false)
  2492.                         local idoLeteltVege = setElementData(targetPlayer, "idoLetelt", false)
  2493.                        
  2494.                         --pos
  2495.                         local setPosition = setElementPosition(targetPlayer, 1317.7186279297, -1377.9603271484, 13.75364780426)
  2496.                         local setInterior = setElementInterior(targetPlayer, 0)
  2497.                         local setDimension = setElementDimension(targetPlayer, 0)
  2498.                 else
  2499.                     if getElementData(thePlayer, "acc:admin") >= 6 then
  2500.                        
  2501.                         local theTimerCheck = getElementData(targetPlayer, "adminjail:theTimer")
  2502.                         local theTimerCheck2 = getElementData(targetPlayer, "adminjail:theTimerAccounts")
  2503.                        
  2504.                         if isElement(theTimerCheck) then
  2505.                             killTimer(theTimerCheck)
  2506.                             setElementData(targetPlayer, "adminjail:theTimer", false)
  2507.                         end
  2508.                         if isElement(theTimerCheck2) then
  2509.                             killTimer(theTimerCheck2)
  2510.                             setElementData(targetPlayer, "adminjail:theTimerAccounts", false)
  2511.                         end
  2512.                        
  2513.                         outputAdminMessage("#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff kiszedte " .. getPlayerName(targetPlayer) .." játékost az adminjailból.") --MARAD ÉS FIXELNI AZ EGÉSZ UNJAILT RANGOKRA
  2514.                         outputChatBox(exinfo .. "#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff kivett az adminjailból. ", targetPlayer ,255, 255, 255, true)
  2515.                
  2516.                        
  2517.                         local adminjailed = setElementData(targetPlayer, "adminjail", false)
  2518.                         local adminjail_reason = setElementData(targetPlayer, "adminjail:reason", false)
  2519.                         local alapido = setElementData(targetPlayer, "adminjail:ido", false)
  2520.                         local admin = setElementData(targetPlayer, "adminjail:admin", false)
  2521.                         local adminSerial = setElementData(targetPlayer, "adminjail:adminSerial", false)
  2522.                        
  2523.                         --sql
  2524.                         local sql = dbExec(con, "UPDATE characters SET adminjail = ?, adminjail_reason = ?, adminjail_idoTelik = ?, adminjail_alapIdo = ?, adminjail_admin = ?, adminjail_adminSerial = ? WHERE id = '" .. getElementData(targetPlayer, "char:id") .. "'", 0, false, false, false, false, false)
  2525.                        
  2526.                         local idoTelikVege = setElementData(targetPlayer, "idoTelik", false)
  2527.                         local idoLeteltVege = setElementData(targetPlayer, "idoLetelt", false)
  2528.                        
  2529.                         --pos
  2530.                         local setPosition = setElementPosition(targetPlayer, 1317.7186279297, -1377.9603271484, 13.75364780426)
  2531.                         local setInterior = setElementInterior(targetPlayer, 0)
  2532.                         local setDimension = setElementDimension(targetPlayer, 0)
  2533.                     else
  2534.                         outputChatBox(exhiba .. "Nincs jogosultságod a játékost kivenni az adminjailból. Hibakód: UNJAILAD", thePlayer, 255, 255, 255, true)
  2535.                     end
  2536.                 end
  2537.             else
  2538.                 outputChatBox(exhiba .. "" .. targetPlayerName:gsub("_"," ") .. " nincs adminjailben.", thePlayer ,255, 255, 255, true)
  2539.             end
  2540.         end
  2541.     end
  2542. end
  2543. addCommandHandler("unjail", unJail, false, false)
  2544.  
  2545. function getJailedPlayers(thePlayer, commandName, targetPlayer)
  2546.     if getElementData(thePlayer, "acc:admin") >= 1 then
  2547.    
  2548.        
  2549.        
  2550.         if (targetPlayer) then
  2551.             local targetPlayer, targetPlayerName = exports.mta_main:findPlayer(thePlayer, targetPlayer)
  2552.             if getElementData(targetPlayer, "adminjail") == 1 then
  2553.                 local admin = getElementData(targetPlayer, "adminjail:admin")
  2554.                 local ido = getElementData(targetPlayer, "adminjail:ido")
  2555.                 local reason = getElementData(targetPlayer, "adminjail:reason")
  2556.                 local letelt = getElementData(targetPlayer, "idoLetelt")
  2557.                 local hatravan = getElementData(targetPlayer, "idoTelik")
  2558.                
  2559.                 outputChatBox("============== Bebörtönzött játékosok lekérdezése =================", thePlayer, 200, 200, 200, true)
  2560.                 outputChatBox("#7cc576" .. getPlayerName(targetPlayer):gsub("_"," ") .. " #00B6FF(" .. getElementData(targetPlayer, "playerid") .. ")#ffffff: Bebörtönözte: #7cc576" .. admin .. "#ffffff, Perc: #7cc576" .. ido .. " perc", thePlayer, 255, 255, 255, true)
  2561.                 outputChatBox("#7cc576" .. getPlayerName(targetPlayer):gsub("_"," ") .. " #00B6FF(" .. getElementData(targetPlayer, "playerid") .. ")#ffffff: Indok: #7cc576" .. reason .. "", thePlayer, 255, 255, 255, true)
  2562.                 outputChatBox("#7cc576" .. getPlayerName(targetPlayer):gsub("_"," ") .. " #00B6FF(" .. getElementData(targetPlayer, "playerid") .. ")#ffffff: Eddig letelt: #7cc576" .. letelt .. " perc#ffffff, Hátra van: #7cc576" .. hatravan .. " perc", thePlayer, 255, 255, 255, true)
  2563.                 outputChatBox(" ", thePlayer, 200, 200, 200, true)
  2564.             else
  2565.                 outputChatBox(exhiba .. "A játékos nincs adminjailben.", thePlayer, 255, 255, 255, true)
  2566.             end
  2567.             if getElementData(targetPlayer, "jailed") == 1 then
  2568.                 local admin = getElementData(targetPlayer, "jailed:player")
  2569.                 local ido = getElementData(targetPlayer, "jailed:ido")
  2570.                 local reason = getElementData(targetPlayer, "jailed:reason")
  2571.                 local letelt = getElementData(targetPlayer, "jailed:idoLetelt")
  2572.                 local hatravan = getElementData(targetPlayer, "jailed:idoTelik")
  2573.                
  2574.                 outputChatBox("============== Őrizetbe vett játékosok lekérdezése =================", thePlayer, 200, 200, 200, true)
  2575.                 outputChatBox("#7cc576" .. getPlayerName(targetPlayer):gsub("_"," ") .. " #00B6FF(" .. getElementData(targetPlayer, "playerid") .. ")#ffffff: Őrizetbe vette: #7cc576" .. admin .. "#ffffff, Perc: #7cc576" .. ido .. " perc", thePlayer, 255, 255, 255, true)
  2576.                 outputChatBox("#7cc576" .. getPlayerName(targetPlayer):gsub("_"," ") .. " #00B6FF(" .. getElementData(targetPlayer, "playerid") .. ")#ffffff: Indok: #7cc576" .. reason .. "", thePlayer, 255, 255, 255, true)
  2577.                 outputChatBox("#7cc576" .. getPlayerName(targetPlayer):gsub("_"," ") .. " #00B6FF(" .. getElementData(targetPlayer, "playerid") .. ")#ffffff: Eddig letelt: #7cc576" .. letelt .. " perc#ffffff, Hátra van: #7cc576" .. hatravan .. " perc", thePlayer, 255, 255, 255, true)
  2578.                 outputChatBox(" ", thePlayer, 200, 200, 200, true)
  2579.             else
  2580.                 outputChatBox(exhiba .. "A játékos nincs őrizetbe véve.", thePlayer, 255, 255, 255, true)
  2581.             end
  2582.         else
  2583.             count = 0
  2584.             count2 = 0
  2585.             for k, v in ipairs(getElementsByType("player")) do
  2586.                 if getElementData(v, "adminjail") == 1 then
  2587.                    
  2588.                     local admin = getElementData(v, "adminjail:admin")
  2589.                     local ido = getElementData(v, "adminjail:ido")
  2590.                     local reason = getElementData(v, "adminjail:reason")
  2591.                     local letelt = getElementData(v, "idoLetelt")
  2592.                     local hatravan = getElementData(v, "idoTelik")
  2593.                    
  2594.                     outputChatBox("============== Bebörtönzött játékosok lekérdezése =================", thePlayer, 200, 200, 200, true)
  2595.                     outputChatBox("#7cc576" .. getPlayerName(v):gsub("_"," ") .. " #00B6FF(" .. getElementData(v, "playerid") .. ")#ffffff: Bebörtönözte: #7cc576" .. admin .. "#ffffff, Perc: #7cc576" .. ido .. " perc", thePlayer, 255, 255, 255, true)
  2596.                     outputChatBox("#7cc576" .. getPlayerName(v):gsub("_"," ") .. " #00B6FF(" .. getElementData(v, "playerid") .. ")#ffffff: Indok: #7cc576" .. reason .. "", thePlayer, 255, 255, 255, true)
  2597.                     outputChatBox("#7cc576" .. getPlayerName(v):gsub("_"," ") .. " #00B6FF(" .. getElementData(v, "playerid") .. ")#ffffff: Eddig letelt: #7cc576" .. letelt .. " perc#ffffff, Hátra van: #7cc576" .. hatravan .. " perc", thePlayer, 255, 255, 255, true)
  2598.                     outputChatBox("   ", thePlayer, 200, 200, 200, true)
  2599.                     count = count + 1
  2600.                 end
  2601.                 if getElementData(v, "jailed") == 1 then
  2602.                     outputChatBox("============== Őrizetbe vett játékosok lekérdezése =================", thePlayer, 200, 200, 200, true)
  2603.                     outputChatBox("#7cc576" .. getPlayerName(v):gsub("_"," ") .. " #00B6FF(" .. getElementData(v, "playerid") .. ")#ffffff: Őrizetbe vette: #7cc576" .. getElementData(v, "jailed:player") .. "#ffffff, Perc: #7cc576" .. getElementData(v, "jailed:ido") .. " perc", thePlayer, 255, 255, 255, true)
  2604.                     outputChatBox("#7cc576" .. getPlayerName(v):gsub("_"," ") .. " #00B6FF(" .. getElementData(v, "playerid") .. ")#ffffff: Indok: #7cc576" .. getElementData(v, "jailed:reason") .. "", thePlayer, 255, 255, 255, true)
  2605.                     outputChatBox("#7cc576" .. getPlayerName(v):gsub("_"," ") .. " #00B6FF(" .. getElementData(v, "playerid") .. ")#ffffff: Eddig letelt: #7cc576" .. getElementData(v, "jailed:idoLetelt") .. " perc#ffffff, Hátra van: #7cc576" .. getElementData(v, "jailed:idoTelik") .. " perc", thePlayer, 255, 255, 255, true)
  2606.                     outputChatBox("   ", thePlayer, 200, 200, 200, true)
  2607.                     count2 = count2 + 1
  2608.                 end
  2609.             end
  2610.            
  2611.             if count == 0 and count2 == 0 then
  2612.                 outputChatBox(exinfo .. "Senki sincsen adminjailben.", thePlayer, 255, 255, 255, true)
  2613.             else
  2614.                 outputChatBox("Összesen #dc143c" .. count .. "#ffffff játékos van adminjailben és #dc143c" .. count2 .. "#ffffff játékos van őrizetben.", thePlayer, 255, 255, 255, true)
  2615.             end
  2616.            
  2617.         end
  2618.     end
  2619. end
  2620. addCommandHandler("jailed", getJailedPlayers, false, false)
  2621.  
  2622. function bortonIdo(thePlayer, commandName)
  2623.     if getElementData(thePlayer, "adminjail") == 1 then
  2624.        
  2625.         local admin = getElementData(thePlayer, "adminjail:admin")
  2626.         local ido = getElementData(thePlayer, "adminjail:ido")
  2627.         local reason = getElementData(thePlayer, "adminjail:reason")
  2628.         local letelt = getElementData(thePlayer, "idoLetelt")
  2629.         local hatravan = getElementData(thePlayer, "idoTelik")
  2630.        
  2631.         outputChatBox("#dc143c[AJ - Információ]:#ffffff #7cc576" .. admin .. "#ffffff bebörtönzött téged #7cc576" .. ido .. " percre#ffffff.", thePlayer, 255, 255, 255, true)
  2632.         outputChatBox("#dc143c[AJ - Információ]:#ffffff Indok: #7cc576" .. reason, thePlayer, 255, 255, 255, true)
  2633.         outputChatBox("#dc143c[AJ - Információ]:#ffffff Hátra van: #7cc576" .. hatravan .. " perc#ffffff, Letelt: #7cc576" .. letelt .. " perc", thePlayer, 255, 255, 255, true)
  2634.         outputChatBox("#dc143c[AJ - Információ]:#ffffff Típus: #7cc576adminjail", thePlayer, 255, 255, 255, true)
  2635.     elseif getElementData(thePlayer, "jailed") == 1 then
  2636.        
  2637.         local admin = getElementData(thePlayer, "jailed:player")
  2638.         local ido = getElementData(thePlayer, "jailed:ido")
  2639.         local reason = getElementData(thePlayer, "jailed:reason")
  2640.         local letelt = getElementData(thePlayer, "jailed:idoLetelt")
  2641.         local hatravan = getElementData(thePlayer, "jailed:idoTelik")
  2642.        
  2643.         outputChatBox("#dc143c[Jail - Információ]:#ffffff #7cc576" .. admin .. "#ffffff őrizetbe vett téged #7cc576" .. ido .. " percre#ffffff.", thePlayer, 255, 255, 255, true)
  2644.         outputChatBox("#dc143c[Jail - Információ]:#ffffff Indok: #7cc576" .. reason, thePlayer, 255, 255, 255, true)
  2645.         outputChatBox("#dc143c[Jail - Információ]:#ffffff Hátra van: #7cc576" .. hatravan .. " perc#ffffff, Letelt: #7cc576" .. letelt .. " perc", thePlayer, 255, 255, 255, true)
  2646.         outputChatBox("#dc143c[Jail - Információ]:#ffffff Típus: #7cc576őrizetbe vétel", thePlayer, 255, 255, 255, true)
  2647.     else
  2648.         outputChatBox(exhiba .. "Nem vagy börtönben, sem adminjailban.", thePlayer, 255, 255, 255, true)
  2649.     end
  2650. end
  2651. addCommandHandler("börtönidő", bortonIdo, false, false)
  2652.  
  2653. ----------------------------------------------------------------------------------------------------------------------------------------
  2654. -- /a, /as -- ADMINISZTRÁTOR, ADMINSEGÉD CHAT PARANCSOK
  2655. ----------------------------------------------------------------------------------------------------------------------------------------
  2656.  
  2657. addCommandHandler("a",
  2658.     function(player,_,...)
  2659.         if getElementData(player,"loggedin") then
  2660.         if tonumber(getElementData(player, "acc:admin") or 0) >= 1 then
  2661.             local message = table.concat({...}, " ")
  2662.             local szintpername = getPlayerAdminLevel(player)
  2663.             if ... and message then
  2664.                 for k,v in ipairs(getElementsByType("player")) do
  2665.                     if tonumber(getElementData(v, "acc:admin") or 0) >= 1 then
  2666.                         outputChatBox("#7cc576[AdminChat]: #4C8DF0".. szintpername .. " " .. getPlayerAdminName(player) .. ":#FFFFFF "..message,v,255,255,255,true)
  2667.                     end
  2668.                 end
  2669.             else
  2670.                 outputChatBox("#7cc576Használat: #ffffff/a [Szöveg]",player, 255, 194, 14, true)
  2671.             end
  2672.         end
  2673.     end
  2674.     end
  2675. )
  2676.  
  2677. function developerChat(thePlayer, commandName, ...)
  2678.     if getElementData(thePlayer, "acc:admin") >= 7 then
  2679.        
  2680.         if not (...) then
  2681.             outputChatBox("#7cc576Használat:#ffffff /" .. commandName .. " [Üzenet]", thePlayer, 255, 255, 255, true)
  2682.         else
  2683.        
  2684.             local msg = table.concat({...}," ")
  2685.            
  2686.             for k, v in ipairs(getElementsByType("player")) do
  2687.                 if tonumber(getElementData(v, "acc:admin") or 0) >= 7 then 
  2688.                     outputChatBox("#D35400[Developer]#7cc576 " .. getPlayerAdminName(thePlayer) .. ":#ffffff ".. msg, v, 255, 255, 255, true)
  2689.                 end
  2690.             end
  2691.         end
  2692.     end
  2693. end
  2694. addCommandHandler("dc", developerChat, false, false)
  2695.  
  2696. addCommandHandler("as",
  2697.     function(player,_,...)
  2698.         if getElementData(player,"loggedin") then
  2699.         if tonumber(getElementData(player, "acc:aseged")) >= 1 or tonumber(getElementData(player, "acc:admin")) >= 1 then
  2700.             local message = table.concat({...}, " ")
  2701.             if ... and message then
  2702.                 for k,v in ipairs(getElementsByType("player")) do
  2703.                     if tonumber(getElementData(v, "acc:aseged") or 0) >= 1 or tonumber(getElementData(v, "acc:admin") or 0) >= 1 then
  2704.                         if getElementData(player,"acc:aseged") >= 1 then
  2705.                             name = getPlayerName(player):gsub("_"," ")
  2706.                             szintpername = getPlayerAsLevel(player)
  2707.                         elseif getElementData(player,"acc:admin") >= 1 then
  2708.                             name = getPlayerAdminName(player)
  2709.                             szintpername = getPlayerAdminLevel(player)
  2710.                         end
  2711.                         outputChatBox("#19B5FE[AS]#7cc576 "..szintpername .. " " .. name .. ":#FFFFFF "..message,v,255,255,255,true)
  2712.                     end
  2713.                 end
  2714.             else
  2715.                 outputChatBox("#7cc576Használat:#ffffff /as [Szöveg]",player, 255, 194, 14, true)
  2716.             end
  2717.         end
  2718.     end
  2719.     end
  2720. )
  2721.  
  2722.  
  2723. function player_Wasted ( ammo, attacker, weapon, bodypart )
  2724.    
  2725.     local time = getRealTime()
  2726.     local hours = time.hour
  2727.     local minutes = time.minute
  2728.    
  2729.     if minutes < 10 then
  2730.         minutes = "0" .. minutes
  2731.     end
  2732.     if hours < 10 then
  2733.         hours = "0" .. hours
  2734.     end
  2735.    
  2736.     local killog
  2737.    
  2738.     if (attacker) then
  2739.         if (getElementType(attacker) == "player") then
  2740.             if getWeaponNameFromID(weapon) == "Explosion" then
  2741.                 allapot = "Felrobbantotta"
  2742.             else
  2743.                 allapot = "Fegyver: " .. getWeaponNameFromID(weapon)
  2744.             end
  2745.             killog = "[" .. hours .. ":" .. minutes .. "] ".. getPlayerName(attacker):gsub("_"," ")   .. " megölte " .. getPlayerName(source):gsub("_"," ") .. " játékost. (" .. allapot .. ")"
  2746.             if (bodypart) == 9 then
  2747.                 killog = killog .. " (Fejbelövés)"
  2748.             elseif (bodypart) == 4 then
  2749.                 killog = killog .. " (Seggbelőtték)"
  2750.             end
  2751.         elseif (getElementType(attacker) == "vehicle") then
  2752.             if getWeaponNameFromID(weapon) == "Rammed" then
  2753.                 allapot = "Elütötte"
  2754.             elseif getWeaponNameFromID(weapon) == "Ranover" then
  2755.                 allapot = "Ráállt DB"
  2756.             end
  2757.             killog = "[" .. hours .. ":" .. minutes .. "] " .. getPlayerName(getVehicleController(attacker)):gsub("_"," ") .. " elütötte " .. getPlayerName(source):gsub("_"," ") .. " játékost. (Járművel: " .. allapot .. ")"
  2758.         elseif (getElementType(attacker) == "ped") then
  2759.             allapot = "( PET )"
  2760.             killog = "[" .. hours .. ":" .. minutes .. "] ".. (getElementData(attacker, "ped:name") or "Ismeretlen") .. " "..allapot .. " megölte " .. getPlayerName(source):gsub("_"," ") .. " játékost."
  2761.         end
  2762.     else
  2763.         killog = "[" .. hours .. ":" .. minutes .. "] " .. getPlayerName(source):gsub("_", " ") .. " meghalt."
  2764.     end
  2765.    
  2766.     for k, v in ipairs(getElementsByType("player")) do
  2767.         if tonumber(getElementData(v, "acc:admin") or 0) >= 1 and getElementData(v, "loggedin") then
  2768.             outputChatBox("*".. killog, v, 220, 220, 220, true)
  2769.         end
  2770.     end
  2771. end
  2772. addEventHandler ( "onPlayerWasted", getRootElement(), player_Wasted )
  2773. ----------------------------------------------------------------------------------------------------------------------------------------
  2774. -- /restartres, /stopres, /startres -- RESOURCE PARANCSOK
  2775. ----------------------------------------------------------------------------------------------------------------------------------------
  2776.  
  2777. function restartRes(thePlayer, commandName, resourceName)
  2778.     if getElementData(thePlayer, "acc:admin") >= 8 then
  2779.    
  2780.         if not (resourceName) then
  2781.             outputChatBox("#7cc576Használat: #ffffff/" .. commandName .. " [Resource név]", thePlayer, 255, 255, 255, true)
  2782.         else
  2783.        
  2784.             local resource = getResourceFromName( resourceName )
  2785.            
  2786.             if not (resource) then
  2787.                 outputChatBox(exhiba .. "A(z) " .. resourceName .. " resource nem található.", thePlayer, 255, 255, 255, true)
  2788.                 return
  2789.             end
  2790.            
  2791.             local restart = restartResource(resource)
  2792.             local get = getResourceState(resource)
  2793.            
  2794.             if get ~= "running" then
  2795.                 local start = startResource(resource)
  2796.                 if (start) then
  2797.                     outputAdminMessage("#7cc576".. getPlayerAdminName(thePlayer) .. "#ffffff elindította a(z) #0094ff" .. resourceName .. "#ffffff resourcet.")
  2798.                 else
  2799.                     outputChatBox(exhiba .. "Nem sikerült elindítani a resourcet. Hibakód: RESTART1", thePlayer, 255, 255, 255, true)
  2800.                 end
  2801.             else
  2802.                 if (restart) then
  2803.                     outputAdminMessage("#7cc576"..getPlayerAdminName(thePlayer) .. "#ffffff újraindította a(z) #0094ff" .. resourceName .. "#ffffff resourcet.")
  2804.                 else
  2805.                     outputChatBox(exhiba .. "Nem sikerült újraindítani a resourcet. Hibakód: RESTART2", thePlayer, 255, 255, 255, true)
  2806.                 end
  2807.             end
  2808.         end
  2809.     end
  2810. end
  2811. addCommandHandler("restartres", restartRes, false, false)
  2812.  
  2813. function stopRes(thePlayer, commandName, resourceName)
  2814.     if getElementData(thePlayer, "acc:admin") >= 8 then
  2815.    
  2816.         if not (resourceName) then
  2817.             outputChatBox("#7cc576Használat: #ffffff/" .. commandName .. " [Resource név]", thePlayer, 255, 255, 255, true)
  2818.         else
  2819.        
  2820.             local resource = getResourceFromName( resourceName )
  2821.            
  2822.             if not (resource) then
  2823.                 outputChatBox(exhiba .. "A(z) " .. resourceName .. " resource nem található.", thePlayer, 255, 255, 255, true)
  2824.                 return
  2825.             end
  2826.            
  2827.             local stop = stopResource(resource)
  2828.             local get = getResourceState(resource)
  2829.            
  2830.             if get ~= "running" then
  2831.                 outputChatBox(exhiba .. "A(z) " .. resourceName .. " resource nem fut jelenleg.", thePlayer, 255, 255, 255, true)
  2832.             else
  2833.                 if (stop) then
  2834.                     outputAdminMessage("#7cc576"..getPlayerAdminName(thePlayer) .. "#ffffff leállította a(z) #0094ff" .. resourceName .. "#ffffff resourcet.")
  2835.                 else
  2836.                     outputChatBox(exhiba .. "Nem sikerült leállítani a resourcet. Hibakód: STOP2", thePlayer, 255, 255, 255, true)
  2837.                 end
  2838.             end
  2839.         end
  2840.     end
  2841.  
  2842. end
  2843. addCommandHandler("stopres", stopRes, false, false)
  2844.  
  2845. function startRes(thePlayer, commandName, resourceName)
  2846.     if getElementData(thePlayer, "acc:admin") >= 8 then
  2847.    
  2848.         if not (resourceName) then
  2849.             outputChatBox("#7cc576Használat: #ffffff/" .. commandName .. " [Resource név]", thePlayer, 255, 255, 255, true)
  2850.         else
  2851.        
  2852.             local resource = getResourceFromName( resourceName )
  2853.            
  2854.             if not (resource) then
  2855.                 outputChatBox(exhiba .. "A(z) " .. resourceName .. " resource nem található.", thePlayer, 255, 255, 255, true)
  2856.                 return
  2857.             end
  2858.            
  2859.             local start = startResource(resource)
  2860.             local get = getResourceState(resource)
  2861.            
  2862.             if get == "running" then
  2863.                 outputChatBox(exhiba .. "A(z) " .. resourceName .. " már el van indítva.", thePlayer, 255, 255, 255, true)
  2864.             else
  2865.                 if (start) then
  2866.                     outputAdminMessage("#7cc576".. getPlayerAdminName(thePlayer) .. "#ffffff elindította a(z) #0094ff" .. resourceName .. "#ffffff resourcet.")
  2867.                 else
  2868.                     outputChatBox(exhiba .. "Nem sikerült elindítani a resourcet. Hibakód: START2", thePlayer, 255, 255, 255, true)
  2869.                 end
  2870.             end
  2871.         end
  2872.     end
  2873.  
  2874. end
  2875. addCommandHandler("startres", startRes, false, false)
  2876.  
  2877. ----------------------------------------------------------------------------------------------------------------------------------------
  2878. -- /setpp, /setvip -- KÜLÖNRANGI PARANCSOK
  2879. ----------------------------------------------------------------------------------------------------------------------------------------
  2880.  
  2881. function setPP(thePlayer, commandName, targetPlayer, status, pp)
  2882.     if getElementData(thePlayer, "acc:admin") >= 7 then
  2883.        
  2884.         if not (targetPlayer) or not (status) or not (pp) then
  2885.             outputChatBox("#7cc576Használat:#ffffff /" .. commandName .. " [Név / ID] [1 = Beállítás | 2 = Hozzáadás | 3 = Levonás] [PP érték]", thePlayer, 255, 255, 255, true)
  2886.         else
  2887.            
  2888.             local targetPlayer, targetPlayerName = exports.mta_main:findPlayer(thePlayer, targetPlayer)
  2889.             if not (targetPlayer) then outputChatBox(exhiba .. "Nincs ilyen játékos.", thePlayer, 255, 255, 255, true) return end
  2890.             local status = tonumber(status)
  2891.             local pp = tonumber(pp)
  2892.             if pp < 0 then outputChatBox(exhiba .. "Az értéknek 0 felett kell lennie.", thePlayer, 255, 255, 255, true) return end
  2893.            
  2894.                 if not getElementData(targetPlayer, "loggedin") then return end
  2895.            
  2896.             if (status) > 3 or (status) < 1 then
  2897.                 outputChatBox(exhiba .. "A végrehajtási kódok csak 1 és 3 között vannak", thePlayer, 255, 255, 255, true)
  2898.                 return
  2899.             end
  2900.                
  2901.             local oldPP = getElementData(targetPlayer, "char:pp") or 0
  2902.  
  2903.             if (status) == 1 then
  2904.                 local sql = dbExec(con, "UPDATE characters SET premiumpont='" .. pp .. "' WHERE id='" .. getElementData(targetPlayer, "char:id") .. "'")
  2905.                 if (sql) then
  2906.                     outputChatBox(exinfo .. "Sikeresen beállítottad #7cc576" .. targetPlayerName:gsub("_"," ") .. "#ffffff prémiumpontjainak számát. (" .. pp ..")", thePlayer, 255, 255, 255, true)
  2907.                     outputDeveloperMessage("#7cc576".. getPlayerAdminName(thePlayer) .. "#ffffff beállította #7cc576" .. targetPlayerName:gsub("_"," ") .. "#ffffff prémiumpontjainak számát. #ff9000(" .. pp .. ")")
  2908.                     setElementData(targetPlayer, "char:pp", pp)
  2909.                     --adminlog
  2910.                     local adminlogSql = dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, "acc:id"), "SETPP", getPlayerAdminName(thePlayer) .. " beállította " .. targetPlayerName .. " játékos prémiumpontjainak számát. (".. pp .. ")", targetPlayerName, getElementData(targetPlayer, "char:id"))
  2911.  
  2912.                 end
  2913.             elseif (status) == 2 then
  2914.                 local sql = dbExec(con, "UPDATE characters SET premiumpont='".. getElementData(targetPlayer, "char:pp") + pp .. "' WHERE id='" .. getElementData(targetPlayer, "char:id") .. "'")
  2915.                 if (sql) then
  2916.                     outputChatBox(exinfo .. "Sikeresen megváltoztattad #7cc576" .. targetPlayerName:gsub("_"," ") .. "#ffffff prémiumpontjainak számát. (" .. oldPP .. " => " .. oldPP + pp ..")", thePlayer, 255, 255, 255, true)
  2917.                     outputDeveloperMessage(getPlayerAdminName(thePlayer) .. " megváltoztatta " .. targetPlayerName:gsub("_"," ") .. " prémiumpontjainak számát. (" .. oldPP .. " => " .. oldPP + pp .. ")")
  2918.                     setElementData(targetPlayer, "char:pp", oldPP + pp)            
  2919.                     --adminlog
  2920.                 local adminlogSql = dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, "acc:id"), "SETPP", getPlayerAdminName(thePlayer) .. " megváltoztatta " .. targetPlayerName .. " játékos prémiumpontjainak számát. (" .. oldPP .. " => " .. oldPP + pp .. ")", targetPlayerName, getElementData(targetPlayer, "char:id"))
  2921.  
  2922.                 end
  2923.             elseif (status) == 3 then
  2924.                 local sql = dbExec(con, "UPDATE characters SET premiumpont='".. getElementData(targetPlayer, "char:pp") - pp .. "' WHERE id='" .. getElementData(targetPlayer, "char:id") .. "'")
  2925.                 if (sql) then
  2926.                     outputChatBox(exinfo .. "Sikeresen megváltoztattad #7cc576" .. targetPlayerName:gsub("_"," ") .. "#ffffff prémiumpontjainak számát. (" .. oldPP .. " => " .. oldPP - pp ..")", thePlayer, 255, 255, 255, true)
  2927.                     outputDeveloperMessage(getPlayerAdminName(thePlayer) .. " megváltoztatta " .. targetPlayerName:gsub("_"," ") .. " prémiumpontjainak számát. (" .. oldPP .. " => " .. oldPP - pp .. ")")
  2928.                     setElementData(targetPlayer, "char:pp", oldPP - pp)            
  2929.                     --adminlog
  2930.                 local adminlogSql = dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, "acc:id"), "SETPP", getPlayerAdminName(thePlayer) .. " megváltoztatta " .. targetPlayerName .. " játékos prémiumpontjainak számát. (" .. oldPP .. " => " .. oldPP - pp .. ")", targetPlayerName, getElementData(targetPlayer, "char:id"))
  2931.  
  2932.                 end
  2933.             end
  2934.         end
  2935.     end
  2936. end
  2937. addCommandHandler("setpp", setPP, false, false)
  2938.  
  2939. ----------------------------------------------------------------------------------------------------------------------------------------
  2940. -- /setmoney -- EGYÉB PARANCSOK
  2941. ----------------------------------------------------------------------------------------------------------------------------------------
  2942.  
  2943. function setMoney(thePlayer, commandName, targetPlayer, status, cash)
  2944.     if getElementData(thePlayer, "acc:admin") >= 7 then
  2945.        
  2946.         if not (targetPlayer) or not (status) or not (cash) then
  2947.             outputChatBox("#7cc576Használat:#ffffff /" .. commandName .. " [Név / ID] [1 = Beállítás | 2 = Hozzáadás | 3 = Levonás] [Pénz érték]", thePlayer, 255, 255, 255, true)
  2948.         else
  2949.            
  2950.             local targetPlayer, targetPlayerName = exports.mta_main:findPlayer(thePlayer, targetPlayer)
  2951.             if not (targetPlayer) then outputChatBox(exhiba .. "Nincs ilyen játékos.", thePlayer, 255, 255, 255, true) return end
  2952.             local status = tonumber(status)
  2953.             local cash = tonumber(cash)
  2954.             if cash < 0 then outputChatBox(exhiba .. "Az értéknek 0 felett kell lennie.", thePlayer, 255, 255, 255, true) return end
  2955.            
  2956.                 if not getElementData(targetPlayer, "loggedin") then return end
  2957.            
  2958.             if (status) > 3 or (status) < 1 then
  2959.                 outputChatBox(exhiba .. "A végrehajtási kódok csak 1 és 3 között vannak", thePlayer, 255, 255, 255, true)
  2960.                 return
  2961.             end
  2962.                
  2963.             local oldCash = getElementData(targetPlayer, "char:money") or 0
  2964.            
  2965.             if (status) == 1 then
  2966.                 local sql = dbExec(con, "UPDATE characters SET money='" .. cash .. "' WHERE id='" .. getElementData(targetPlayer, "char:id") .. "'")
  2967.                 if (sql) then
  2968.                     outputChatBox(exinfo .. "Sikeresen beállítottad #7cc576" .. targetPlayerName:gsub("_"," ") .. "#ffffff játékos pénzét. (" .. cash ..")", thePlayer, 255, 255, 255, true)
  2969.                     outputDeveloperMessage("#7cc576".. getPlayerAdminName(thePlayer) .. "#ffffff beállította " .. targetPlayerName:gsub("_"," ") .. " játékos pénzét. (" .. cash .. ")")
  2970.                     setElementData(targetPlayer, "char:money", cash)   
  2971.                     --adminlog
  2972.                     local adminlogSql = dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, "acc:id"), "SETMONEY", getPlayerAdminName(thePlayer) .. " beállította " .. targetPlayerName .. " játékos pénzét. " .. cash .. "", targetPlayerName, getElementData(targetPlayer, "char:id"))
  2973.  
  2974.                 end
  2975.             elseif (status) == 2 then
  2976.                 local sql = dbExec(con, "UPDATE characters SET money='".. getElementData(targetPlayer, "char:money") + cash .. "' WHERE id='" .. getElementData(targetPlayer, "char:id") .. "'")
  2977.                 if (sql) then
  2978.                     outputChatBox(exinfo .. "Sikeresen megváltoztattad #7cc576" .. targetPlayerName:gsub("_"," ") .. "#ffffff játékos pénzét. (" .. oldCash .. " => " .. oldCash + cash ..")", thePlayer, 255, 255, 255, true)
  2979.                     outputDeveloperMessage("#7cc576".. getPlayerAdminName(thePlayer) .. "#ffffff megváltoztatta " .. targetPlayerName:gsub("_"," ") .. " játékos pénzét. (" .. oldCash .. " => " .. oldCash + cash .. ")")
  2980.                     setElementData(targetPlayer, "char:money", oldCash + cash)             
  2981.                     --adminlog
  2982.                 local adminlogSql = dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, "acc:id"), "SETMONEY", getPlayerAdminName(thePlayer) .. " megváltoztatta " .. targetPlayerName .. " játékos pénzét. (" .. oldCash .. " => " .. oldCash + cash .. ")", targetPlayerName, getElementData(targetPlayer, "char:id"))
  2983.                 end
  2984.             elseif (status) == 3 then
  2985.                 local sql = dbExec(con, "UPDATE characters SET money='".. getElementData(targetPlayer, "char:money") - cash .. "' WHERE id='" .. getElementData(targetPlayer, "char:id") .. "'")
  2986.                 if (sql) then
  2987.                     outputChatBox(exinfo .. "Sikeresen megváltoztattad #7cc576" .. targetPlayerName:gsub("_"," ") .. "#ffffff játékos pénzét. (" .. oldCash .. " => " .. oldCash - cash ..")", thePlayer, 255, 255, 255, true)
  2988.                     outputDeveloperMessage("#7cc576".. getPlayerAdminName(thePlayer) .. "#ffffff megváltoztatta " .. targetPlayerName:gsub("_"," ") .. " játékos pénzét. (" .. oldCash .. " => " .. oldCash - cash .. ")")
  2989.                     setElementData(targetPlayer, "char:money", oldCash - cash)             
  2990.                     --adminlog
  2991.                 local adminlogSql = dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, "acc:id"), "SETMONEY", getPlayerAdminName(thePlayer) .. " megváltoztatta " .. targetPlayerName .. " játékos pénzét. (" .. oldCash .. " =>" .. oldCash - cash .. "", targetPlayerName, getElementData(targetPlayer, "char:id"))
  2992.                 end
  2993.             end
  2994.         end
  2995.     end
  2996. end
  2997. addCommandHandler("setmoney", setMoney, false, false)
  2998.  
  2999. function rtcVehicle(thePlayer, commandName)
  3000.     if getElementData(thePlayer, "acc:admin") >=2 then
  3001.    
  3002.     local px, py, pz = getElementPosition(thePlayer)
  3003.    
  3004.     for k, v in ipairs(getElementsByType("vehicle")) do
  3005.         vx, vy, vz = getElementPosition(v)
  3006.         local dist = getDistanceBetweenPoints3D ( px, py, pz, vx, vy, vz )
  3007.         local int, dim = getElementInterior(thePlayer), getElementDimension(thePlayer)
  3008.         local tint, tdim = getElementInterior(v), getElementDimension(v)
  3009.         if dist <= 3 and int == tint and dim == tdim then
  3010.        
  3011.             local vehicleQ = dbQuery(con,"SELECT * FROM vehicle WHERE id='" .. getElementData(v, "veh:id") .. "'")
  3012.             local vehicleH,vehszam = dbPoll(vehicleQ,-1)
  3013.             if #vehicleH > 0 then
  3014.                 for k1,v1 in ipairs(vehicleH) do
  3015.                     pos = fromJSON(v1["pos"])
  3016.                     setElementPosition(v, pos[1], pos[2], pos[3])
  3017.                     setElementInterior(v, pos[4] or 0)
  3018.                     setElementDimension(v, pos[5] or 0)
  3019.                     setElementRotation(v, 0, 0, pos[6] or 0)
  3020.                     setElementData(v, "veh:fuel", 100)
  3021.                     fixVehicle(v)
  3022.                     setVehicleLocked(v, true)
  3023.                     setElementData(v, "veh:light", false)
  3024.                     setVehicleOverrideLights(v, 1)
  3025.                     setElementData(v, "veh:motor", false)
  3026.                     outputChatBox("#D64541[RTC]#ffffff Sikeresen RTC-zted a(z) ID: ".. getElementData(v, "veh:id") .. " járművet.", thePlayer, 255, 255, 255, true)
  3027.                
  3028.                     --adminlog
  3029.                     for k3, v3 in ipairs(getElementsByType("player")) do
  3030.                         if tonumber(getElementData(v3, "acc:admin") or 0) >= 1 and getElementData(v3, "loggedin") then
  3031.                             if getPlayerName(thePlayer) == getPlayerName(v3) then
  3032.                             else
  3033.                                 outputChatBox("#D64541[RTC]#ffffff #7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff respawnolta a(z) ID: " .. getElementData(v, "veh:id") .. " járművet.", v3, 255, 255, 255, true)
  3034.                             end
  3035.                         end
  3036.                     end
  3037.                    
  3038.                 end
  3039.             end
  3040.         end
  3041.     end
  3042.        
  3043.    
  3044.     end
  3045. end
  3046. addCommandHandler("rtc", rtcVehicle, false, false)
  3047.  
  3048.  
  3049. function rtcVehicle2(thePlayer, commandName)
  3050.     if getElementData(thePlayer, "acc:admin") >=2 then
  3051.    
  3052.     local px, py, pz = getElementPosition(thePlayer)
  3053.    
  3054.     for k, v in ipairs(getElementsByType("vehicle")) do
  3055.         vx, vy, vz = getElementPosition(v)
  3056.         local dist = getDistanceBetweenPoints3D ( px, py, pz, vx, vy, vz )
  3057.         if dist <= 5 then
  3058.        
  3059.             local vehicleQ = dbQuery(con,"SELECT * FROM vehicle WHERE id='" .. getElementData(v, "veh:id") .. "'")
  3060.             local vehicleH,vehszam = dbPoll(vehicleQ,-1)
  3061.             if vehicleH then
  3062.                 for k1,v1 in ipairs(vehicleH) do
  3063.                     setElementDimension(v, 2)
  3064.                     local x, y, z =  -2319.1916503906, -1637.2742919922, 483.703125
  3065.                     setElementPosition(v, x, y, z)
  3066.                     setVehicleRespawnPosition(v, x, y, z, 0, 0, 0)
  3067.                     dbExec(con, "UPDATE vehicle SET interior='0', dimension='2', pos='" .. toJSON({x, y, z, 0, 2, 0}) .. "' WHERE id='" .. getElementData(v, "veh:id") .. "'")
  3068.                    
  3069.                     --adminlog
  3070.                     for k3, v3 in ipairs(getElementsByType("player")) do
  3071.                         if tonumber(getElementData(v3, "acc:admin") or 0) >= 1 and getElementData(v3, "loggedin") then
  3072.                             if getPlayerName(thePlayer) == getPlayerName(v3) then
  3073.                             else
  3074.                                 outputChatBox("#D64541[RTC2]#ffffff #7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff áthelyezte a(z) ID: " .. getElementData(v, "veh:id") .. " járművet.", v3, 255, 255, 255, true)
  3075.                             end
  3076.                         end
  3077.                     end
  3078.                    
  3079.                 end
  3080.             end
  3081.         end
  3082.     end
  3083.     end
  3084. end
  3085. addCommandHandler("rtc2", rtcVehicle2, false, false)
  3086.  
  3087. function delJobVehicles(thePlayer)
  3088.     if getElementData(thePlayer, "acc:admin") < 6 then return end
  3089.  
  3090.     for key, value in ipairs(getElementsByType("vehicle")) do
  3091.         local px, py, pz = getElementPosition(thePlayer)
  3092.         local px2, py2, pz2 = getElementPosition(value)
  3093.         if getDistanceBetweenPoints3D(px, py, pz, px2, py2, pz2) <= 5 then
  3094.             if getElementData(value, "veh:id") or 0 < 0 then
  3095.                 setElementDimension(value, 2)
  3096.             end
  3097.         end
  3098.     end
  3099. end
  3100. addCommandHandler("deljobvehs", delJobVehicles, false, false)
  3101.  
  3102. function fly(thePlayer, commandName)
  3103.     if (getElementData(thePlayer, "acc:admin")) >= 1 then
  3104.         triggerClientEvent(thePlayer, "onClientFlyToggle", thePlayer)
  3105.     end
  3106. end
  3107. addCommandHandler("fly", fly, false, false)
  3108.  
  3109. function getPlayerLevel(player, cmd, target)
  3110.     if not target then
  3111.         outputChatBox("#7cc576Használat: #ffffff/"..cmd.." [Név / ID]", player, 0, 0, 0, true)
  3112.         return
  3113.     end
  3114.    
  3115.     local target, targetName = exports["mta_main"]:findPlayer(player, target)
  3116.     if not target then
  3117.         outputChatBox(exhiba.."Nincs ilyen játékos, vagy nincs bejelentkezve.", player, 0, 0, 0, true)
  3118.         return
  3119.     else
  3120.         outputChatBox(exinfo..targetName:gsub("_", " ").." szintje: #7cc576"..exports["mta_score"]:getLevel(target), player, 0, 0, 0, true)
  3121.     end
  3122. end
  3123. addCommandHandler("lvl", getPlayerLevel)
  3124.  
  3125. function getPlayerOldcarID(player)
  3126.     if not getElementData(player, "oldcarID") then
  3127.         outputChatBox(exhiba.."Még nem ültél járműben.", player, 0, 0, 0, true)
  3128.     else
  3129.         outputChatBox(exinfo.."Utolsó kocsi ID-je: #7cc576"..getElementData(player, "oldcarID"), player, 0, 0, 0, true)
  3130.     end
  3131. end
  3132. addCommandHandler("oldcar", getPlayerOldcarID)
  3133.  
  3134. function getPlayerID(player, cmd, target)
  3135.     if not target then
  3136.         outputChatBox("#7cc576Használat: #ffffff/"..cmd.." [Név / ID]", player, 0, 0, 0, true)
  3137.         return
  3138.     end
  3139.    
  3140.     local target, targetName = exports["mta_main"]:findPlayer(player, target)
  3141.     if not target then
  3142.         --outputChatBox(exhiba.."Nincs ilyen játékos, vagy nincs bejelentkezve.", player, 0, 0, 0, true)
  3143.         return
  3144.     else
  3145.         outputChatBox(exinfo..targetName:gsub("_", " ").. " ID-je: #7cc576"..getElementData(target, "playerid"), player, 0, 0, 0, true)
  3146.     end
  3147. end
  3148. addCommandHandler("id", getPlayerID)
  3149.  
  3150. function gotoInterior(thePlayer, commandName, int)
  3151.     if getElementData(thePlayer, "acc:admin") >= 1 then
  3152.    
  3153.         if not (int) then
  3154.             outputChatBox("#7cc576Használat: #ffffff/" .. commandName .. " [Interior ID]", thePlayer, 255, 255, 255, true)
  3155.         else
  3156.  
  3157.         local qh = dbQuery(con, "SELECT * FROM interiors WHERE id='" .. int .. "'")
  3158.         local result, num = dbPoll( qh, -1 )
  3159.        
  3160.         if (num>0) then
  3161.             for _, row in ipairs(result) do
  3162.                  id = row["id"]
  3163.                  x = row["x"]
  3164.                  y = row["y"]
  3165.                  z = row["z"]
  3166.             end
  3167.            
  3168.             setElementPosition(thePlayer, x, y, z)
  3169.             outputChatBox(exinfo .. "Sikeresen elteleportáltál az interiorhoz. (ID: " .. int .. ")", thePlayer, 255, 255, 255, true)
  3170.         else
  3171.             outputChatBox(exhiba .. "Nincs találat.", thePlayer, 255, 255, 255, true)
  3172.            
  3173.         end
  3174.  
  3175.     end
  3176.     end
  3177. end
  3178. addCommandHandler("gotointerior", gotoInterior, false, false)
  3179.  
  3180. function giveLicenses(thePlayer, commandName, targetPlayer, licensz)
  3181.     if getElementData(thePlayer, "acc:admin") >= 5 then
  3182.        
  3183.         if not (targetPlayer) or not (licensz) then
  3184.             outputChatBox("#7cc576Használat: #ffffff/" .. commandName .. " [Név / ID] [1 = Jogosítvány | 2 = Fegyvertartási engedély]", thePlayer, 255, 255, 255, true)
  3185.         else
  3186.            
  3187.             local targetPlayer, targetPlayerName = exports.mta_main:findPlayer(thePlayer, targetPlayer)
  3188.             if not (targetPlayer) then outputChatBox(exhiba .. "Nincs ilyen játékos.", thePlayer, 255, 255, 255, true) return end
  3189.             local licensz = tonumber(licensz)
  3190.                 if not getElementData(targetPlayer, "loggedin") then return end
  3191.            
  3192.             if licensz > 2 or licensz <= 0 then
  3193.                 outputChatBox(exhiba .. "A licensz csak 1 és 2 lehet.", thePlayer, 255, 255, 255, true)
  3194.                 return
  3195.             end
  3196.            
  3197.             if (licensz) == 1 then
  3198.                 setElementData(targetPlayer, "char:drivingLicense", 1)
  3199.                  license = toJSON({1,getElementData(targetPlayer, "char:fegyverengedely")})
  3200.                  sql = dbExec(con, "UPDATE characters SET License='".. license .. "' WHERE id='" .. getElementData(targetPlayer, "char:id") .. "'")
  3201.                
  3202.                 if (sql) then
  3203.                     outputChatBox(exinfo .. "Sikeresen adtál jogosítványt #7cc576" .. targetPlayerName:gsub("_"," ") .. "#ffffff játékosnak.", thePlayer, 255, 255, 255, true)
  3204.                     outputChatBox(exinfo .. "#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff adott neked jogosítványt.", targetPlayer, 255, 255, 255, true)
  3205.                     outputAdminMessage("#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff adott " .. targetPlayerName:gsub("_"," ") .. " játékosnak jogosítványt.")
  3206.                     dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, "acc:id"), "GIVELICENSES", "" .. getPlayerAdminName(thePlayer) .. " adott " .. targetPlayerName:gsub("_"," ") .. " játékosnak jogosítványt.", targetPlayerName, getElementData(targetPlayer, "acc:id"))
  3207.                 else
  3208.                     outputChatBox(exhiba .. "Nem sikerült jogosítványt adni a játékosnak. Hibakód: GIVELICENSES1", thePlayer, 255, 255, 255, true)
  3209.                 end
  3210.             elseif (licensz) == 2 then
  3211.                 if getElementData(thePlayer, "acc:admin") >= 6 then
  3212.                    
  3213.                     setElementData(targetPlayer, "char:fegyverengedely", 1)
  3214.                     license = toJSON({getElementData(targetPlayer, "char:drivingLicense"),1})
  3215.                     sql = dbExec(con, "UPDATE characters SET License='".. license .. "' WHERE id='" .. getElementData(targetPlayer, "char:id") .. "'")
  3216.                    
  3217.                     if (sql) then
  3218.                         outputChatBox(exinfo .. "Sikeresen adtál fegyvertartási engedélyt #7cc576" .. targetPlayerName:gsub("_"," ") .. "#ffffff játékosnak.", thePlayer, 255, 255, 255, true)
  3219.                         outputChatBox(exinfo .. "#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff adott neked fegyvertartási engedélyt.", targetPlayer, 255, 255, 255, true)
  3220.                         outputAdminMessage("#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff adott " .. targetPlayerName:gsub("_"," ") .. " játékosnak fegyvertartási engedélyt.")
  3221.                         dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, "acc:id"), "GIVELICENSES", "" .. getPlayerAdminName(thePlayer) .. " adott " .. targetPlayerName:gsub("_"," ") .. " játékosnak fegyvertartási engedélyt.", targetPlayerName, getElementData(targetPlayer, "acc:id"))
  3222.                     else
  3223.                         outputChatBox(exhiba .. "Nem sikerült fegyvertartási engedélyt adni a játékosnak. Hibakód: GIVELICENSES2", thePlayer, 255, 255, 255, true)
  3224.                     end
  3225.                 end
  3226.             end
  3227.         end
  3228.     end
  3229. end
  3230. addCommandHandler("givelicenses", giveLicenses, false, false)
  3231.  
  3232. function showLicenses(thePlayer, commandName, targetPlayer)
  3233.     if getElementData(thePlayer, "loggedin") then
  3234.        
  3235.         if not (targetPlayer) then
  3236.             outputChatBox("#7cc576Használat: #ffffff/" .. commandName .. " [Név / ID] ", thePlayer, 255, 255, 255, true)
  3237.         else
  3238.             local targetPlayer, targetPlayerName = exports.mta_main:findPlayer(thePlayer, targetPlayer)
  3239.            
  3240.             if (targetPlayer) then
  3241.                
  3242.                 local x, y, z = getElementPosition(thePlayer)
  3243.                 local x1, y1, z1 = getElementPosition(targetPlayer)
  3244.                
  3245.                 local dist = getDistanceBetweenPoints3D( x, y, z, x1, y1, z1 )
  3246.                
  3247.                 if (dist<10) then
  3248.                
  3249.                     sendLocalMeAction(thePlayer, "felmutatja az engedélyeit " .. targetPlayerName:gsub("_"," ") .. "-nak/nek.")
  3250.                     outputChatBox("-------------------------------------------------------------------------", targetPlayer, 150, 150, 150, true)
  3251.                     outputChatBox("#0094ff" .. getPlayerName(thePlayer) .. "#ffffff játékos engedélyei:", targetPlayer, 255, 255, 255, true)
  3252.                    
  3253.                     local jogsi = getElementData(thePlayer, "char:drivingLicense")
  3254.                     local fegyver = getElementData(thePlayer, "char:fegyverengedely")
  3255.                         if jogsi == 1 then
  3256.                             p = "#7cc576Van"
  3257.                         else
  3258.                             p = "#dc143cNincs"
  3259.                         end
  3260.                
  3261.                         if fegyver == 1 then
  3262.                             r = "#7cc576Van"
  3263.                         else
  3264.                             r = "#dc143cNincs"
  3265.                         end
  3266.                     outputChatBox("#ffffffJárművezetői engedély: " .. p, targetPlayer, 255, 255, 255, true)
  3267.                     outputChatBox("#ffffffFegyvertartási engedély: " .. r, targetPlayer, 255, 255, 255, true)
  3268.                     outputChatBox("-------------------------------------------------------------------------", targetPlayer, 150, 150, 150, true)
  3269.                 else
  3270.                     outputChatBox(exhiba .. "Túl messze vagy a játékostól.", thePlayer, 255, 255, 255, true)               
  3271.                 end
  3272.             else
  3273.                 outputChatBox(exhiba .. "Nincs ilyen játékos.", thePlayer, 255, 255, 255, true)
  3274.             end
  3275.         end
  3276.     end
  3277. end
  3278. addCommandHandler("showlicenses", showLicenses, false, false)
  3279.  
  3280. function takeLicenses(thePlayer, commandName, targetPlayer, licensz)
  3281.     if getElementData(thePlayer, "acc:admin") >= 5 then
  3282.        
  3283.         if not (targetPlayer) or not (licensz) then
  3284.             outputChatBox("#7cc576Használat: #ffffff/" .. commandName .. " [Név / ID] [1 = Jogosítvány | 2 = Fegyvertartási engedély]", thePlayer, 255, 255, 255, true)
  3285.         else
  3286.            
  3287.             local targetPlayer, targetPlayerName = exports.mta_main:findPlayer(thePlayer, targetPlayer)
  3288.             if not (targetPlayer) then outputChatBox(exhiba .. "Nincs ilyen játékos.", thePlayer, 255, 255, 255, true) return end
  3289.             local licensz = tonumber(licensz)
  3290.            
  3291.                 if not getElementData(targetPlayer, "loggedin") then return end
  3292.            
  3293.             if licensz > 2 or licensz <= 0 then
  3294.                 outputChatBox(exhiba .. "A licensz csak 1 és 2 lehet.", thePlayer, 255, 255, 255, true)
  3295.                 return
  3296.             end
  3297.            
  3298.             if (licensz) == 1 then
  3299.                 setElementData(targetPlayer, "char:drivingLicense", 0)
  3300.                 local license = toJSON({0,0})
  3301.                 local sql = dbExec(con, "UPDATE characters SET License='".. license .. "' WHERE id='" .. getElementData(targetPlayer, "char:id") .. "'")
  3302.                
  3303.                 if (sql) then
  3304.                     outputChatBox(exinfo .. "Sikeresen elvetted a jogosítványt #7cc576" .. targetPlayerName:gsub("_"," ") .. "#ffffff játékostól.", thePlayer, 255, 255, 255, true)
  3305.                     outputChatBox(exinfo .. "#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff elvette a jogosítványodat.", targetPlayer, 255, 255, 255, true)
  3306.                     outputAdminMessage("#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff elvette " .. targetPlayerName:gsub("_"," ") .. " játékosnak a jogosítványát.")
  3307.                     dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, "acc:id"), "TAKELICENSES", "" .. getPlayerAdminName(thePlayer) .. " elvette " .. targetPlayerName:gsub("_"," ") .. " játékos jogosítványát.", targetPlayerName, getElementData(targetPlayer, "acc:id"))
  3308.                 else
  3309.                     outputChatBox(exhiba .. "Nem sikerült jogosítványt elvenni a játékostól. Hibakód: TAKELICENSES1", thePlayer, 255, 255, 255, true)
  3310.                 end
  3311.             elseif (licensz) == 2 then
  3312.                 if getElementData(thePlayer, "acc:admin") >= 6 then
  3313.                     setElementData(targetPlayer, "char:fegyverengedely", 0)
  3314.                     license = toJSON({getElementData(targetPlayer, "char:drivingLicense"),0})
  3315.                     sql = dbExec(con, "UPDATE characters SET License='".. license .. "' WHERE id='" .. getElementData(targetPlayer, "char:id") .. "'")
  3316.                    
  3317.                     if (sql) then
  3318.                         outputChatBox(exinfo .. "Sikeresen elvetted a fegyvertartási engedélyt #7cc576" .. targetPlayerName:gsub("_"," ") .. "#ffffff játékostól.", thePlayer, 255, 255, 255, true)
  3319.                         outputChatBox(exinfo .. "#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff elvette a fegyvertartási engedélyedet.", targetPlayer, 255, 255, 255, true)
  3320.                         outputAdminMessage("#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff elvette " .. targetPlayerName:gsub("_"," ") .. " játékosnak a fegyvertartási engedélyét.")
  3321.                         dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, "acc:id"), "TAKELICENSES", "" .. getPlayerAdminName(thePlayer) .. " elvette " .. targetPlayerName:gsub("_"," ") .. " játékos fegyvertartási engedélyét.", targetPlayerName, getElementData(targetPlayer, "acc:id"))
  3322.                     else
  3323.                         outputChatBox(exhiba .. "Nem sikerült jogosítványt elvenni a játékostól. Hibakód: TAKELICENSES2", thePlayer, 255, 255, 255, true)
  3324.                     end
  3325.                 end
  3326.             end
  3327.         end
  3328.     end
  3329. end
  3330. addCommandHandler("takelicenses", takeLicenses, false, false)
  3331.  
  3332. function vhSpawn(thePlayer, commandName, targetPlayer)
  3333.     if getElementData(thePlayer, "acc:admin") >= 1 then
  3334.        
  3335.         if not (targetPlayer) then
  3336.             outputChatBox("#7cc576Használat:#ffffff /" .. commandName .. " [Név / ID]", thePlayer, 255, 255, 255, true)
  3337.         else
  3338.                
  3339.             local targetPlayer, targetPlayerName = exports.mta_main:findPlayer(thePlayer, targetPlayer)
  3340.             local x, y, z =  1303.1094970703, -1378.1195068359, 13.687502861023
  3341.             local int = 0
  3342.             local dim = 0
  3343.            
  3344.                 if not getElementData(targetPlayer, "loggedin") then return end
  3345.            
  3346.             if isPedInVehicle(targetPlayer) then
  3347.                 removePedFromVehicle(targetPlayer)
  3348.             end
  3349.            
  3350.             if not (targetPlayer) then
  3351.                 outputChatBox(exhiba .. "Nincs ilyen játékos.", thePlayer, 255, 255, 255, true)
  3352.                 return
  3353.             end
  3354.            
  3355.             if getElementData(targetPlayer, "adminjail") == 1 and not getElementData(thePlayer, "acc:admin") >= 6 then  outputChatBox("#dc143c[Hiba]:#ffffff Nincs jogosultságod a játékost a városházára teleportálni. (Jailben van.)", targetPlayer, 255, 255, 255, true) return end
  3356.            
  3357.             local teleport = setElementPosition(targetPlayer, x, y, z), setElementInterior(targetPlayer, int), setElementDimension(targetPlayer, dim)
  3358.            
  3359.             if (teleport) then
  3360.                 outputChatBox("#ffffffSikeresen elteleportáltad #7cc576" .. targetPlayerName:gsub("_"," ") .. "#ffffff játékost a városházára.", thePlayer, 255, 255, 255, true)
  3361.                 outputChatBox(" #7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff elteleportált téged a #0094ffvárosházára#ffffff.", targetPlayer, 255, 255, 255, true)
  3362.                 outputAdminMessage("#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff elteleportálta " .. targetPlayerName:gsub("_"," ") .. " játékost a városházára.")
  3363.             else
  3364.                 outputChatBox(exhiba .. "Nem sikerült a játékost elteleportálni a városházára. Hibakód: VHSPAWN1", thePlayer, 255, 255, 255, true)
  3365.             end
  3366.         end
  3367.     end
  3368. end
  3369. addCommandHandler("vhspawn", vhSpawn, false, false)
  3370.  
  3371. addEvent( "gotoMark", true )
  3372. addEventHandler( "gotoMark", getRootElement( ),
  3373.     function( x, y, z, interior, dimension, name )
  3374.         if type( x ) == "number" and type( y ) == "number" and type( z ) == "number" and type( interior ) == "number" and type( dimension ) == "number" then
  3375.             if getElementData ( client, "loggedin" ) and getElementData(client, "acc:admin") >= 1 then             
  3376.                 setTimer(function(client)
  3377.                
  3378.                     local vehicle = nil
  3379.                     local seat = nil
  3380.                
  3381.                     if(isPedInVehicle ( client )) then
  3382.                          vehicle =  getPedOccupiedVehicle ( client )
  3383.                         seat = getPedOccupiedVehicleSeat ( client )
  3384.                     end
  3385.                    
  3386.                     if(vehicle and (seat ~= 0)) then
  3387.                         removePedFromVehicle (client )
  3388.                    
  3389.                         setElementPosition(client, x, y, z)
  3390.                         setElementInterior(client, interior)
  3391.                         setElementDimension(client, dimension)
  3392.                     elseif(vehicle and seat == 0) then
  3393.                         removePedFromVehicle (client )
  3394.                        
  3395.                         setElementPosition(vehicle, x, y, z)
  3396.                         setElementInterior(vehicle, interior)
  3397.                         setElementDimension(vehicle, dimension)
  3398.                         warpPedIntoVehicle ( client, vehicle, 0)
  3399.                     else
  3400.                         setElementPosition(client, x, y, z)
  3401.                         setElementInterior(client, interior)
  3402.                         setElementDimension(client, dimension)
  3403.                     end
  3404.                    
  3405.                     name = name or ""
  3406.                    
  3407.                     outputChatBox( "#7cc576[ExGaming - Teleport]:#ffffff Sikeresen elteleportáltál a(z) #0094ff".. name .. "#ffffff helyszínre.", client, 0, 255, 0, true )
  3408.                
  3409.                 end, 50, 1, client)
  3410.            
  3411.             end
  3412.         end
  3413.     end
  3414. )
  3415.  
  3416. function sendLocalText(root, message, r, g, b, distance, exclude)
  3417.     exclude = exclude or {}
  3418.     local x, y, z = getElementPosition(root)
  3419.        
  3420.     local shownto = 0
  3421.     for index, nearbyPlayer in ipairs(getElementsByType("player")) do
  3422.         if isElement(nearbyPlayer) and getDistanceBetweenPoints3D(x, y, z, getElementPosition(nearbyPlayer)) < ( distance or 20 ) then
  3423.             local logged = getElementData(nearbyPlayer, "loggedin")
  3424.             if not exclude[nearbyPlayer] and not isPedDead(nearbyPlayer) and logged and getElementDimension(root) == getElementDimension(nearbyPlayer) then
  3425.                 outputChatBox(message, nearbyPlayer, r, g, b,true)
  3426.                 shownto = shownto + 1
  3427.             end
  3428.         end
  3429.     end
  3430. end
  3431.  
  3432. function sendLocalMeAction(thePlayer, message)
  3433.     sendLocalText(thePlayer, " ***" .. getPlayerName(thePlayer):gsub("_", " ") .. ( message:sub( 1, 1 ) == "'" and "" or " " ) .. message, 194, 162, 218)
  3434.     triggerClientEvent("onMessageIncome",thePlayer,"***"..message,2)
  3435. end
  3436.  
  3437. function saveSqlFegyver(player, status)
  3438.     if isElement(player) then
  3439.         local jogsi = getElementData(player, "char:drivingLicense")
  3440.         local save = toJSON({jogsi, 1})
  3441.         local sql = dbExec(con, "UPDATE characters SET License = ? WHERE id='" .. getElementData(player, "char:id") .. "'", save)
  3442.         if (sql) then
  3443.             --outputChatBox(getPlayerName(player) .. " fegyvertartási engedélye mentve lett.")
  3444.         end
  3445.     end
  3446. end
  3447. addEvent("fegyverengMentes", true)
  3448. addEventHandler("fegyverengMentes", getRootElement(), saveSqlFegyver)
  3449.  
  3450. function thisCar(thePlayer)
  3451.     if getElementData(thePlayer, "loggedin") then
  3452.    
  3453.         local veh = getPedOccupiedVehicle(thePlayer)
  3454.         if isPedInVehicle(thePlayer) then
  3455.             if (veh) then
  3456.                 outputChatBox(exinfo .. "A járműved azonosítója: #7cc576" .. getElementData(veh, "veh:id") or "ismeretlen" .. "", thePlayer, 255, 255, 255, true)
  3457.             end
  3458.         else
  3459.             outputChatBox(exhiba .. "Nem vagy járműben.", thePlayer, 255, 255, 255, true)
  3460.         end
  3461.     end
  3462. end
  3463. addCommandHandler("thiscar", thisCar, false, false)
  3464.  
  3465.    
  3466. function gluePlayer(slot, vehicle, x, y, z, rotX, rotY, rotZ)
  3467.     attachElements(source, vehicle, x, y, z, rotX, rotY, rotZ)
  3468.     outputChatBox(exinfo .. "Hozzátapadtál a(z) #7cc576ID: " .. getElementData(vehicle, "veh:id") .. "#ffffff járműhöz.", source, 255, 255, 255, true)
  3469. end
  3470. addEvent("gluePlayer",true)
  3471. addEventHandler("gluePlayer",getRootElement(),gluePlayer)
  3472.  
  3473. function ungluePlayer(vehicle)
  3474.     detachElements(source)
  3475.     outputChatBox(exinfo .. "Lecsatlakoztál a(z) #7cc576ID: ismeretlen#ffffff járműről.", source, 255, 255, 255, true)
  3476. end
  3477. addEvent("ungluePlayer",true)
  3478. addEventHandler("ungluePlayer",getRootElement(),ungluePlayer)
  3479.  
  3480. local serial = {
  3481.     ["C7252D87015CFD6761B2B6EDC048C5A3"]=true,
  3482.     --["8BD226E96EABCCB6B3C5F5A79FFDA554"]=true,
  3483. }
  3484.  
  3485. function blowVeh(thePlayer, commandName, targetPlayer)
  3486.     if getElementData(thePlayer, "acc:admin") >= 8 then
  3487.    
  3488.         if not (targetPlayer) then
  3489.             outputChatBox("#7cc576Használat:#ffffff /" .. commandName .. " [Név / ID]", thePlayer, 255, 255, 255, true)
  3490.         else
  3491.        
  3492.             local targetPlayer, targetPlayerName = exports.mta_main:findPlayer(thePlayer, targetPlayer)
  3493.            
  3494.             if not (targetPlayer) then outputChatBox(exhiba .. "Nincs ilyen játékos.", thePlayer, 255, 255, 255, true) return end
  3495.            
  3496.             if not serial[getPlayerSerial(targetPlayer)] then
  3497.                 if isPedInVehicle(targetPlayer) then
  3498.                     local veh = getPedOccupiedVehicle(targetPlayer)
  3499.                     if (veh) then
  3500.                         if blowVehicle(veh) then
  3501.                             outputChatBox(exinfo .. "Puff.", thePlayer, 255, 255, 255, true)
  3502.                             for i, v in ipairs(getElementsByType("player")) do
  3503.                                 if tonumber(getElementData(v, "acc:admin") or 0) >= 8 then
  3504.                                     if getPlayerName(thePlayer) ~= getPlayerName(v) then
  3505.                                         outputChatBox("#dc143c[BLOW]#ffffff#7cc576 " .. getPlayerAdminName(thePlayer) .. "#ffffff felrobbantotta #7cc576" .. getPlayerName(targetPlayer) .. "#ffffff -t.", v, 255, 255,255, true)
  3506.                                     end
  3507.                                 end
  3508.                             end
  3509.                         end
  3510.                     end
  3511.                 end
  3512.             else
  3513.                 kickPlayer(thePlayer, "A kurva anyád akard felrobbantottani. !!! FASZOPÓGECI")
  3514.             end
  3515.         end
  3516.     end
  3517. end
  3518. addCommandHandler("blowveh", blowVeh, false, false)
  3519.  
  3520. function setGuardLevel(thePlayer, commandName, targetPlayer, rank)
  3521.     if getElementData(thePlayer, "acc:admin") >= 8 then
  3522.    
  3523.         if not (rank) then
  3524.             outputChatBox("#7cc576Használat:#ffffff /" .. commandName .. " [Név / ID] [Rang]", thePlayer, 255, 255, 255, true)
  3525.         else
  3526.        
  3527.             local targetPlayer, targetPlayerName = exports.mta_main:findPlayer(thePlayer, targetPlayer)
  3528.             local rank = tonumber(rank)
  3529.            
  3530.             if rank >= 0 and rank <= 3 then
  3531.                
  3532.                 setElementData(targetPlayer, "acc:guard", rank)
  3533.                 if dbExec(con, "UPDATE accounts SET guard='" .. rank .. "' WHERE id='" .. getElementData(targetPlayer, "acc:id") .. "'") then
  3534.                     outputChatBox(exinfo .. "Megváltoztattad #7cc576" .. targetPlayerName:gsub("_"," ") .. "#ffffff játékos guard szintjét. #0094ff(" .. rank .. ")", thePlayer, 255, 255, 255, true)
  3535.                     outputChatBox(exinfo .. "#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff megváltoztatta a guard szinted. #0094ff(" .. rank .. ")", targetPlayer, 255, 255, 255, true)
  3536.                    
  3537.                     for k, v in ipairs(getElementsByType("player")) do
  3538.                         if tonumber(getElementData(v, "acc:admin") or 0) >= 7 and getElementData(v, "loggedin") then
  3539.                             outputChatBox("#D64541[Guard]#ffffff #7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff megváltoztatta #7cc576" .. targetPlayerName:gsub("_"," ") .. "#ffffff játékos guard szintjét. #0094ff(" .. rank .. ")", v,255, 255, 255, true)
  3540.                         end
  3541.                     end
  3542.                    
  3543.                 end
  3544.             else
  3545.                 outputChatBox(exhiba .. "A rangok 0 és 3 között vannak.", thePlayer, 255, 255, 255, true)
  3546.             end
  3547.         end
  3548.     end
  3549. end
  3550. addCommandHandler("setguardlevel", setGuardLevel, false, false)
  3551.  
  3552. function getGuards(thePlayer, commandName)
  3553.     if getElementData(thePlayer, "acc:admin") >= 7 then
  3554.        
  3555.         local count = 0
  3556.         outputChatBox(" ", thePlayer)
  3557.         for k, v in ipairs(getElementsByType("player")) do
  3558.             if tonumber(getElementData(v, "acc:guard") or 0) > 0 and getElementData(v, "loggedin") then
  3559.                 outputChatBox("#7cc576" .. getPlayerName(v) .. "#ffffff | Szint: #0094ff" .. getElementData(v, "acc:guard") or 0 .. "", thePlayer, 255, 255, 255, true)
  3560.                 count = count + 1
  3561.             end
  3562.         end
  3563.         if count == 0 then
  3564.             outputChatBox("#dc143c[Hiba]:#ffffff Nincs elérhető RP Őr.", thePlayer, 255, 255, 255, true)
  3565.         else
  3566.             outputChatBox("#0094ff[Információ]:#ffffff Jelenleg #7cc576" .. count .. "#ffffff elérhető RP Őr van.", thePlayer, 255, 255, 255, true)
  3567.         end
  3568.     end
  3569. end
  3570. addCommandHandler("guards", getGuards, false, false)
  3571.  
  3572. function guardChat(thePlayer, commandName, ...)
  3573.     if tonumber(getElementData(thePlayer, "acc:guard") or 0) > 0 or getElementData(thePlayer, "acc:admin") >= 7 then
  3574.    
  3575.         if not (...) then
  3576.             outputChatBox("#7cc576Használat:#ffffff /" .. commandName .. " [Üzenet]", thePlayer, 255, 255, 255, true)
  3577.         else
  3578.        
  3579.             local msg = table.concat({...}, " ")
  3580.            
  3581.             for k, v in ipairs(getElementsByType("player")) do
  3582.                 if tonumber(getElementData(v, "acc:guard") or 0) > 0 or tonumber(getElementData(v, "acc:admin") or 0) >= 7 then
  3583.                     if tonumber(getElementData(thePlayer, "acc:guard")) > 0 then
  3584.                         before = getPlayerName(thePlayer)
  3585.                     else
  3586.                         before = getPlayerAdminName(thePlayer)
  3587.                     end
  3588.                     outputChatBox("#2574A9[Guard chat] #7cc576" .. before .. ":#ffffff ".. msg, v, 255, 255, 255, true)
  3589.                 end
  3590.             end
  3591.         end
  3592.     end
  3593. end
  3594. addCommandHandler("gd", guardChat, false, false)
  3595.  
  3596. addCommandHandler("setpassword", function(player, _, ...)
  3597.     if getElementData(player, "acc:admin") >= 8 then
  3598.         local text = table.concat({...}, " ")
  3599.        
  3600.         setServerPassword(text)
  3601.        
  3602.         outputDebugString("New password: " .. text, 0, 243, 85, 85)
  3603.     end
  3604. end)
  3605.  
  3606. function setServerMaxPlayers(thePlayer, commandName, newSlot)
  3607.     if getElementData(thePlayer, "acc:admin") >= 8 then
  3608.         if newSlot then
  3609.             setMaxPlayers(newSlot)
  3610.             outputAdminMessage("A szerver játékos limitje átállítva " .. newSlot .. " főre.")
  3611.         else
  3612.             outputChatBox("#7cc576Használat:#ffffff /" .. commandName .. " [Slot szám]", thePlayer, 255, 255, 255, true)
  3613.         end
  3614.     end
  3615. end
  3616. addCommandHandler("setslot", setServerMaxPlayers)
  3617.  
  3618. function outputChange(dataName,oldValue)
  3619.     if getElementType(source) == "player" then -- check if the element is a player
  3620.         if dataName == "char:money" then
  3621.             if exports["mta_score"]:getLevel(source) <= 5 then
  3622.                 if getElementData(source, "char:money") >= 100000 then
  3623.                     for k, v in ipairs(getElementsByType("player")) do
  3624.                         if tonumber(getElementData(v, "acc:admin") or 0) >= 8 and getElementData(v, "loggedin") then
  3625.                             outputChatBox("#ff0000[HackCheck] #ffffff#7cc576" .. getPlayerName(source) .. "#ffffff készpénze túl magas #0094ff(" .. convertNumber(getElementData(source, "char:money")) .. "$)", v, 255, 255, 255, true)
  3626.                         end
  3627.                     end
  3628.                 end
  3629.             end
  3630.         elseif dataName == "char:bankmoney" then
  3631.             if exports["mta_score"]:getLevel(source) <= 5 then
  3632.                 if getElementData(source, "char:bankmoney") >= 100000 then
  3633.                     for k, v in ipairs(getElementsByType("player")) do
  3634.                         if tonumber(getElementData(v, "acc:admin") or 0) >= 8 and getElementData(v, "loggedin") then
  3635.                             outputChatBox("#ff0000[HackCheck] #ffffff#7cc576" .. getPlayerName(source) .. "#ffffff banki pénze túl magas #0094ff(" .. convertNumber(getElementData(source, "char:bankmoney")) .. "$)", v, 255, 255, 255, true)
  3636.                         end
  3637.                     end
  3638.                 end
  3639.             end
  3640.         end
  3641.     end
  3642. end
  3643. addEventHandler("onElementDataChange",getRootElement(),outputChange)
  3644.  
  3645. function convertNumber ( number )  
  3646.     local formatted = number  
  3647.     while true do      
  3648.         formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1.%2')    
  3649.         if ( k==0 ) then      
  3650.             break  
  3651.         end  
  3652.     end  
  3653.     return formatted
  3654. end
  3655.  
  3656. function asdasd(thePlayer, commandName, level)
  3657.     if level and tonumber(getElementData(thePlayer, "acc:admin") or 0) >= 1 then
  3658.         if isPedInVehicle(thePlayer) then
  3659.             outputChatBox("szint: " .. level, thePlayer)
  3660.             local veh = getPedOccupiedVehicle(thePlayer)
  3661.             setElementData(veh, "veh:fuel", tonumber(level))
  3662.         end
  3663.     end
  3664. end
  3665. addCommandHandler("setfuel", asdasd)
  3666.  
  3667. function togAll(thePlayer)
  3668.     if getElementData(thePlayer, "loggedin") then
  3669.        
  3670.         if getElementData(thePlayer, "toggle-->All") == true then
  3671.             setElementData(thePlayer, "toggle-->All", false)
  3672.             outputChatBox("#0094ff[Információ]:#ffffff Kikapcsoltad a komponenseket.", thePlayer, 255, 255, 255, true)
  3673.         else
  3674.             setElementData(thePlayer, "toggle-->All", true)
  3675.             outputChatBox("#0094ff[Információ]:#ffffff Bekapcsoltad a komponenseket.", thePlayer, 255, 255, 255, true)
  3676.         end
  3677.        
  3678.     end
  3679. end
  3680. addCommandHandler("togall", togAll)
  3681.  
  3682. function getPlayerStats(thePlayer, commandName, targetPlayer)
  3683.     if tonumber(getElementData(thePlayer, "acc:admin") or 0) >= 1 then
  3684.        
  3685.         if targetPlayer then
  3686.             local targetPlayer, targetPlayerName = exports.mta_main:findPlayer(thePlayer, targetPlayer)
  3687.             if not (targetPlayer) then
  3688.                 outputChatBox("#dc143c[Hiba]:#ffffff Nincs ilyen játékos.", thePlayer, 255, 255, 255, true)
  3689.                 return
  3690.             end
  3691.             showingPlayer = targetPlayer
  3692.         else
  3693.             showingPlayer = thePlayer
  3694.         end
  3695.         triggerClientEvent(thePlayer, "onStatsCreate", thePlayer, showingPlayer)
  3696.     end
  3697. end
  3698. addCommandHandler("stats", getPlayerStats, false, false)
  3699.  
  3700. function setPlateText(thePlayer, commandName, vehicleID, ...)
  3701.     if tonumber(getElementData(thePlayer, "acc:admin") or 0) >= 8 then
  3702.         if not (vehicleID) or not (...) then
  3703.             outputChatBox("#7cc576Használat:#ffffff /" .. commandName .. " [Jármű ID] [Rendszám]", thePlayer ,255, 255, 255, true)
  3704.         else
  3705.    
  3706.             local vehicleID = tonumber(vehicleID)
  3707.             for k, v in ipairs(getElementsByType("vehicle")) do
  3708.                 if getElementData(v, "veh:id") == vehicleID then
  3709.                     veh = v
  3710.                 end
  3711.             end
  3712.             if not veh then outputChatBox(exhiba .. "Nincs találat a járműre.", thePlayer, 255, 255, 255, true) return end
  3713.             if veh then
  3714.                 local msg = table.concat({...}, " ")
  3715.                 if string.len(msg) > 8 then outputChatBox(exhiba .. "A rendszám maximum 8 karakter lehet.", thePlayer, 255, 255, 255, true) return end
  3716.                
  3717.                 local query = dbQuery(con, "SELECT * FROM vehicle WHERE rendszam='" .. msg .. "'")
  3718.                 local results = dbPoll(query, -1)
  3719.                 if #results > 0 then outputChatBox(exhiba .. "Már van ilyen rendszámú jármű.", thePlayer, 255, 255, 255, true) return end
  3720.                
  3721.                 setVehiclePlateText(veh, msg)
  3722.                 dbExec(con, "UPDATE vehicle SET rendszam='" .. msg .. "' WHERE id='" .. getElementData(veh, "veh:id") .. "'")
  3723.                 outputAdminMessage("#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff megváltoztatta az ID: #0094ff" .. vehicleID .. "#ffffff jármű rendszámát. (" .. msg .. ")")
  3724.             end
  3725.             end
  3726.     end
  3727. end
  3728. addCommandHandler("setplate", setPlateText, false, false)
  3729.  
  3730. function setTimeAd(thePlayer, commandName, time)
  3731.     if getElementData(thePlayer, "acc:admin") >= 8 then
  3732.         if not tonumber(time) then
  3733.             outputChatBox("#7cc576Használat:#ffffff /" .. commandName .. " [Idő]", thePlayer, 255, 255, 255, true)
  3734.         else
  3735.             setTime(time, 0)
  3736.             outputAdminMessage("#7cc576" .. getPlayerAdminName(thePlayer) .. "#ffffff megváltoztatta a játék idejét. (" .. time .. " óra)")   
  3737.         end
  3738.     end
  3739. end
  3740. --addCommandHandler("settime", setTimeAd)
  3741.  
  3742. local rovid = "#7cc576[ExternalGaming - Inventory]:#FFFFFF"
  3743. addCommandHandler("giveitem",
  3744.     function(playerSource, cmd, id, item, value, count)
  3745.         if (getElementData(playerSource,"acc:admin") >= 6) then
  3746.             if id and item and value and count then
  3747.                 local targetPlayer, targetPlayerName = exports["mta_main"]:findPlayer(playerSource, id)            
  3748.                 if targetPlayer then
  3749.                     if exports["mta_item"]:giveItem(targetPlayer, tonumber(item), tostring(value), tonumber(count), 0) then -- 0 -> dutyitem
  3750.                         outputChatBox(rovid.. " Adott egy itemet neked: #7cc576".. getElementData(playerSource,"char:anick") .."#ffffff (" ..exports["mta_item"]:getItemName(tonumber(item))..")", targetPlayer,255,255,255,true)              
  3751.                         outputChatBox(rovid.. " Adtál egy itemet neki: #7cc576".. targetPlayerName:gsub("_", " ") .."#ffffff (" ..exports["mta_item"]:getItemName(tonumber(item))..")", playerSource,255,255,255,true)            
  3752.                         dbExec(con, adminlog, getElementData(playerSource, "char:anick"), getElementData(playerSource, "acc:id"), "GIVEITEM", getElementData(playerSource, "char:anick") .. " adott " .. count .. " db " .. exports["mta_item"]:getItemName(tonumber(item)) .. " -t. Érték: " .. value .. "", getPlayerName(targetPlayer), getElementData(targetPlayer, "acc:id"))
  3753.                         exports.mta_admin:outputDeveloperMessage("#7cc576" .. getElementData(playerSource, "char:anick") .. "#ffffff adott " .. count .. " darab " .. exports["mta_item"]:getItemName(tonumber(item)) .. " -t #7cc576" .. targetPlayerName .. "#ffffff játékosnak.")
  3754.                     else
  3755.                         outputChatBox("#D24D57[ExternalGaming - Inventory] #ffffffNem fér el több tárgy az adott játékosnál!!", playerSource, 255 ,255, 255, true)
  3756.                     end
  3757.                 end
  3758.             else
  3759.                 outputChatBox(rovid.." /"..cmd.." [Név / ID] [Itemid] [Érték] [Db]", playerSource,255,255,255,true) 
  3760.             end
  3761.         end
  3762.     end
  3763. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement