Wysłany: 2021-04-16, 12:45
NoNamik
Wiek: 35 Na forum: 2186 dni Posty: 289
Nick w MP: JestemNoNamem
Piwa : 374
mam problem poniewaz mozna przyjmowania rapsa jak nie ma rapsa i sie nalicza
Kod: addCommandHandler("pr", function(plr,cmd,id,...)
if not getAdmin(plr) then
return
end
local reason = table.concat({...}, " ")
if not id then return outputChatBox("ⓘ#ffffff /pr <id> <odpowied?>", plr, 255, 0, 0, true) end
if not reason then return outputChatBox("ⓘ#ffffff /pr <id> <odpowied?>", plr, 255, 0, 0, true) end
local target=exports["pystories-core"]:findPlayer(plr,id)
opis = "U?ytkownik offline"
if target then
id = getElementData(target,"id")
opis = getPlayerName(target)
if target ~= plr and not getAdmin(target) then
end
end
if opis == "U?ytkownik offline" then outputChatBox("ⓘ#ffffff Nie ma takiego gracza", plr, 255, 0, 0, true) return end
if target == plr then
outputChatBox("ⓘ#ffffff Nie mo?esz przyj?? swojego zg?oszenia", plr, 255, 0, 0, true)
return end
if reason == "" or reason == " " then
reason = "#C00004Brak#ffffff"
end
for i,v in ipairs(getElementsByType("player")) do
if getElementData(v,"player:admin") then
triggerEvent("admin:removeReport", resourceRoot, id)
local raporcik = getElementData(plr, "admin:reporty") or 0
outputChatBox("ⓘ#ffffff "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").." #22D000przyjmuje#ffffff zg?oszenie gracza "..getPlayerName(target):gsub("#%x%x%x%x%x%x","")..". Odpowied?: "..reason.."", v, 255, 255, 0, true)
end
end
exports['pystories-db']:dbSet("UPDATE pystories_admins SET reporty=reporty+1 WHERE serial=?", getPlayerSerial(plr))
outputChatBox("ⓘ#ffffff Twoje zg?oszenie zosta?o #22D000przyj?te#ffffff przez "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").."", target, 255, 0, 0, true)
outputChatBox("ⓘ#ffffff Odpowied?: "..reason or "Brak".."", target, 255, 0, 0, true)
end)
Podpis
Użytkownik - 10.06.2020
GTAO Member - 05.04.2021
Wysłany: 2021-04-16, 13:36
Wilq
Wiek: 24 Na forum: 4429 dni Posty: 3410
Piwa : 739
Nie ma weryfikacji, czy dany gracz w og?le wys?a? zg?oszenie. Zr?b to w tabeli ale pod element dat?.
Wysłany: 2021-04-17, 22:30
NoNamik
Wiek: 35 Na forum: 2186 dni Posty: 289
Nick w MP: JestemNoNamem
Piwa : 374
Wilq , mam setelementdate po wyslaniu rapsa
Wysłany: 2021-04-18, 11:39
Wilq
Wiek: 24 Na forum: 4429 dni Posty: 3410
Piwa : 739
No ale m?wi? - w kodzie od reps?w, tym na g?rze, nie masz ?adnej weryfikacji wi?c przepuszcza wszystko.
Wysłany: 2021-04-18, 15:31
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4395 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
Upraszczaj?c i tak prost? wypowied? - musisz zrobi? po prostu warunek if
Wysłany: 2021-04-18, 17:52
NoNamik
Wiek: 35 Na forum: 2186 dni Posty: 289
Nick w MP: JestemNoNamem
Piwa : 374
takie cos?
Kod:
addCommandHandler("pr", function(plr,cmd,id,...)
if not getAdmin(plr) then
return
end
if getElementData(plr, "player:reported") then
return end
local reason = table.concat({...}, " ")
if not id then return outputChatBox("ⓘ#ffffff /pr <id> <odpowied?>", plr, 255, 0, 0, true) end
if not reason then return outputChatBox("ⓘ#ffffff /pr <id> <odpowied?>", plr, 255, 0, 0, true) end
local target=exports["pystories-core"]:findPlayer(plr,id)
opis = "U?ytkownik offline"
if target then
id = getElementData(target,"id")
opis = getPlayerName(target)
if target ~= plr and not getAdmin(target) then
end
end
if opis == "U?ytkownik offline" then outputChatBox("ⓘ#ffffff Nie ma takiego gracza", plr, 255, 0, 0, true) return end
if target == plr then
outputChatBox("ⓘ#ffffff Nie mo?esz przyj?? swojego zg?oszenia", plr, 255, 0, 0, true)
return end
if reason == "" or reason == " " then
reason = "#C00004Brak#ffffff"
end
for i,v in ipairs(getElementsByType("player")) do
if getElementData(v,"player:admin") then
triggerEvent("admin:removeReport", resourceRoot, id)
local raporcik = getElementData(plr, "admin:reporty") or 0
outputChatBox("ⓘ#ffffff "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").." #22D000przyjmuje#ffffff zg?oszenie gracza "..getPlayerName(target):gsub("#%x%x%x%x%x%x","")..". Odpowied?: "..reason.."", v, 255, 255, 0, true)
end
end
exports['pystories-db']:dbSet("UPDATE pystories_admins SET reporty=reporty+1 WHERE serial=?", getPlayerSerial(plr))
outputChatBox("ⓘ#ffffff Twoje zg?oszenie zosta?o #22D000przyj?te#ffffff przez "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").."", target, 255, 0, 0, true)
outputChatBox("ⓘ#ffffff Odpowied?: "..reason or "Brak".."", target, 255, 0, 0, true)
end)
Wysłany: 2021-04-18, 19:42
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4395 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
Nie wiem co zmieniles, ale po prostu musisz podac liczbe rekordow z bazy( o ile tam sa zapisywane reporty ) i przyrownac je do 0
Tagi: przyjmowanie :: rapsa
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: