Tematy otagowane jako: wpisanie
1. Mysql i wpisanie serialu
Chcia?bym wpisa? serial do bazy po do??czeniu/po??czeniu si? z serwerem.
Napisa?em kod, ale nie co? nie dzia?a, brak b??d?w w konsoli serwera.
Za pomoc b?dzie piwko
po stronie klienta
addEvent ( "do" , true )
function nazwa ()
local plr = getLocalPlayer ()
local tak = triggerServerEvent ( "nazwa" , resourceRoot , plr )
if tak then
outputDebugString ( "wyslalem (x2)" )
else
outputDebugString ( "nie dalem nazwy z acceslog-client" )
end
end
addEventHandler ( "do" , resourceRoot , nazwa )
i po stronie serwera
function cosTam ()
local tak = triggerClientEvent ( "do" , resourceRoot )
if tak then
outputDebugString ( "wyslalem" )
else
outputDebugString ( "blad" )
end
end
addEventHandler ( "onPlayerConnect" , getRootElement (), cosTam )
addEvent ( "nazwa" , true )
function accesLog ( plr )
local nazwa = getPlayerName ( plr )
local wezSerial = getPlayerSerial ( nazwa )
local wpiszDoBazyKiedy = exports [ "DB3" ]: dbSet ( "INSERT INTO logs_log (serial) VALUES (?)" , wezSerial )
if wpiszDoBazyKiedy then
outputDebugString ( "wpisalem" )
else
outputDebugString ( "co? nie tak" )
end
end
addEventHandler ( "nazwa" , resourceRoot , accesLog )
2. Wpisanie komendy tylko raz?
Witajcie! Czy jest jaka? funkcja w Lua w kt?rej po kt?rej b?d? m?g? tylko raz pos?u?y? si? dan? komend?, oraz z informacj? na chacie ?e ju? raz u?y?em tej komendy?