Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.
GTAONLINE.PL
Tematy otagowane jako: logi
1. Logi
witam, chcia?bym zrobi? pod komende logi graczy.

?e np. /logi (gracz)
i s? ostatnie 30 log?w.
logi mam w bazie danych
czy jest to do wykonania?
2. Nie wyświetlają mi sie logi na discordzie z mta
[code]addEventHandler("onResourceStart", root, function(startedResource)
local czas = getRealTime()
exports["yd-discord"]:connectWeb("Zas?b **"..startedResource.name.."** zosta? uruchomiony/zrestartowany i jest gotowy do dzia?ania.", "NebariMTA_Skrypty")
end)

addEventHandler("onPlayerConnect", root, function(playerNick, playerIP, _, playerSerial, version)
connectWeb("U?ytkownik o nicku **"..playerNick.."** do??cza na serwer.nSerial: **"..playerSerial.."**nIP: **"..playerIP.."**", "NebariMTA_Join")
end)

addEventHandler("onPlayerCommand", root, function(cmd)
if cmd == "say" or cmd == "restart" or cmd == "start" or cmd == "stop" or cmd == "refresh" or cmd == "do" or cmd == "me" or cmd == "Zmniejsz" or cmd == "Zwieksz" or cmd == "Toggle" or cmd == "freecam" or cmd == "migacz" then return end
exports["yd-discord"]:connectWeb("U?ytkownik o nicku **"..getPlayerName(source):gsub("#%x%x%x%x%x%x","").."** u?y? komendy: **"..cmd.."**", "NebariMTA_Chat")
end)

setTimer(function()
exports["yd-discord"]:connectWeb("Aktualna ilo?? graczy na serwerze: "..#getElementsByType("player"), "NebariMTA_Online")
end, 600000, 0)

ad...
3. Logi w pliku .txt
Mam taki problem, zrobi?em logi, wszystko si? ?adnie zapisuje, tylko po jakim? czasie te logi si? usuwaj?, przy resecie skryptu czy co? takiego, dok?adnie nie wiem kiedy. Je?eli by kto? wiedzia? czego to jest przyczyn?, prosi?bym o pomoc :)

Stawiam piwka za pomoc! :piwo:

local file fileCreate("logi/logi.txt"

function 
zapiszlog(string)           
if (
filethen
fileOpen
("logi/logi.txt")
    
local time getRealTime()
    
fileSetPos(file,fileGetSize(file))
    
local written fileWrite(file,"[",string.format("%02s/%02s/%04s - %02s:%02s] - ",
    
tostring(time.monthday),
    
tostring(time.month 1),
    
tostring(time.year 1900),
    
tostring(time.hour),
    
tostring(time.minute)),        
    
string,"rn")
    
fileFlush(file)
    
end
end
4. Jak zrobic logi dla wgladu dla admina
mam taki ma?y k?opot bo stworzy?em system towar?w i chcia?bym zapisywa? do loga jaki towar zosta? wzi?ty, kiedy etc. i zrobi?em cos takiego ale nie nadpisuje mi tylko zamienia warto?ci

Jak co? to pracuje na plikach z inc. dfile

Tak to wygl?da w kodzie:
Kod:


new LOG[100];
format(LOG, sizeof(LOG), FOLDER_LOG, NickGracza);
new Godzina, Minuta;
gettime(Godzina, Minuta);
new Rok, Miesciac, Dzien;
getdate(Rok, Miesciac, Dzien);
dfile_Open(LOG);
dfile_WriteInt("Log nr", random(100));
dfile_WriteInt("Godzina Wybrania Towaru", Godzina);
dfile_WriteInt("Minuta Wybrania Towaru", Minuta);
dfile_WriteInt("Dzien Wybrania Towaru", Dzien);
dfile_WriteInt("Miesiac Wybrania Towaru", Miesciac);
dfile_WriteInt("Rok Wybrania Towaru", Rok);
dfile_WriteInt("ID Towaru", ID_TOWARU_PIASEK);
dfile_WriteString("Nazwa Towaru", "Piasek");
dfile_WriteInt("Wpisana ilosc ton", waga);
dfile_WriteString("============", "========");
dfile_SaveFile();
dfile_CloseFile();


a tak w notatniku:
Kod:


Status=Podjeto
Log nr=13
Godzina Wybrania Towaru=14
Minuta Wybrania Towaru=5
Dzien Wybrania Towaru=5
Miesiac Wybrania Towaru=4
Rok Wybrania Towaru=2020
ID Towaru=1
Nazwa Towaru=Piasek
Wpisana ilosc ton=10


Chcia?bym by sie nadpisywa?o a nie zamienia?o by sie ca?y czas tworzy?o to w notatniku nie wa?ne ile razy wybierzemy ten sam towar
5. Logi (znowu) nie działają poprawnie
Siemka,
Pisa?em do was aby?cie mi pomogli z logami na duty z ogrpg, i pomogli?cie, wgra?em i dzia?a, ale logi pokazuj? tylko jak adminsitracja si? loguje na duty i z niego schodzi, jak zrobi? tak aby jak kto? pisze do kogo? na czacie, pm, i przelewa komu? kase, aby to by?o na logach?

Kod dutyadmin w kt?rym s? linijki na logi:

[lua]
for k,v in ipairs ( getElementsByType ( "object" ) ) do
if getElementData ( v, "sciana:raportow" ) then
scianaplaczu = v
end
if getElementData(v,"sciana:text") then
scianatekstu = v
end
end


function isEventHandlerAdded( sEventName, pElementAttachedTo, func )
if
type( sEventName ) == 'string' and
isElement( pElementAttachedTo ) and
type( func ) == 'function'
then
local aAttachedFunctions = getEventHandlers( sEventName, pElementAttachedTo )
if type( aAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then
for i, v in ipairs( aAttachedFunctions ) do
if v == func then
return true
end
end
end
end

return false
end


local xtext=nil
local gameView={"Logi serwerowe"}
local sx,sy=guiGetScreenSize()

function renderingInfo()
dxDrawRectangle(sx*(258)/1024, sy*(0)/768, sx*(500)/1024, sy*(23)/768, tocolor(0, 0, 0, 195), false)
dxDrawText(xtext:gsub("#%x%x%x%x%x%x",""), sx*(258+1)/1024, sy*(0+1)/768, sx*(758+1)/1024, sy*(23+1)/768, tocolor(0, 0, 0, 255), 1.00, "default", "cen...
6. Logi na duty ogrpg
Siemka,
Jak wiecie lub nie domy?lnie w ogrpg nie dzia?aj? logi na /duty, s? tylko tabela raport?w i /konsola, kt?ra jest upierdliwa i nie przejrzysta.
Jak naprawi? aby logi serwerowe dzia?a?y w ogrpg? Tak samo jak na pysie ?e na /duty widzimy poprostu logi serwerowe, domyslnie w ogrpg nie dziala bo nie ma pliku ogrpg-logs (skryptu jakiegos ktorego nie ma domyslnie w paczce), czy da sie zrobic jak na pysie, i przerobic to ze nie trzeba tego skryptu ogrpg-logs, tylko aby dawalo logi serwerowe bezpo?rednio przyk?adowo z bazy danych z tabelki ogrpg_logs ?
7. Jak wyłączyć logi z freeroama na serwerze MTA
Witam bo robi? serwer, i chcia?bym wy??czy? wszystkie te podstawowe logi z serwera, czyli np jak ktos zmieni nick to aby sie na chacie nie pojawia?o, oraz szukam sposobu bo w pliku mtaconfig da sie ustawic odpalanie skrypt?w, ale jak ustawi? aby wy??cza?o dany skrypt? Bo buguje mi to scoreboard ;/

P?ac? zimnym :piwo:
8. Logi serwerowe
Witam, posiadam paczke skygame na serwerze, dutyadmin skrypt, jak sie jest na duty to nie pokazuje okienka z logami serwerowymi, w db3 pisze: ERROR: dutyadmin/s_utility.lua:1: exports: Call to non-running server resource (ogrpg-logs) [string"?"]

Czy kto? mo?e mi pom?c?
9. logi
Witam, mam taki problem, i? chce napisa? skrypt, aby zapisywa? logi do bazy danych.
Nie wiem jak si? do tego zabra?.
Pomo?e mi kto??
10. Logi w konsoli
Witam mam takie pytanie jak zrobi? ?eby w skrypcie "Handling"
Usun?? co? takiego jak logi w Konsoli i DB 3
11. Logi
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(trescmsgtype)
    if (
msgtype == 0then
        cancelEvent
()
        
local x,y,getElementPosition(source)
        for 
keygracze in ipairs(getElementsByType("player")) do
            
local x2,y2,z2 getElementPosition(gracze)
            if (
getDistanceBetweenPoints3D(x,y,z,x2,y2,z2)<20then
                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 == dim2then
                    outputChatBox
("#808080"..getElementData(source,"id").."#ffffff ".. getPlayerName(source) ..":#ffffff ".. trescgracze255255255true)
                
end
            end
        end
    end
end
)
12. Logi z LocalChat
Witam ma tak prosty kodzik i bym chcia? ?eby np. w innym pliku np.TXT zapisywa?y mi si? logi kto? m?g? by mi w tym pom?c ?
Kod:


chat_range=100

addEventHandler("onPlayerJoin",getRootElement(),
function ()
bindKey(source,"i","down","chatbox","LocalChat")
end)

addEventHandler("onResourceStart",getResourceRootElement(getThisResource()),
function ()
for index, player in pairs(getElementsByType("player")) do
bindKey(player,"i","down","chatbox","LocalChat")
end
end)

function isPlayerInRangeOfPoint(player,x,y,z,range)
local px,py,pz=getElementPosition(player)
return ((x-px)^2+(y-py)^2+(z-pz)^2)^0.5<=range
end

function onChat(player,_,...)
local px,py,pz = getElementPosition(player)
local msg = table.concat({...}, " ")
local nick = getPlayerName(player)
for _,v in ipairs(getElementsByType("player")) do
if isPlayerInRangeOfPoint(v,px,py,pz,chat_range) then
outputChatBox("(LocalChat)"..nick..": "..msg,v,r,g,b,false)
end
end
end
addCommandHandler("LocalChat",onChat)
13. powtarzające się logi
Witam, mam kod na czat frakcji i chcia?em doda? linijk? dzi?ki kt?rej b?d? widzia? w logach serwerowych kto co pisze. I tu le?y problem poniewa? gdy jest np. 2 administrator?w to czat w logach powtarza si? 2 razy. Jakie? propozycje?

Kod:
function globalMessage(plrcmd, ...)
    
local frakcja=getElementData(plr,'player:duty')
    if 
not frakcja then
        
return
    
end
    local msg 
table.concat ( { ... }, " " )
    
local admins=getElementsByType('player')
    for 
i,v in pairs(admins) do
    
local pfrakcje=getElementData(v,'player:duty')
        if 
frakcja == pfrakcje then
            outputChatBox
("#0055B5[Frakcja] #FFFFFF("..getElementData(plr,"id")..") "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","")..": "..msgv25525474true)
        
triggerClientEvent(root"admin:addText"root"Frakcja ("..getElementData(plr,"player:duty")..")> "..getPlayerName(plr).."("..getElementData(plr,"id").."): "..msg)
        
end
    end
end
addCommandHandler
("frakcja"globalMessage)
14. logi serwerowe
witam, chc? ?eby m?j skrypt na logi serwerowe po lewej stronie wy?wietla? logi z mojego czatu

oto kod mojego czatu g??wnego:
[lua]
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)<50) 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("#00FF1A[#ffffff"..getElementData(source,"id").."#00FF1A] #ffffff".. getPlayerName(source) ..": #ffffff".. tresc, gracze, 255, 255, 255, true)
end
end
end
end
end)
[/lua]

a oto kod na logi serwerowe(chc? zeby pisa?o po lewej stronie pod napisem Logi serwerowe ?eby pisa?o kto co pisze):
[lua]


local xtext=nil
local gameView={"Logi serwerowe:"}
local reportView={"Lista raport?w:"}
local sx,sy=guiGetScreenSize()

addEventHandler("onClientRender", root, function()
if not getElementData(localPlayer,"administracjaduty") then return end
concat=table.concat(gameView, "n")
dxDrawText(concat, sx*(10+1)...
15. Logi serwerowe itp.
Witam, pom?g? by kto? zmieni? logi serwerowe i raporty tak, ?eby nie by?y na MySQL , tylko ACL? ;x

[lua]


local xtext=nil
local gameView={"Logi serwerowe"}
local reportView={"Lista raport?w"}
local sx,sy=guiGetScreenSize()

addEventHandler("onClientRender", root, function()
local accName = getAccountName ( getPlayerAccount ( thePlayer ) )
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "RCON" ) ) then
concat=table.concat(gameView, "n")
dxDrawText(concat, sx*(10+1)/1024, sy*(279+1)/768, sx*(326+1)/1024, sy*(497+1)/768, tocolor(0, 0, 0, 255), 1.00, "default", "left", "top", false, true)
dxDrawText(concat, sx*(10)/1024, sy*(279)/768, sx*(326)/1024, sy*(497)/768, white, 1.00, "default", "left", "top", false, true)
end)

function renderingInfo()
dxDrawRectangle(sx*(258)/1024, sy*(0)/768, sx*(500)/1024, sy*(23)/768, tocolor(0, 0, 0, 155), false)
dxDrawText(xtext, sx*(258+1)/1024, sy*(0+1)/768, sx*(758+1)/1024, sy*(23+1)/768, tocolor(0, 0, 0, 255), 1.00, "default", "center", "center", false, true)
dxDrawText(xtext, sx*(258)/1024, sy*(0)/768, sx*(758)/1024, sy*(23)/768, tocolor(255, 0, 0, 255), 1.00, "default", "center", "center", false, true)
end

addEventHandler("onClientRender", root, function()
local accName = getAccountName ( getPlayerAccount ( the...
16. logi serwera
Witajcie! Chcia?em zrobi? logi serwera i zrobi?em tak:
Pawn
    dini_IntSet(LOGI,PlayerName(playerid), dini_Int(FileStats(playerid), "kasa"));
    
dini_IntSet(LOGI,PlayerName(playerid), dini_Int(FileStats(playerid), "score"));
i zapisuje tylko score :(
17. [GF] Logi wszystkiego?
Jak zrobi?, aby wszystkie wpisane przez graczy komendy oraz tekst na chacie by? zapisywany w logach? Nie chc? przy ka?dej komendzie dodawa? osobnego logowania, bo mia?bym tego za du?o.

Za pomoc :piwo:
18. [INNE] wynik skoku + logi
Witam mam pewien problem z logami serwera kt?re zapisuj? jaka komend? wpisze dany gracz o danej godzinie.Logi te po restarcie serwera kasuj? si?,jest tak po ka?dym restarcie.Jak temu zapobiec?

Oto te logi:

Kod:

public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
new data[3];
new time[3];
new strx[64];

gettime(time[0], time[1], time[2]);
getdate(data[0], data[1], data[2]);

format(strx, sizeof strx, "(Data: %d.%d.%d)(Godzina: %d:%d:%d) %s : %s rn", data[2], data[1], data[0], time[0], time[1], time[2], PlayerName(playerid), cmdtext);

new File:log = fopen("/ServerLog.txt", io_append);

fwrite(log, strx);
fclose(log);
return 1;
}


Kod:

public OnGameModeInit()
{
new File:log = fopen("/ServerLog.txt", io_write);
if(log)
{
fwrite(log, "Server started.rn");
fclose(log);
}
return 1;
}


2.Ostatnio zrobi?em skocznie na serwerze i chcia?bym wiedzie? czy jest mo?liwo?? zrobienia czego? takiego jak obliczenie na jak? odleg?o?? skoczy? gracz.Jak jest jaka? mo?liwo?? prosz? o wskaz?wki.Za pomoc piwko. ;)
19. [DM] Logi do mysql.
Witam.
Mam do was wielk? pro?b? mianowicie mam gamemod pod mysql u?ywam include a_mysql i w mysql_log tworzy mi tyle tego ?e ca?y czas si? zwi?ksza rozmiar tego pliku macie mo?e jaki? spos?b ?eby wy??czy? ca?e to mysql_log ?eby poprostu tam nie zapisywa?o niczego albo co? ?eby to si? tak szybko nie zapisywa?o.
20. [INNE] Logi
Jak zrobi? system log?w aby na dany dzie? by?y inny plik z logami ?
21. [DM] Dziwne logi i nie ładująca się mapa
Witam.
Mam taki problem z serwerem logi:
Kod:

Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3d-R2, (C)2005-2011 SA-MP Team

[18:21] password = "" (string)
[18:21]
[18:21] Server Plugins
[18:21] --------------
[18:21] Loading plugin:
[18:21] Failed (plugins/ : cannot open shared object file: No such file or directory)
[18:21] Loaded 0 plugins.

[18:21]
[18:21] Filterscripts
[18:21] ---------------
[18:21] Loading filterscript 'acsp.amx'...
[18:21] Sprawdzam licencje.
[18:21] Ten serwer jest teraz chroniony przed crashami. Jakosc gwarantuje SERVERPROJECT.
[18:21] Loaded 1 filterscripts.

[18:21] Script[gamemodes/PDS.amx]: Run time error 19: "File or function is not found"
[18:21] Number of vehicle models: 0


Serwer jest na samp 0.3d i mapa

Za pomoc piwko