Wysłany: 2017-12-10, 11:54
mis14
Wiek: 25 Na forum: 3924 dni Posty: 185
Piwa : 73
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 x == false then
exports [ "noti" ]: noti ( "Wy??czy?e? czat ekipy" , plr )
setElementData ( plr , "ekipaoff" , true )
end
if x == 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 ( plr ) then
--if not getAdmin ( plr ) then 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 ), msg , getPlayerSerial ( plr ))
end
end
end
end
end
end )
Wysłany: 2017-12-10, 13:25
Kalizman
Wiek: 23 Na forum: 3651 dni Posty: 1394
Piwa : 4619
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 x == false then
exports [ "noti" ]: noti ( "Wy??czy?e? czat ekipy" , plr )
setElementData ( plr , "ekipaoff" , true )
end
if x == 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 ( plr ) then
--if not getAdmin ( plr ) then 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 ), msg , getPlayerSerial ( plr ))
end
end
end )
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
"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 x == false then
exports [ "noti" ]: noti ( "Wy??czy?e? czat ekipy" , plr )
setElementData ( plr , "ekipaoff" , true )
end
if x == 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 ( plr ) then
--if not getAdmin ( plr ) then 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 ), msg , getPlayerSerial ( plr ))
end
end
end )
dzi?kuje za pomoc do zamkni?cia
Tagi: pętla :: zapisie :: logów
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: