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

Wysłany: 2016-08-17, 01:12


SuperMan.

Firefighter






Wiek: 23
Na forum: 3800 dni
Posty: 47
Nick w MP: LORDG

Piwa: 3842

Respekt: 62,5

Ostrzeżeń: 60%
Witajcie, postanowilem i? zrobie serwer na paczce ourgame ale kicki i bany nie dzia?aj?, wszystko jest ok podpiete pod mysql i wgl, ale tak : Ban nie dzia?a Kick nie wyrzuca pomocy o co chodzi co jest nie tak w kodzie jestem nowy w lua i srednio ogarniam!

Kod:

addCommandHandler("ban", function(plr,cmd,cel,time,type,...)
if getAdmin(plr,4) or getAdmin(plr,3) or getAdmin(plr,2) then
local reason=table.concat({...}, " ")
if not cel or not tonumber(time) or not type or not reason then
outputChatBox("* U?ycie: /ban <nick/ID> <czas> <jednostka: m/h/d/w> <pow?d>", plr)
return
end
local target=exports["ogrpg-core"]:findPlayer(plr,cel)
if not target then
outputChatBox("* Nie znaleziono podanego gracza.", plr, 255, 0, 0)
return
end
if (getAdmin(plr,3) == false) and getAdmin(target,3) then outputChatBox("Nie mozesz tego zrobic na rconie!",plr,255,0,0) return end
local query=string.format("SELECT * FROM ogrpg_ban WHERE type=%q AND active=1 AND serial=%q AND time>NOW() LIMIT 1","ban", getPlayerSerial(target))
local result=exports["ogrpg-db"]:pobierzWyniki(query)
if (result) then
return outputChatBox(" Gracz Posiada Bana do "..result["time"]..", za: "..result["reason"], plr, 255, 0, 0)
else
exports["ogrpg-db"]:dbSet("DELETE FROM ogrpg_ban WHERE type=? AND active=1 AND serial=?", "ban", getPlayerSerial(target))
end
result=pobierzDate(type,time)
reason = reason.." |od "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").."|"
if not result then outputChatBox("*Wpisales zla date **",plr,255,0,0) return end

triggerClientEvent(root, "admin:rendering", root, "* "..getPlayerName(target):gsub("#%x%x%x%x%x%x","").."("..getElementData(target,"id")..") otrzyma?(a) bana z powodu: "..reason.."("..time .. type ..")")
exports["ogrpg-db"]:dbSet("INSERT INTO ogrpg_ban (serial,reason,time,type) VALUES (?,?,?,?)", getPlayerSerial(target), reason, result, "ban")
kickPlayer(target,reason)
--outputChatBox("* Dodanych rekord", plr)
end
end)

a kick to :



Kod:

addCommandHandler("k", 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
outputChatBox("* Nie znaleziono podanego gracza.", plr, 255, 0, 0)
return
end
triggerClientEvent(root, "admin:rendering", root, "* "..getPlayerName(target):gsub("#%x%x%x%x%x%x","").."("..getElementData(target,"id")..") zosta?(a) wyrzucony(a) przez ' "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").." ' z powodu: "..reason.."")
kickPlayer(target, plr, reason)
end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-17, 01:45


=DC=







Wiek: 35
Na forum: 3944 dni
Posty: 223
Nick w MP: =DC=

Piwa: 72

Respekt: 150
Respekt: 150Respekt: 150

Zapewne brakuje ci funkcji
getAdmin(plr,2)

i dlatego skrypt nie wykonuje ?adnej akcji bo nie jest w stanie sprawdzi? czy masz prawa do u?ywania tej komendy :P

Podpis

Witaj
, jeśli Ci pomogłem postaw mi :piwo: lub R* Dzięki!

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-17, 11:03


mis14







Wiek: 25
Na forum: 3924 dni
Posty: 185

Piwa: 73

Respekt: -149

"=DC=" napisał/a:

Zapewne brakuje ci funkcji
getAdmin(plr,2)

i dlatego skrypt nie wykonuje ?adnej akcji bo nie jest w stanie sprawdzi? czy masz prawa do u?ywania tej komendy :P
z tego co widz? b??dnie kolego poda?e? tam jest dodana w kodzie z tego ci widz?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-17, 15:07


=DC=







Wiek: 35
Na forum: 3944 dni
Posty: 223
Nick w MP: =DC=

Piwa: 72

Respekt: 150
Respekt: 150Respekt: 150

mis14, to poka? mi w kt?rym miejscu widzisz co? w stylu :p

function getAdmin(plrstatus)
  if cotam then
      return true
  elseif cotam then 
     return true
  else
     return false
  end
end


Podpis

Witaj
, jeśli Ci pomogłem postaw mi :piwo: lub R* Dzięki!

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-17, 18:58


mis14







Wiek: 25
Na forum: 3924 dni
Posty: 185

Piwa: 73

Respekt: -149

czy mo?esz podes?a? skrypt przrobiony bo nie rozumiem

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-19, 03:55


Barcioo

Kiedyś to było ST






Wiek: 26
Na forum: 4049 dni
Posty: 458
Nick w MP: Bartek.

Piwa: 1887

Respekt: 460
Respekt: 460

Dodaj do acl do admina czyli w admin panel resources/manage acl w grupie admin dodajesz w object resource.ogrpg-admin napisz czy to ci zadzia?a

Podpis
Kanał Youtube;
A tu zapraszam
, pomogłem Ci? Wynagrodź mnie :piwo: :)


SUPPORT TEAM- 2016-09-03 do 2018-05-25
Test Mod- 2018-05-25
1k dni na Forum - 2018-01-28


GG: 62111935
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-19, 23:33


mis14







Wiek: 25
Na forum: 3924 dni
Posty: 185

Piwa: 73

Respekt: -149

Kod:

addCommandHandler("b", function(plr,cmd,cel,time,type,...)
if getAdmin(plr,4) or getAdmin(plr,3) or getAdmin(plr,2) then
local reason=table.concat({...}, " ")
if not cel or not tonumber(time) or not type or not reason then
outputChatBox("* U?ycie: /b <nick/ID> <czas> <jednostka: m/h/d/w> <pow?d>", plr)
return
end
local target=exports["ogrpg-core"]:findPlayer(plr,cel)
if not target then
outputChatBox("* Nie znaleziono podanego gracza.", plr, 255, 0, 0)
return
end
local query=string.format("SELECT * FROM ogrpg_ban WHERE type=%q AND active=1 AND serial=%q AND time>NOW() LIMIT 1","ban", getPlayerSerial(target))
local result=exports["ogrpg-db"]:pobierzWyniki(query)
if (result) then
return outputChatBox(" Gracz Posiada Bana do "..result["time"]..", za: "..result["reason"], plr, 255, 0, 0)
else
exports["ogrpg-db"]:dbSet("DELETE FROM ogrpg_ban WHERE type=? AND active=1 AND serial=?", "ban", getPlayerSerial(target))
end
result=pobierzDate(type,time)
reason = reason.." |od "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").."|"
if not result then outputChatBox("*Wpisales zla date **",plr,255,0,0) return end

triggerClientEvent(root, "admin:rendering", root, "* "..getPlayerName(target):gsub("#%x%x%x%x%x%x","").."("..getElementData(target,"id")..") otrzyma?(a) bana z powodu: "..reason.."("..time .. type ..")")
exports["ogrpg-db"]:dbSet("INSERT INTO ogrpg_ban (serial,reason,time,type) VALUES (?,?,?,?)", getPlayerSerial(target), reason, result, "ban")
kickPlayer(target,reason)
--outputChatBox("* Dodanych rekord", plr)
end
end)
bany dzia?aj? ale mo?na wej?? normalnie na serwer a nie banuje dok?adnie

Postaw piwo autorowi tego posta
 

 
Tagi: nie :: działają :: kicki :: bany!
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA 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