addCommandHandler("kick", function(plr,cmd,cel,...)
if getAdmin(plr,4) or getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1) then
local reason = table.concat({...}, " ")
if not cel or not reason then
outputChatBox("* U?ycie: /kick <nick/ID> <pow?d>", plr)
return
end
local target = exports["ogrpg-core"]:findPlayer(plr,cel)
if not target then
triggerClientEvent(plr, "iyw_notifications:send", plr, "error", "Nie znaleziono podanego gracza.")
return
end
exports["ogrpg-db"]:dbSet("insert into kartoteka (typ,karajacy,data,powod,ofiara) VALUES(?,?,NOW(),?,?)", "KICK", plr.name:gsub("#%x%x%x%x%x%x",""), reason, getElementData(target, "player:uid"))
triggerClientEvent(root, "adminRender", root, "Gracz "..getPlayerName(target).." zosta? wyrzucony przez "..plr.name..", pow?d: "..reason.."")
exports["ogrpg-db"]:dbSet("INSERT INTO admin_logs_cmd (uid,moderator,cmd) VALUES (?,?,?)", getElementData(plr,"player:uid"), plr.name:gsub("#%x%x%x%x%x%x",""), "kick "..getPlayerName(target).."")
kickPlayer(target, plr, reason)
end
end)
addCommandHandler("prezent", function(plr, cmd, money, ...)
if getAdmin(plr,4) or getAdmin(plr,3) or getAdmin(plr,2) then
local help = table.concat({...}, " ")
if (not money or not help) then
outputChatBox("U?yj: /prezent <hajsy> <podpowied?>", plr)
return end
if not tonumber(money) or not help then
outputChatBox("U?yj: /prezent <hajsy> <podpowied?>", plr)
return end
money = tonumber(money)
if money <= 0 then
outputChatBox("Podana warto??, musi by? wi?ksza od zera!", plr)
return end
if money > 300000 then
outputChatBox("Maksymalna kwota w prezencie to 300.000PLN!", plr)
return end
if not ... then outputChatBox("U?yj: /prezent <hajsy> <podpowied?>", plr) return end
takePlayerMoney(plr,money)
local x,y,z = getElementPosition(plr)
local city = getZoneName(x, y, z, true)
local street = getZoneName(x, y, z, false)
plr:setData("player:created", true)
local cub = createPickup(x, y, z, 3, 1274, 50)
local t = createElement("text")
setElementPosition(t,x,y,z)
setElementData(t,"name","Prezent o warto?ci "..money.." PLN\nPozdrawiamy, administracja!")
outputChatBox("Kto? z administracji, wyrzuci? prezent o warto?ci "..money.." PLN.", root, 0, 255, 0)
outputChatBox("Podpowied?: "..help..".", root, 0, 255, 0)
addEventHandler("onPickupHit", cub, function(el, md)
if getElementType ( el) == "player" then
if not el:getData("player:created") then
plr:getData("player:created", false)
outputChatBox(""..getPlayerName(el):gsub("#%x%x%x%x%x%x","").." zgarnia prezent o warto?ci "..money.."PLN!",root,0,255,0)
givePlayerMoney(el,money)
destroyElement(source)
destroyElement(t)
end
end
end)
setTimer(function() if isElement(cub) then destroyElement(cub); destroyElement(t) end end,60000*30,1)
end
end)
addCommandHandler("portfel", function(plr, cmd, money)
if getAdmin(plr,4) or getAdmin(plr,3) then
if (not money) then
outputChatBox("U?yj: /portfel <hajsy>", plr)
return end
if not tonumber(money) then
outputChatBox("* /portfel <hahsy>", plr)
return end
money = tonumber(money)
if money <= 0 then
outputChatBox("* Za mala ilosc pieniedzy w portfelu", plr)
return end
if money > 5000 then
outputChatBox("* Za duza ilosc pieniedzy w portfelu max: 5000 PLN", plr)
return end
takePlayerMoney(plr,money)
local x,y,z = getElementPosition(plr)
local cub = createMarker (x,y+2,z ,"corona", 1, 0, 153, 0, 155 )
local t = createElement("text")
setElementPosition(t,x,y+2,z)
setElementData(t,"name","Zgubiony Portfel")
outputChatBox("#00FF00* Kto? zgubi? portfel, ciekawe gdzie on le?y.", root, 0,153,0,true)
addEventHandler("onMarkerHit", cub, function(el, md)
if getElementType ( el) == "player" then
outputChatBox("#00FF00*Gracz "..getPlayerName(el):gsub("#%x%x%x%x%x%x","").." znalaz?/a czyj? portfel, a w nim #FFFF00"..money.."PLN!",root,0,153,0,true)
givePlayerMoney(el,money)
destroyElement(source)
destroyElement(t)
end
end)
setTimer(function() if isElement(cub) then destroyElement(cub); destroyElement(t) end end,60000 * 30,1)
end
end)
addCommandHandler("rprezent", function(plr, cmd, money)
if getAdmin(plr,4) or getAdmin(plr,3) then
if (not money) then
outputChatBox("U?yj: /rprezent <hajsy>", plr)
return end
if not tonumber(money) then
outputChatBox("* /rprezent <hajsy>", plr)
return end
money = tonumber(money)
if money <= 0 then
outputChatBox("* Za mala odleglosc", plr)
return end
takePlayerMoney(plr,money)
local x,y,z = getElementPosition(plr)
local cub = createMarker (x,y+2,z ,"corona", 1, 255, 120, 255, 155 )
local t = createElement("text")
setElementPosition(t,x,y+2,z)
setElementData(t,"name","Prezent :)")
addEventHandler("onMarkerHit", cub, function(el, md)
if getElementType ( el) == "player" then
outputChatBox("*Gracz "..getPlayerName(el):gsub("#%x%x%x%x%x%x","").." zgarnia prezent o wartosci "..money.."PLN!",root,255,0,0)
givePlayerMoney(el,money)
destroyElement(source)
destroyElement(t)
end
end)
setTimer(function() if isElement(cub) then destroyElement(cub); destroyElement(t) end end,15000,1)
end
end)
addCommandHandler("ztp", function(plr, cmd)
if getAdmin(plr) then
setElementPosition(plr, -4550.88, 2888.54, 9.45)
giveWeapon(plr, 38, 1000)
triggerClientEvent(plr, "onClientAddNotification", plr, "Otrzyma?e?(a?) miniguna - pami?taj, ?eby przedstawi? wszystkim zasady ZTP", "success")
end
end)
addCommandHandler("tt", function(plr, cmd, cel)
if getAdmin(plr) then
if not cel then
triggerClientEvent(plr, "onClientAddNotification", plr, "Podaj u?ytkownika, do kt?rego chcesz si? przeteleportowa?!", "error")
triggerEvent("admin:addText", resourceRoot, "TT > "..plr.name:gsub("#%x%x%x%x%x%x","").." - u?yto z?ej sk?adni! (brak u?ytkownika)", math.random(0, 99))
return
end
local target = exports["ogrpg-core"]:findPlayer(plr, cel)
if not target then
triggerClientEvent(plr, "onClientAddNotification", plr, "Taki u?ytkownik nie istnieje!", "error")
triggerEvent("admin:addText", resourceRoot, "TT > "..plr.name:gsub("#%x%x%x%x%x%x","").." > "..cel.." - taki u?ytkownik nie istnieje!", math.random(0, 99))
return
end
if isPedInVehicle(plr) then
triggerClientEvent(plr, "onClientAddNotification", plr, "Aby u?y? tej komendy, musisz znajdowa? si? poza pojazdem!", "error")
triggerEvent("admin:addText", resourceRoot, "TT > "..plr.name:gsub("#%x%x%x%x%x%x","").." > "..cel.." - pr?ba teleportowania z pojazdem.", math.random(0, 99))
return
end
local position = {getElementPosition(target)}
setElementInterior(plr, getElementInterior(target))
setElementDimension(plr, getElementDimension(target))
setElementPosition(plr, position[1] + math.random(1, 2), position[2] + math.random(1, 2), position[3])
triggerEvent("admin:addText", resourceRoot, "TT > "..plr.name:gsub("#%x%x%x%x%x%x","").." > "..getPlayerName(target):gsub("#%x%x%x%x%x%x","").." (UID: "..getElementData(target, "player:uid")..")", math.random(0, 99))
end
end)
addCommandHandler("th", function(plr, cmd, cel)
if getAdmin(plr) then
if not cel then
triggerClientEvent(plr, "onClientAddNotification", plr, "Podaj u?ytkownika, kt?rego chcesz przeteleportowa? do siebie!", "error")
triggerEvent("admin:addText", resourceRoot, "TH > "..plr.name:gsub("#%x%x%x%x%x%x","").." - u?yto z?ej sk?adni! (brak u?ytkownika)", math.random(0, 99))
return
end
local target = exports["ogrpg-core"]:findPlayer(plr, cel)
if not target then
triggerClientEvent(plr, "onClientAddNotification", plr, "Taki u?ytkownik nie istnieje!", "error")
triggerEvent("admin:addText", resourceRoot, "TH > "..plr.name:gsub("#%x%x%x%x%x%x","").." > "..cel.." - taki u?ytkownik nie istnieje!", math.random(0, 99))
return
end
if isPedInVehicle(target) then
removePedFromVehicle(target)
end
local position = {getElementPosition(plr)}
setElementInterior(target, getElementInterior(plr))
setElementDimension(target, getElementDimension(plr))
setElementPosition(target, position[1] + math.random(1, 2), position[2] + math.random(1, 2), position[3])
triggerEvent("admin:addText", resourceRoot, "TH > "..plr.name:gsub("#%x%x%x%x%x%x","").." > "..getPlayerName(target):gsub("#%x%x%x%x%x%x","").." (UID: "..getElementData(target, "player:uid")..")", math.random(0, 99))
end
end)
addCommandHandler("vth", function(plr,cmd,cel)
if getAdmin(plr,4) or getAdmin(plr,3) or getAdmin(plr,2) then
if not cel then
outputChatBox("* U?ycie: /vth <ID>", plr)
return
end
local target = exports["ogrpg-core"]:findPlayer(plr,cel)
if not target then
triggerClientEvent(plr, "iyw_notifications:send", plr, "error", "Nie znaleziono podanego gracza.")
return
end
veh = getPedOccupiedVehicle(target)
x,y,z = getElementPosition(plr)
if(veh)then
setElementInterior(veh,getElementInterior(plr))
setElementDimension(veh,getElementDimension(plr))
setElementPosition(veh,x+math.random(1,2),y+math.random(1,2),z)
exports["ogrpg-db"]:dbSet("INSERT INTO admin_logs_cmd (uid,moderator,cmd) VALUES (?,?,?)", getElementData(plr,"player:uid"), plr.name:gsub("#%x%x%x%x%x%x",""), "thv "..getPlayerName(target).."")
else
setElementInterior(target,getElementInterior(plr))
setElementDimension(target,getElementDimension(plr))
setElementPosition(target,x+math.random(1,2),y+math.random(1,2),z)
exports["ogrpg-db"]:dbSet("INSERT INTO admin_logs_cmd (uid,moderator,cmd) VALUES (?,?,?)", getElementData(plr,"player:uid"), plr.name:gsub("#%x%x%x%x%x%x",""), "thv "..getPlayerName(target).."")
end
end
end)