Wysłany: 2021-09-26, 02:21
etrnl
CLASSIC RPG
Wiek: 26 Na forum: 2200 dni Posty: 86
Nick w MP: anonymous
Piwa : 57
Siema, mam pytanie, jak mog? najpro?ciej sprawdzi? czy report istnieje ?eby nie da?o si? wzi?? rapsa kt?ry nie istnieje? za??czam 2 eventy ic cl'k?.
Kod: addEvent("admin:addReport", true)
addEventHandler("admin:addReport", root, function(text,id)
table.insert(reportView, {text,id})
if #reportView > 31 then
-- table.remove(reportView, 2)
end
setElementData(scianarapsow,"sciana:raportow",reportView)
end)
addEvent("admin:removeReport", true)
addEventHandler("admin:removeReport", root, function(id)
for i=#reportView, 2, -1 do
if reportView[i][2] == id then
table.remove(reportView,i)
end
end
setElementData(scianarapsow,"sciana:raportow",reportView)
end)
Kod:
function clearujemy(plr,cmd,id,...)
if getElementData(plr,"player:admin") ~= true then return end
if getElementData(plr, "player:level") == 4 or 3 or 2 or 1 then
local args = {...}
if not
(args[1]) then outputChatBox("#FF0000* #FFFFFF Poprawne u?ycie: /cl <id/nick> <text>", plr,255,255,255,true) return end
local target=exports["ls-core"]:findPlayer(plr,id)
opis = ""
if target then
id=getElementData(target,"id")
opis=getPlayerName(target)
end
end
local target=exports["ls-core"]:findPlayer(plr,id)
if not target then
outputChatBox("*Brak reporta na podanego gracza.", plr, 255, 0, 0)
return
end
for i,v in ipairs(getElementsByType("player")) do
local reason=table.concat({...}, " ")
local test = "REPORT "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").."("..getElementData(plr, "id")..") #919191usun??/??a raport na: ("..id..")#FF0000"..opis:gsub("#%x%x%x%x%x%x","").."#919191."
triggerEvent("admin:removeReport", resourceRoot, id)
outputChatBox(" #FF0000* #FF0000"..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").."#FFFFFF["..getElementData(plr,"id").."] #FFFFFFprzyj?? zg?oszenie na: #FFFF00"..getPlayerName(target).."["..id.."] #FFFFFFpow?d: #FFFFFF"..reason..".", v, 255, 0, 0, true)
triggerEvent("admin:addText", resourceRoot, test:gsub("#%x%x%x%x%x%x",""))
end
end
addCommandHandler("cl", clearujemy)
addCommandHandler("CL", clearujemy)
Wysłany: 2021-09-27, 03:47
Hades.
Łiiiiiiiiii
Wiek: 22 Na forum: 4700 dni Posty: 372
Nick w MP: Hades
Piwa : 3214
Z tego co widz? s? to raporty z PYS'a, usuwanie raport?w tam polega?o na podaniu id gracza na kt?rego zosta? z?o?ony report, musia?by? przebudowa? kod tak by te raporty sz?y do jednego miejsca np. tabeli i posiada?y w?asne id, potem przy usuwaniu raporta podajesz to id i usuwa dany report z tej tabeli.
Więcej szczegółów
Wystawiono 1 piw(a):etrnl
Wysłany: 2021-09-27, 14:50
NorbiTTT
Nbi#1824
Wiek: 27 Na forum: 3207 dni Posty: 193
Nick w MP: Nbi
Piwa : 698
W mojej paczce - City LifeRPG 2.0 jest to naprawione, mo?esz sobie wzi?? stamt?d lub spr?bowa? samemu zrobi? sprawdzanie - czy dany report jest ;D
[ Dodano : 2021-09-27, 14:51 ]
Tutaj zrobi?em to na elementdate, ale mo?na te? innym sposobem to rozwi?za? ;D Ale wydaje mi si? ?e jest git
addCommandHandler ( "report" , function( plr , cmd , cel ,...)
if not getElementData ( plr , "player:logged" ) then return end
if not cel then
outputChatBox ( "Ⓘ #FFFFFFPrawid?owe u?ycie: /report <id, nick> <pow?d>" , plr , 255 , 255 , 0 , true )
return
end
local target = exports [ "pystories-core" ]: findPlayer ( plr , cel )
if not target then
outputChatBox ( "✘ #FFFFFFNie znaleziono podanego gracza." , plr , 255 , 0 , 0 , true )
return
end
local text = table . concat ({...}, " " )
desc = "[" .. getElementData ( plr , "id" ).. "]" .. getPlayerName ( plr ): gsub ( "#%x%x%x%x%x%x" , "" ).. " >> [" .. getElementData ( target , "id" ).. "]" .. getPlayerName ( target ): gsub ( "#%x%x%x%x%x%x" , "" ).. ": " .. text : gsub ( "#%x%x%x%x%x%x" , "" )
triggerEvent ( "admin:addReport" , resourceRoot , desc , getElementData ( target , "id" ))
outputChatBox ( "✔ #FFFFFFPomy?lnie wys?a?e?(a?) zg?oszenie na gracza [" .. getElementData ( target , "id" ).. "]" .. getPlayerName ( target ): gsub ( "#%x%x%x%x%x%x" , "" ).. "." , plr , 0 , 255 , 0 , true )
setElementData ( target , "player:reported" , true )
end )
addCommandHandler ( "cl" , function( plr , cmd , id ,...)
if not getAdmin ( plr ) then
outputChatBox ( "* Nie posiadasz uprawnie?." , plr , 255 , 0 , 0 )
return
end
local reason = table . concat ({...}, " " )
local target = exports [ "pystories-core" ]: findPlayer ( plr , id )
if not getElementData ( target , "player:reported" ) then outputChatBox ( "[#008affINFORMACJA#ffffff] Nie znaleziono takiego reporta! (B??d #249)" , plr , 255 , 255 , 255 , true ) return end
setElementData ( target , "player:reported" , false )
opis = "OFFLINE"
if target ~= plr and not getAdmin ( target ) then
exports [ "pystories-db" ]: dbSet ( "INSERT INTO raps (nick, sid, ostatnio_zrobil) VALUES (?,?,NOW())" , "" .. getPlayerName ( plr ): gsub ( "#%x%x%x%x%x%x" , "" ), getElementData ( plr , "player:sid" ))
end
if target then
id = getElementData ( target , "id" )
-- rozpatrzony = false
reason = table . concat ({...}, " " )
opis = getPlayerName ( target )
end
for i , v in ipairs ( getElementsByType ( "player" )) do
if getElementData ( v , "player:admin" ) then
triggerEvent ( "admin:removeReport" , resourceRoot , id )
-- rozpatrzony = true
outputChatBox ( "#008affCL#ffffff> [" .. getElementData ( plr , "id" ).. "#ffffff] " .. getPlayerName ( plr ): gsub ( "#%x%x%x%x%x%x" , "" ).. "#ffffff usuwa zg?oszenie od gracza [" .. id .. "#ffffff] " .. opis : gsub ( "#%x%x%x%x%x%x" , "" ).. " #ffffff" , v , 255 , 255 , 255 , true )
end
--[[if rozpatrzony then
outputChatBox ( "Twoje zg?oszenie zosta?o rozpatrzone! Tre??: " .. reason , target , 0 , 255 , 0 , true )
end --]]
end
end )
Więcej szczegółów
Wystawiono 1 piw(a):etrnl
Wysłany: 2021-09-27, 19:38
etrnl
CLASSIC RPG
Wiek: 26 Na forum: 2200 dni Posty: 86
Nick w MP: anonymous
Piwa : 57
Eldata mi styknie, nie pomy?la?em o tym, obydwaj panowie po piwku i do zamkni?cia!
Tagi: admin :: report
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: