Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2021-04-16, 12:45


NoNamik







Wiek: 35
Na forum: 2185 dni
Posty: 289
Nick w MP: JestemNoNamem

Piwa: 374

Respekt: 60

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
Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-04-16, 13:36


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Nie ma weryfikacji, czy dany gracz w og?le wys?a? zg?oszenie. Zr?b to w tabeli ale pod element dat?.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-04-17, 22:30


NoNamik







Wiek: 35
Na forum: 2185 dni
Posty: 289
Nick w MP: JestemNoNamem

Piwa: 374

Respekt: 60

Wilq, mam setelementdate po wyslaniu rapsa

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-04-18, 11:39


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

No ale m?wi? - w kodzie od reps?w, tym na g?rze, nie masz ?adnej weryfikacji wi?c przepuszcza wszystko.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-04-18, 15:31


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4394 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

Upraszczaj?c i tak prost? wypowied? - musisz zrobi? po prostu warunek if

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-04-18, 17:52


NoNamik







Wiek: 35
Na forum: 2185 dni
Posty: 289
Nick w MP: JestemNoNamem

Piwa: 374

Respekt: 60

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)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-04-18, 19:42


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4394 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

Nie wiem co zmieniles, ale po prostu musisz podac liczbe rekordow z bazy( o ile tam sa zapisywane reporty ) i przyrownac je do 0

Postaw piwo autorowi tego posta
 

 
Tagi: przyjmowanie :: rapsa
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » przyjmowanie rapsa Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku