Wysłany: 2016-07-29, 09:38
NeroNix
Wiek: 27 Na forum: 3614 dni Posty: 69
Piwa : 1
Witam mam problem , ot?? wywala mi tak? b??d gdy chc? odebra? wyp?at?.
http://imgur.com/a/E2oWM
local Frakcje = { ----- ILOSC PLNOW ZA 1 PRZEPRACOWANA MINUTE !!!!!!!!!!!!!!!!!!
[ "SAFD" ] = 40 ,
}
local marker = createMarker ( 358.86 , 187.70 , 1007.2 , "cylinder" , 2 , 255 , 255 , 0 )
setElementInterior ( marker , 3 )
setElementDimension ( marker , 1561 )
local text = createElement ( 'text' )
setElementPosition ( text , 358.86 , 187.70 , 1008.2 )
setElementData ( text , "name" , "Tutaj odbierzesz wyp?ate z frakcji!" )
setElementInterior ( text , 3 )
addEventHandler ( "onMarkerHit" , marker , function( el , md )
local uid = getElementData ( el , "player:uid" )
local result = exports [ "og-db" ]: dbGet ( "SELECT * FROM og_factions WHERE uid=?" , uid )
if result > 0 then
if Frakcje [ result [ 1 ]. code ] then
if getElementData ( el , "player:workinjob" ) and getElementData ( el , "player:workinjob" ) >= 1 then
local money = ( Frakcje [ result [ 1 ]. code ] * getElementData ( el , "player:workinjob" ))
outputChatBox ( "Dostajesz " .. money .. " PLN za przepracowanych " .. getElementData ( el , "player:workinjob" ).. " minut!" , el )
givePlayerMoney ( el , money )
setElementData ( el , "player:workinjob" , 0 )
else
outputChatBox ( "Nie masz nic do odebrania!" , el )
end
else
outputChatBox ( "Nie jeste? w frakcji kt?ra mo?e odbiera? wyp?aty!" , el )
end
end
end )
Za pomoc i
Wysłany: 2016-07-30, 12:31
Jurandovsky
Kurdebele
Wiek: 17 Na forum: 4838 dni Posty: 915
Piwa : 2697
nigdzie nie nadajesz elementy daty 'player:workingjob' warunek nie ma jak tego sprawdzi?, bo element data nie istnieje.
a te warningi w debugu s? od tego, ?e nie ma po??czenia z baz? danych.
Podpis
Jedyny kontakt ze mną to PW forum
Kod:
local noobs = getElementsByTitle("player", "Programista LUA")
for k, v in ipairs(noobs) do
outputChatBox("Bez mózgu jest użytkownik o nicku: "..getPlayerName(v), root)
destroyElement(v)
end
Wysłany: 2016-07-30, 13:12
NeroNix
Wiek: 27 Na forum: 3614 dni Posty: 69
Piwa : 1
Jurandovsky ,
Nadaj?, Przepraszam, ?e nie da?em.
DUTY SAFD:
function naliczanie ( el )
if isElement ( el ) then
local x = getElementData ( el , "player:workinjob" ) or 0
setElementData ( el , "player:workinjob" , x + 1 )
else
if isTimer ( licz [ el ]) then
killTimer ( licz [ el ])
licz [ el ] = nil
end
end
end
local licz = {}
function rozpocznijnaliczanie ( el )
if isTimer ( licz [ el ]) then
killTimer ( licz [ el ])
licz [ el ] = nil
end
licz [ el ] = setTimer ( naliczanie , 60000 , 0 , el )
end
function zatrzymajnaliczanie ( el )
if isTimer ( licz [ el ]) then
killTimer ( licz [ el ])
licz [ el ] = nil
end
end
W og-core "saveplayers.lua" te? jest dodane, ?eby wczytywa?o to , wszystko liczy , ale nie dzia?a co?
Tagi: wypłaty :: dla :: frakcji
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: