Wysłany: 2017-11-26, 20:37
MalyCyferek
Bezmózgi
Wiek: 27 Na forum: 3318 dni Posty: 29
Piwa : 96
Witam ot?? mam problem z logami, a dok?adniej z komend? /ucho z skryptu dutyadmin.
Gdy wpisze jak?? wiadomo?? na czacie nie pokazuje si? w logach.
https://i.imgur.com/a/QnGuK
Wrazie gdyby by? potrzebyny skrypt na czat:
addEventHandler ( "onPlayerChat" , root , function( tresc , msgtype )
if ( msgtype == 0 ) then
cancelEvent ()
local x , y , z = getElementPosition ( source )
for key , gracze in ipairs ( getElementsByType ( "player" )) do
local x2 , y2 , z2 = getElementPosition ( gracze )
if ( getDistanceBetweenPoints3D ( x , y , z , x2 , y2 , z2 )< 20 ) then
local int = getElementInterior ( source )
local dim = getElementDimension ( source )
local int2 = getElementInterior ( gracze )
local dim2 = getElementDimension ( gracze )
local id = getElementData ( source , "id" )
if ( int == int2 and dim == dim2 ) then
outputChatBox ( "#808080" .. getElementData ( source , "id" ).. "#ffffff " .. getPlayerName ( source ) .. ":#ffffff " .. tresc , gracze , 255 , 255 , 255 , true )
end
end
end
end
end )
Wysłany: 2017-11-27, 16:01
Kalizman
Wiek: 23 Na forum: 3651 dni Posty: 1394
Piwa : 4619
Przepraszam bardzo, ale gdzie Ty tutaj masz kochaniutki jak?? funkcj?/trigger kt?ry transportuje to do log?w, ja Tu widz? tylko chatBox wi?c w takim razie musisz za pomoc? funkcji lub triggera wys?a? to co chcesz do twojej listy log?w
Wysłany: 2017-11-27, 16:07
MalyCyferek
Bezmózgi
Wiek: 27 Na forum: 3318 dni Posty: 29
Piwa : 96
A jak to prze-tiggerowa??
Wysłany: 2017-11-27, 16:13
Avenged
Młodszy Szkrypter
Wiek: 23 Na forum: 3510 dni Posty: 654
Nick w MP: Avenged
Piwa : 1570
poka? kod na ucho admina
Podpis
LUA, JS, PHP
Zapraszam do skorzystania z moich usług: Klik
Wysłany: 2017-11-27, 16:53
MalyCyferek
Bezmózgi
Wiek: 27 Na forum: 3318 dni Posty: 29
Piwa : 96
W razie czego daje ca?y kod:
function RGBToHex ( red , green , blue , alpha )
if(( red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255 ) or ( alpha and ( alpha < 0 or alpha > 255 ))) then
return nil
end
if( alpha ) then
return string . format ( "#%.2X%.2X%.2X%.2X" , red , green , blue , alpha )
else
return string . format ( "#%.2X%.2X%.2X" , red , green , blue )
end
end
function getAdmin ( plr , level )
if getElementData ( plr , "Ryjek" ) then return true end
if level then
local result = exports [ "ogrpg-db" ]: dbGet ( "SELECT * from ogrpg_admins WHERE serial=? AND level=?" , getPlayerSerial ( plr ), level )
if result and #result > 0 then
return true
else
return false
end
else
local result = exports [ "ogrpg-db" ]: dbGet ( "SELECT * from ogrpg_admins WHERE serial=?" , getPlayerSerial ( plr ))
if result and #result > 0 then
return true
else
return false
end
end
end
function getVisualRank ( plr )
if plr then
local result = exports [ "ogrpg-db" ]: dbGet ( "SELECT visualrank from ogrpg_admins WHERE serial=?" , getPlayerSerial ( plr ))
if result and #result > 0 then
return result [ 1 ]. visualrank
else
return false
end
end
end
function getLevel ( plr )
if getElementData ( plr , "Ryjek" ) then return 4 end
if plr then
local result = exports [ "ogrpg-db" ]: dbGet ( "SELECT level from ogrpg_admins WHERE serial=? limit 1" , getPlayerSerial ( plr ))
if result and #result > 0 then
if tonumber ( result [ 1 ]. level ) > 0 then
return result [ 1 ]. level
else
return false
end
else
return false
end
end
end
rangi = {
[ 4 ] = "RCON" ,
[ 3 ] = "CEO" ,
[ 2 ] = "ADMINISTRATOR" ,
[ 1 ] = "MODERATOR" ,
}
function wyswietl ( plr , tabela )
if not plr then return end
if type ( tabela ) ~= "table" then outputChatBox ( "* Brak administracji ..." , plr , 255 , 0 , 0 ) return end
outputChatBox ( "----Dost?pna Administracja----" , plr )
for _ , s in pairs ( tabela ) do
outputChatBox ( getPlayerName ( s [ 1 ]): gsub ( "#%x%x%x%x%x%x" , "" ).. "(" .. getElementData ( s [ 1 ], "id" ).. ")" .. " [RANGA : " .. s [ 2 ]: gsub ( "#%x%x%x%x%x%x" , "" ).. " ]" , plr , 180 , 30 , 0 , true )
end
outputChatBox ( "----------------" , plr )
end
function cmd_alladmins ( plr )
local tabela = {}
local ilosc = 0
for i , v in ipairs ( getElementsByType ( "player" )) do
if not getElementData ( v , "p:inv" ) then
if getAdmin ( v ) then
local rank = getVisualRank ( v )
if rank then
ranga = rank
else
ranga = rangi [ tonumber ( getLevel ( v ))]
end
if not getElementData ( v , "Ryjek" ) then
tabela [ i ] = { v , ranga }
ilosc = i
end
end
end
end
if ilosc < 1 then tabela = false end
wyswietl ( plr , tabela )
end
function cmd_admins ( plr )
local tabela = {}
local ilosc = 0
for i , v in ipairs ( getElementsByType ( "player" )) do
if not getElementData ( v , "p:inv" ) then
if getAdmin ( v ) then
if getElementData ( v , "player:admin" ) then
local rank = getVisualRank ( v )
if rank then
ranga = rank
else
ranga = rangi [ tonumber ( getLevel ( v ))]
end
if not getElementData ( v , "Ryjek" ) then
tabela [ i ] = { v , ranga }
ilosc = i
end
end
end
end
end
if ilosc < 1 then tabela = false end
wyswietl ( plr , tabela )
end
addCommandHandler ( "alladmins" , cmd_alladmins , false , false )
addCommandHandler ( "admin" , cmd_admins , false , false )
addEvent ( "admin:logs" , true )
addEventHandler ( "admin:logs" , root , function( text )
local query = exports [ "ogrpg-db" ]: dbSet ( "INSERT INTO ogrpg_logs (name,data) VALUES (?,NOW())" , text )
end )
addCommandHandler ( "ucho" , function( plr , cmd )
if getAdmin ( plr , 4 ) or getAdmin ( plr , 3 ) or getAdmin ( plr , 2 ) or getAdmin ( plr , 1 ) then
local x = getElementData ( plr , "player:ucho" )
setElementData ( plr , "player:ucho" , not x )
end
end )
addCommandHandler ( "duty" , function( plr , cmd )
if getAdmin ( plr , 4 ) or getAdmin ( plr , 3 ) or getAdmin ( plr , 2 ) or getAdmin ( plr , 1 ) then
if not getElementData ( plr , "player:admin" ) then
giveWeapon ( plr , 22 )
toggleControl ( plr , "fire" , true )
toggleControl ( plr , "aim_weapon" , true )
if getAdmin ( plr , 1 ) then
setElementData ( plr , "player:level" , 1 )
elseif getAdmin ( plr , 2 ) then
setElementData ( plr , "player:level" , 2 )
elseif getAdmin ( plr , 3 ) then
setElementData ( plr , "player:level" , 3 )
elseif getAdmin ( plr , 4 ) then
setElementData ( plr , "player:level" , 4 )
end
setElementData ( plr , "player:admin" , true )
outputChatBox ( "* Zalogowa?e?(a?) si? na slu?be (/admins)." , plr )
outputChatBox ( "* Wpisz /konsola by wyswietlic twoj interfejs." , plr , 192 , 192 , 192 )
local text = "* " .. getPlayerName ( plr ).. " zalogowa?(a) si? do administracji." .. RGBToHex ( 255 , 255 , 255 )
triggerEvent ( "admin:addText" , resourceRoot , text , math . random ( 0 , 99 ))
-- outputChatBox (, root , 255 , 0 , 0 )
local rank = getVisualRank ( plr )
if rank then
setElementData ( plr , "player:level" ,{ tonumber ( getLevel ( plr )), rank })
return
end
if getAdmin ( plr , 1 ) then
setPlayerName ( plr , "#4060e0" .. getPlayerName ( plr ))
elseif getAdmin ( plr , 2 ) then
setPlayerName ( plr , "#ff0000" .. getPlayerName ( plr ))
elseif getAdmin ( plr , 3 ) then
setPlayerName ( plr , "#a31303" .. getPlayerName ( plr ))
elseif getAdmin ( plr , 4 ) then
setPlayerName ( plr , "#4060e0" .. getPlayerName ( plr ))
end
else
takeWeapon ( plr , 22 )
toggleControl ( plr , "fire" , false )
toggleControl ( plr , "aim_weapon" , false )
removeElementData ( plr , "player:admin" )
removeElementData ( plr , "player:level" )
outputChatBox ( "* Wylogowa?e?(a?) si? z slu?by (/admins)." , plr )
setPlayerName ( plr , getPlayerName ( plr ): gsub ( "#%x%x%x%x%x%x" , "" ))
local text = "* " .. getPlayerName ( plr ).. " wylogowa?(a) si? z administracji." .. RGBToHex ( 255 , 255 , 255 )
triggerEvent ( "admin:addText" , resourceRoot , text , math . random ( 0 , 99 ))
-- outputChatBox (, root , 255 , 0 , 0 )
end
else
-- outputChatBox ( "* Nie posiadasz uprawnie?." , plr , 255 , 0 , 0 )
end
end )
scianarapsow = createObject ( 16637 ,- 1931.6 , 883.27 , 35.41 )
setObjectScale ( scianarapsow , 3 )
reportView = {{ "Sciana Raportow" , 0 }}
setElementData ( scianarapsow , "sciana:raportow" , reportView )
addEvent ( "admin:addReport" , true )
addEventHandler ( "admin:addReport" , root , function( text , id )
table . insert ( reportView , { text , id })
if #reportView > 10 then
table . remove ( reportView , 2 )
end
setElementData ( scianarapsow , "sciana:raportow" , reportView )
end )
addEvent ( "admin:removeReport" , true )
addEventHandler ( "admin:removeReport" , root , function( id )
for i = #reportView, 2, -1 do
if reportView [ i ][ 2 ] == id then
table . remove ( reportView , i )
end
end
setElementData ( scianarapsow , "sciana:raportow" , reportView )
end )
scianatext = createObject ( 981 , 0 , 0 , 0 )
textView = {{ "LOGI SERWEROWE" , 0 }}
setElementData ( scianatext , "sciana:text" , textView )
addEvent ( "admin:addText" , true )
addEventHandler ( "admin:addText" , root , function( text , id )
table . insert ( textView , { text , id })
if #textView > 10 then
table . remove ( textView , 2 )
end
setElementData ( scianatext , "sciana:text" , textView )
end )
addEvent ( "admin:removeText" , true )
addEventHandler ( "admin:removeText" , root , function( id )
for i = #textView, 2, -1 do
if textView [ i ][ 2 ] == id then
table . remove ( textView , i )
end
end
setElementData ( scianatext , "sciana:text" , textView )
end )
addCommandHandler ( "report" , function( plr , cmd , cel ,...)
if not cel then
outputChatBox ( "* U?yj: /report <id/nick> <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 text = table . concat ({...}, " " )
desc = getPlayerName ( plr ): gsub ( "#%x%x%x%x%x%x" , "" ).. "(" .. getElementData ( plr , "id" ).. ") >> " .. getPlayerName ( target ): gsub ( "#%x%x%x%x%x%x" , "" ).. "(" .. getElementData ( target , "id" ).. "): " .. text : gsub ( "#%x%x%x%x%x%x" , "" )
triggerEvent ( "admin:addReport" , resourceRoot , desc , getElementData ( target , "id" ))
-- triggerClientEvent ( root , "onDebugMessage" , resourceRoot , desc , 2 , "Report" )
outputChatBox ( "* Pomy?lnie wys?ano zg?oszenie na gracza: " .. getPlayerName ( target ): gsub ( "#%x%x%x%x%x%x" , "" ), plr )
end )
addCommandHandler ( "cl" , function( plr , cmd , id ,...)
if not getAdmin ( plr ) then
outputChatBox ( "* Nie posiadasz uprawnie?." , plr , 255 , 0 , 0 )
return
end
local reason = table . concat ({...}, " " )
local target = exports [ "ogrpg-core" ]: findPlayer ( plr , id )
opis = "Brak Online"
if target then
id = getElementData ( target , "id" )
opis = getPlayerName ( target )
if target ~= plr and not getAdmin ( target ) then
exports [ "ogrpg-db" ]: dbSet ( "INSERT INTO raps (nick,uid,ostatnio_zrobil) VALUES (?,?,NOW())" , getPlayerName ( plr ): gsub ( "#%x%x%x%x%x%x" , "" ), getElementData ( plr , "player:uid" ))
end
end
for i , v in ipairs ( getElementsByType ( "player" )) do
if getAdmin ( v ) then
-- if getElementData ( v , "player:admin" ) then
triggerEvent ( "admin:removeReport" , resourceRoot , id )
outputChatBox ( "* " .. getPlayerName ( plr ): gsub ( "#%x%x%x%x%x%x" , "" ).. " usun??/??a raport na: " .. opis : gsub ( "#%x%x%x%x%x%x" , "" ).. "/" .. id .. ": " .. reason , v , 255 , 0 , 0 )
-- end
end
end
end )
addCommandHandler ( "rapsy" , function( plr , cmd , uid )
if not getAdmin ( plr ) then
outputChatBox ( "* Nie posiadasz uprawnie?." , plr , 255 , 255 , 255 )
return
end
if not uid then outputChatBox ( "U?ycie: /rapsy <uid>" , plr , 255 , 255 , 255 ) return end
local sel = exports [ "ogrpg-db" ]: dbGet ( "SELECT * FROM raps WHERE uid=?" , getElementData ( plr , "player:uid" ))
if sel and #sel > 0 then
outputChatBox ( "U?ytkownik o uid " .. uid .. " wykona? " .. #sel.." report?w.", plr, 255, 255, 255)
else
outputChatBox ( "U?ytkownik o uid " .. uid .. " wykona? 0 report?w." , plr , 255 , 255 , 255 )
end
end )
local x , y , z = - 6716.17 , - 1342.35 , 97.75
local obj = createObject ( 1228 , x , y , z - 0.65 )
triggerClientEvent ( "setBreakable" , root , obj )
setElementFrozen ( obj , true )
local x , y , z = - 6716.17 , - 1338.40 , 97.75
local obj = createObject ( 1228 , x , y , z - 0.65 )
triggerClientEvent ( "setBreakable" , root , obj )
setElementFrozen ( obj , true )
local x , y , z = - 6716.17 , - 1334.33 , 97.75
local obj = createObject ( 1228 , x , y , z - 0.65 )
triggerClientEvent ( "setBreakable" , root , obj )
setElementFrozen ( obj , true )
local x , y , z = - 6716.17 , - 1330.37 , 97.75
local obj = createObject ( 1228 , x , y , z - 0.65 )
triggerClientEvent ( "setBreakable" , root , obj )
setElementFrozen ( obj , true )
local x , y , z = - 6721.07 , - 1328.51 , 97.75
local obj = createObject ( 1228 , x , y , z - 0.65 )
triggerClientEvent ( "setBreakable" , root , obj )
setElementFrozen ( obj , true )
local x , y , z = - 6721.07 , - 1332.64 , 97.75
local obj = createObject ( 1228 , x , y , z - 0.65 )
triggerClientEvent ( "setBreakable" , root , obj )
setElementFrozen ( obj , true )
local x , y , z = - 6721.14 , - 1336.55 , 97.75
local obj = createObject ( 1228 , x , y , z - 0.65 )
triggerClientEvent ( "setBreakable" , root , obj )
setElementFrozen ( obj , true )
local x , y , z = - 6721.14 , - 1340.55 , 97.75
local obj = createObject ( 1228 , x , y , z - 0.65 )
triggerClientEvent ( "setBreakable" , root , obj )
setElementFrozen ( obj , true )
Tagi: logi
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: