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

Wysłany: 2017-12-10, 11:54


mis14







Wiek: 25
Na forum: 3924 dni
Posty: 185

Piwa: 73

Respekt: -149

witam robi mi si? p?tla w mysql zapisywaniu nie wiem jak to rozwi?za? je?li jest tyle os?b na duty tyle razy zapisuje si? text w mysql a nie 1 rekord kod :

addCommandHandler('e', function(plr,cmd, ...)
local name getPlayerName(plr):gsub("#%x%x%x%x%x%x","")
        if not getElementData(plr,"admin"then return end
        if getElementData(plr,"admin"then
        local ranga test
        if not ... then
  local x getElementData(plr,"ekipaoff")
  if == false then
        exports["noti"]:noti("Wy??czy?e? czat ekipy",plr)
        setElementData(plr,"ekipaoff",true)
  end
  if == true then
        exports["noti"]:noti("W??czy?e? czat ekipy",plr)
        setElementData(plr,"ekipaoff",false)
  end
return end
if ... then
if getElementData(plr,"ekipaoff") == true then exports["noti"]:noti("Posiadasz wy??czone wiadomo?ci tego czatu, nie mo?esz na nim pisa?!"plr) return end
        local msg=table.concat({...}, " ")
         if (getAdmin(plr,4)) then
                ranga "CEO"
        end
        if (getAdmin(plr,3)) then
                ranga "Starszy Administrator"
        end
          if (getAdmin(plr,2)) then
                ranga "Administrator"
        end
          if (getAdmin(plr,1)) then
                ranga "Support"
        end
        for _p in pairs(getElementsByType('player')) do
        if getAdmin(plrthen
                --if not getAdmin(plrthen return end
                        if getAdmin(p) and not getElementData(p,"ekipaoff"then
                        outputChatBox("#008AFF<<#FFFFFF"..ranga.."#008AFF>> #ffffff - "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").." #008AFF[#ffffff"..tonumber(getElementData(plr,"id")).."#008AFF]"..": #ffffff"..msg,p,60,172,120,true)
                        exports["db"]:dbSet("INSERT INTO Logi_czat_ekipy SET data=NOW(), Gracz=?, tresc=?, serial=?",getPlayerName(plr), msggetPlayerSerial(plr))

                end
        end
end
end
end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-12-10, 13:25


Kalizman







Wiek: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

Powinno dzia?a?.

addCommandHandler('e', function(plr,cmd, ...)
local name getPlayerName(plr):gsub("#%x%x%x%x%x%x","")
        if not getElementData(plr,"admin"then return end
        if getElementData(plr,"admin"then
        local ranga test
        if not ... then
  local x getElementData(plr,"ekipaoff")
  if == false then
        exports["noti"]:noti("Wy??czy?e? czat ekipy",plr)
        setElementData(plr,"ekipaoff",true)
  end
  if == true then
        exports["noti"]:noti("W??czy?e? czat ekipy",plr)
        setElementData(plr,"ekipaoff",false)
  end
return end
if ... then
if getElementData(plr,"ekipaoff") == true then exports["noti"]:noti("Posiadasz wy??czone wiadomo?ci tego czatu, nie mo?esz na nim pisa?!"plr) return end
        local msg=table.concat({...}, " ")
         if (getAdmin(plr,4)) then
                ranga "CEO"
        end
        if (getAdmin(plr,3)) then
                ranga "Starszy Administrator"
        end
          if (getAdmin(plr,2)) then
                ranga "Administrator"
        end
          if (getAdmin(plr,1)) then
                ranga "Support"
        end
        for _p in pairs(getElementsByType('player')) do
        if getAdmin(plrthen
                --if not getAdmin(plrthen return end
                        if getAdmin(p) and not getElementData(p,"ekipaoff"then
                        outputChatBox("#008AFF<<#FFFFFF"..ranga.."#008AFF>> #ffffff - "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").." #008AFF[#ffffff"..tonumber(getElementData(plr,"id")).."#008AFF]"..": #ffffff"..msg,p,60,172,120,true)

                end
        end
end
exports["db"]:dbSet("INSERT INTO Logi_czat_ekipy SET data=NOW(), Gracz=?, tresc=?, serial=?",getPlayerName(plr), msggetPlayerSerial(plr))
end
end
end)


Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
mis14
Wysłany: 2017-12-10, 13:41


mis14







Wiek: 25
Na forum: 3924 dni
Posty: 185

Piwa: 73

Respekt: -149

"Kalizman" napisał/a:

Powinno dzia?a?.

addCommandHandler('e', function(plr,cmd, ...)
local name getPlayerName(plr):gsub("#%x%x%x%x%x%x","")
        if not getElementData(plr,"admin"then return end
        if getElementData(plr,"admin"then
        local ranga test
        if not ... then
  local x getElementData(plr,"ekipaoff")
  if == false then
        exports["noti"]:noti("Wy??czy?e? czat ekipy",plr)
        setElementData(plr,"ekipaoff",true)
  end
  if == true then
        exports["noti"]:noti("W??czy?e? czat ekipy",plr)
        setElementData(plr,"ekipaoff",false)
  end
return end
if ... then
if getElementData(plr,"ekipaoff") == true then exports["noti"]:noti("Posiadasz wy??czone wiadomo?ci tego czatu, nie mo?esz na nim pisa?!"plr) return end
        local msg=table.concat({...}, " ")
         if (getAdmin(plr,4)) then
                ranga "CEO"
        end
        if (getAdmin(plr,3)) then
                ranga "Starszy Administrator"
        end
          if (getAdmin(plr,2)) then
                ranga "Administrator"
        end
          if (getAdmin(plr,1)) then
                ranga "Support"
        end
        for _p in pairs(getElementsByType('player')) do
        if getAdmin(plrthen
                --if not getAdmin(plrthen return end
                        if getAdmin(p) and not getElementData(p,"ekipaoff"then
                        outputChatBox("#008AFF<<#FFFFFF"..ranga.."#008AFF>> #ffffff - "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").." #008AFF[#ffffff"..tonumber(getElementData(plr,"id")).."#008AFF]"..": #ffffff"..msg,p,60,172,120,true)

                end
        end
end
exports["db"]:dbSet("INSERT INTO Logi_czat_ekipy SET data=NOW(), Gracz=?, tresc=?, serial=?",getPlayerName(plr), msggetPlayerSerial(plr))
end
end
end)
dzi?kuje za pomoc do zamkni?cia

Postaw piwo autorowi tego posta
 

 
Tagi: pętla :: zapisie :: logów
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