Wysłany: 2019-02-16, 13:14
Pyrek24
Wiek: 25 Na forum: 3438 dni Posty: 546
Nick w MP: Pyrek
Piwa : 10
Witam ot??, mam spraw? zrobi?by mi kto?, ?e jak si? odbiera wyp?at? z frakcji daje ja do banku? element data banku bank_money
kod
local marker = createMarker (- 2776.52 , - 376.17 , 7.44 - 0.955 , "cylinder" , 1.1 , 255 , 80 , 0 )
setElementInterior ( marker , 0 )
setElementDimension ( marker , 0 )
local text = createElement ( 'text' )
setElementPosition ( text ,- 2776.52 , - 376.17 , 7.44 )
setElementData ( text , "name" , "Wyp?aty\nFrakcyjne" )
setElementInterior ( text , 0 )
setElementDimension ( text , 0 )
addEventHandler ( "onMarkerHit" , marker , function( el , md )
local uid = getElementData ( el , "player:uid" )
local result = exports [ "ogrpg-db" ]: dbGet ( "SELECT * FROM ogrpg_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 ( "* Otrzymujesz " .. money .. " $ 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 )
Wysłany: 2019-02-16, 13:25
BlueCry
ŚĆRIPTER LUJA
Wiek: 25 Na forum: 4006 dni Posty: 78
Nick w MP: BlueCry
Piwa : 2176
local marker = createMarker (- 2776.52 , - 376.17 , 7.44 - 0.955 , "cylinder" , 1.1 , 255 , 80 , 0 )
setElementInterior ( marker , 0 )
setElementDimension ( marker , 0 )
local text = createElement ( 'text' )
setElementPosition ( text ,- 2776.52 , - 376.17 , 7.44 )
setElementData ( text , "name" , "Wyp?aty\nFrakcyjne" )
setElementInterior ( text , 0 )
setElementDimension ( text , 0 )
addEventHandler ( "onMarkerHit" , marker , function( el , md )
local uid = getElementData ( el , "player:uid" )
local result = exports [ "ogrpg-db" ]: dbGet ( "SELECT * FROM ogrpg_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 ( "* Otrzymujesz " .. money .. " $ za przepracowanych " .. getElementData ( el , "player:workinjob" ).. " minut!" , el )
local bank = getElementData ( el , "bank_money" )
setElementData ( el , "bank_money" , bank + 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 )
Wysłany: 2019-02-16, 15:51
Pyrek24
Wiek: 25 Na forum: 3438 dni Posty: 546
Nick w MP: Pyrek
Piwa : 10
Kod: ogrpg-offices\s_money_from_job.lua:32: attempt to perform arithmetic on local 'bank' (a boolean value)
[ Dodano : 2019-02-16, 15:51 ]
Eror w DB3
Wysłany: 2019-02-17, 10:49
Kuks*
Wiek: 15 Na forum: 3030 dni Posty: 246
Nick w MP: Kuks*
Piwa : 2208
Pyrek24 , Zmie? zmienn? lokaln? bank na globaln?
Wysłany: 2019-02-17, 18:32
Pyrek24
Wiek: 25 Na forum: 3438 dni Posty: 546
Nick w MP: Pyrek
Piwa : 10
kuks, zielony jestem w lua, pom?g?by?, podstawi? albo jako? podpowiedzia? gdzie znajd? zmienn? lokaln? na bank?
Wysłany: 2019-02-18, 00:51
Kuks*
Wiek: 15 Na forum: 3030 dni Posty: 246
Nick w MP: Kuks*
Piwa : 2208
Pyrek24 , local bank = getElementData(el, "bank_money")
zamien po prostu na
bank = getElementData(el, "bank_money")
Wysłany: 2019-02-18, 01:48
Loop
Inspektor
Wiek: 27 Na forum: 4289 dni Posty: 311
Nick w MP: Inspektor
Piwa : 201
local bank = getElementData ( el , "bank_money" ) or 0
Wysłany: 2019-02-18, 11:15
Pyrek24
Wiek: 25 Na forum: 3438 dni Posty: 546
Nick w MP: Pyrek
Piwa : 10
loop a wklei? by? mi to do kodu ?
Tagi: dawanie :: hajsu :: banku
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: