Erczi
Wiek: 27 Na forum: 2371 dni Posty: 17
Nick w MP: ewwe
Piwa : 4
Siemka wyskakuje mi b??d kiedy pr?buje wyp?aci? kase pomoze ktos?
Kod:
local pension = { --za 1 minute
["SAPD"] = {
[1] = 1175,
[2] = 1200,
[3] = 1225,
[4] = 1250,
[5] = 1300,
[6] = 1325,
[7] = 1350,
[8] = 1400,
[9] = 1425,
[10] = 1450,
[11] = 1500,
},
["SAFD"] = {
[1] = 1175,
[2] = 1200,
[3] = 1225,
[4] = 1250,
[5] = 1300,
[6] = 1325,
[7] = 1350,
[8] = 1400,
[9] = 1425,
[10] = 1450,
[11] = 1500,
},
["SARA"] = {
[1] = 1175,
[2] = 1200,
[3] = 1225,
[4] = 1250,
[5] = 1300,
[6] = 1325,
[7] = 1350,
[8] = 1400,
[9] = 1425,
[10] = 1450,
[11] = 1500,
},
}
local markersFactionPayment={
{-1867.68, 812.64, 35.17,0,0},
}
for i,v in ipairs(markersFactionPayment) do
local marker=createMarker(v[1], v[2], v[3]-1, "cylinder", 2, 0, 144, 255,255)
setElementInterior(marker, v[4])
setElementDimension(marker, v[5])
setElementData(marker,"marker:text","frakcje")
setElementData(marker,"marker:downtext","Odbieranie pensji")
end
addEventHandler("onMarkerHit", resourceRoot, function(el,md)
if not md or getElementType(el) ~= "player" then return end
local uid=getElementData(el,"player:uid")
if not uid then return end
local result=exports["dmta_db"]:dbGet("SELECT * FROM dmta_factions WHERE uid=? LIMIT 1;", uid)
if result and #result > 0 then
local resulted=exports["dmta_db"]:dbGet("SELECT * FROM dmta_factions WHERE faction=?", faction)
local uid = getElementData(el,"player:uid")
if #result > 0 then
if pension[result[1].faction] then
if getElementData(el,"player:workinjob") and getElementData(el,"player:workinjob") >= 1 then
local money = (pension[result[1].faction][result[1].rank] * getElementData(el,"player:workinjob"))
local money = math.floor(money*60)
exports.dmta_interface:showPlayerNotification(el, "Otrzymujesz "..money.." $ (Przepracowane: "..getElementData(el,"player:workinjob").." Minut)", "success")
givePlayerMoney(el,money)
setElementData(el,"player:workinjob",0)
else
exports.dmta_interface:showPlayerNotification(el, "Nie masz nic do odebrania!", "error")
end
end
end
end
end)