local ffi require ffi function main if not isSampLoaded then return en

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
local ffi = require 'ffi'
function main()
if not isSampLoaded() then return end
while sampGetChatInfoPtr() == 0 do wait(0) end
ffi.cdef[[
unsigned long GetCurrentProcessId();
]]
local chatlogPath = ffi.cast('char *', sampGetChatInfoPtr() + 17)
local path = ffi.string(chatlogPath)
if string.sub(path, -11) == 'chatlog.txt' then
path = script.this.directory
path = path .. ffi.C.GetCurrentProcessId().. ' '..sampGetPlayerNickname(0)..' '..sampGetCurrentServerAddress()..'.txt'
local newChatlogPath = ffi.new('char[261]', path)
ffi.copy(chatlogPath, newChatlogPath, 261)
end
end