addEventHandler ( "onPlayerWasted", root,
function( totalAmmo, killer, killerWeapon, bodypart, stealth )
if killer then
local account = getPlayerAccount(killer)
if killer ~= source then
setAccountData( account,"allKills",tonumber( getAccountData( account,"allKills" ) or 0 ) +1 )
setElementData( killer, "KDr", tonumber(getElementData( killer, "T/K" )/getElementData( source, "T/D") ) )
end
else
local accountSource = getPlayerAccount(source)
setAccountData( accountSource,"Deaths",tonumber( getAccountData(accountSource,"Deaths") or 0 ) +1 )
setElementData( source, "KDr", getElementData( killer, "T/K" )/getElementData( source, "T/D") )
end
end
)
addEventHandler( "onPlayerLogin",root,
function( thePreviousAccount, theCurrentAccount, autoLogin )
local account = getPlayerAccount(source)
if not getAccountData( account,"allKills" ) and not getAccountData( account,"Deaths" ) then
setAccountData( account,"allKills",0 )
setAccountData( account,"Deaths",0 )
end
setElementData( source, "KDr", getElementData( source, "T/K" )/getElementData( source, "T/D") )
end
)
function Sprawdzenie(plr,cmd)
local account = getPlayerAccount(plr)
local data = getAccountData(account, "allKills") or "a jednak nie ma..."
for i, v in ipairs(getElementsByType("player")) do
outputChatBox(data,v)
end
end
addCommandHandler("sprawdzenie",Sprawdzenie)
i...
function enterPlayer()
local username = tostring (getPlayerSerial (source))
local account = getAccount (username)
if (account == false) then
account = addAccount (username, "o43'6Ap4=H")
logIn (source, account, "o43'6Ap4=H")
setElementData(source,'allKills',(getAccountData(account,'allKills') or 0))
triggerClientEvent ( source, "hideLoginWindow", getRootElement())
triggerEvent("onPlayerDayZRegister", getRootElement(),username,"o43'6Ap4=H",source)
return
end
if not logIn (source, account, "o43'6Ap4=H") then
setAccountPassword (account, "o43'6Ap4=H")
logIn (source, account, "o43'6Ap4=H")
end
triggerClientEvent ( source, "hideLoginWindow", getRootElement())
triggerEvent("onPlayerDayZLogin", getRootElement(),username,"o43'6Ap4=H",source)
end
addEvent("onRequestEnter",true)
addEventHandler("onRequestEnter",getRootElement(),enterPlayer)
addEventHandler ( "onPlayerWasted", root,
function( totalAmmo, killer, killerWeapon, bodypart, stealth )
if killer then
if killer ~= source then
local account = getPlayerAccount(killer)
setAccountData( account,"allKills",tonumber( getAccountData( account,"allKills" ) or 0 ) +1 )
setElementData( killer, "KDr", tonumber(getElementData( killer, "T/K" )/getElementData( source, "T/D") ) )
end
else
local accountSource = getPlayerAccount(source)
setAccountData( accountSource,"Deaths",tonumber( getAccountData(accountSource,"Deaths") or 0 ) +1 )
setElementData( source, "KDr", getElementData( killer, "T/K" )/getElementData( source, "T/D") )
end
end
)
addEventHandler( "onPlayerLogin",root,
function( thePreviousAccount, theCurrentAccount, autoLogin )
local account = getPlayerAccount(source)
if not getAccountData( account,"allKills" ) and not getAccountData( account,"Deaths" ) then
setAccountData( account,"allKills",0 )
setAccountData( account,"Deaths",0 )
end
setElementData( source, "KDr", getElementData( source, "T/K" )/getElementData( source, "T/D") )
end
)
function Sprawdzenie(plr,cmd)
local account = getPlayerAccount(plr)
local data = getAccountData(account, "allKills") or "a jednak nie ma..."
for i, v in ipairs(getElementsByType("player")) do
outputChatBox(data,v)
end
end
addCommandHandler("sprawdzenie",Sprawdzenie)
Dalej wyskakuje to samo co wczesniej jakby nie bylo takiej Daty da sie jakos zeby do txt zapisywa?o sie
[ Dodano: 2018-07-26, 10:56 ]
Dobra za pomoc w tym dostajesz respekcik i piwero , lecz niestety dalej to niedzia?a zrobi?em to pro?ciej
nw co jest nie tak, a gdy sprawdzam komed? sprawdzenie po resecie pisze "a jednak nie ma..." a jak zreconnectuje pisze ze 0 czyli jak tu jest
if not getAccountData( account,"zabicia" ) then
setAccountData( account,"zabicia",0 )
a po zabicu gracza i tak sie nie zapisuje:
addEventHandler ( "onPlayerWasted", root,
function( totalAmmo, killer, killerWeapon, bodypart, stealth )
if killer then
if killer ~= source then
local account = getPlayerAccount(killer)
setAccountData( account,"zabicia",tonumber( getAccountData( account,"zabicia" ) or 0 ) +1 )
end
end
end
)
addEventHandler( "onPlayerLogin",root,
function( thePreviousAccount, theCurrentAccount, autoLogin )
local account = getPlayerAccount(source)
if not getAccountData( account,"zabicia" ) then
setAccountData( account,"zabicia",0 )
end
end
)
function Sprawdzenie(plr,cmd)
local account = getPlayerAccount(plr)
local data = getAccountData(account, "zabicia") or "a jednak nie ma..."
for i, v in ipairs(getElementsByType("player")) do
outputChatBox(data,v)
end
end
addCommandHandler("sprawdzenie",Sprawdzenie)
login
function enterPlayer()
local username = tostring (getPlayerSerial (source))
local account = getAccount (username)
if (account == false) then
account = addAccount (username, "o43'6Ap4=H")
logIn (source, account, "o43'6Ap4=H")
setElementData(source,'zabicia',(getAccountData(account,'zabicia') or 0))
triggerClientEvent ( source, "hideLoginWindow", getRootElement())
triggerEvent("onPlayerDayZRegister", getRootElement(),username,"o43'6Ap4=H",source)
return
end
if not logIn (source, account, "o43'6Ap4=H") then
setAccountPassword (account, "o43'6Ap4=H")
logIn (source, account, "o43'6Ap4=H")
end
triggerClientEvent ( source, "hideLoginWindow", getRootElement())
triggerEvent("onPlayerDayZLogin", getRootElement(),username,"o43'6Ap4=H",source)
end
addEvent("onRequestEnter",true)
addEventHandler("onRequestEnter",getRootElement(),enterPlayer)
[ Dodano: 2018-07-26, 11:10 ]
a ta komnda jako? dzia?a
local account = getPlayerAccount (killer)
local data = getAccountData(account,"zabicia")
function SetKills(player,cmd,playername,kills)
if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(player)), aclGetGroup("Admin")) then
if playername and kills then
local player2 = findPlayerByName(playername)
if player2 then
if tonumber(kills) and tonumber(kills) >= 1 then
setElementData( player2, "zabicia",tonumber(kills))
setAccountData(account,"zabicia",data+1)
setAccountData ( getPlayerAccount (player2), "zabicia", tonumber(kills))
end
end
end
end
end
addCommandHandler("setk",SetKills)
Nie lepiej zrobi? to na mysql? zrobi? tabele accounts i po prostu logowanie pod mysql i kolumne ,,kills" czy tam ,,allkills" i po prostu za ka?de zab?jstwo niech dodaje +1 do tabeli.
Podpis
Support Team:04.10.2020 - 01.09.2020 Test Moderator:03.05.2021 - 01.09.2021 Moderator:01.09.2021 - 23.10.2021
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach