Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2022-03-03, 19:24


Erczi







Wiek: 27
Na forum: 2371 dni
Posty: 17
Nick w MP: ewwe

Piwa: 4

Respekt: 50

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)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2022-03-03, 20:27


NorbiTTT

Nbi#1824






Wiek: 27
Na forum: 3207 dni
Posty: 193
Nick w MP: Nbi

Piwa: 698

Respekt: 60

Kt?ra to 66 linijka?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2022-03-03, 20:33


adaskOO

Ten który patrzy






Wiek: 24
Na forum: 3732 dni
Posty: 249
Nick w MP: adaskOO

Piwa: 3168

Respekt: 280
Respekt: 280Respekt: 280Respekt: 280

"NorbiTTT" napisał/a:

Kt?ra to 66 linijka?

Wed?ug tego co jest wy?ej to

local money = (pension[result[1].faction][result[1].rank] * getElementData(el,"player:workinjob"))


Podpis

Zapraszam do współpracy :)
Discord: adaskOO#8255
Postaw piwo autorowi tego posta
 

 
Wysłany: 2022-03-03, 23:25


kamison

Przyszły programista .lua






Wiek: 25
Na forum: 3302 dni
Posty: 391
Nick w MP: kamison

Piwa: 594

Respekt: 205,3
Respekt: 205,3Respekt: 205,3

Upewnij si? czy to co pobierasz jest definiowane jako string lub number bo mo?e w tym jest problem.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2022-03-05, 00:37


Erczi







Wiek: 27
Na forum: 2371 dni
Posty: 17
Nick w MP: ewwe

Piwa: 4

Respekt: 50

"kamison" napisał/a:

Upewnij si? czy to co pobierasz jest definiowane jako string lub number bo mo?e w tym jest problem.

Nie rozumiem :/

Postaw piwo autorowi tego posta
 

 
Wysłany: 2022-03-05, 20:39


adaskOO

Ten który patrzy






Wiek: 24
Na forum: 3732 dni
Posty: 249
Nick w MP: adaskOO

Piwa: 3168

Respekt: 280
Respekt: 280Respekt: 280Respekt: 280

"Erczi" napisał/a:

"kamison" napisał/a:

Upewnij si? czy to co pobierasz jest definiowane jako string lub number bo mo?e w tym jest problem.

Nie rozumiem :/


Po prostu upewnij si? czy twoje warto?ci w zmiennej money to string ( np. "co? tam") czy number ( np 3). Chodzi dok?adnie o pension[result[1].faction][result[1].rank]

Podpis

Zapraszam do współpracy :)
Discord: adaskOO#8255
Postaw piwo autorowi tego posta
 

 
Tagi: wypłaty :: frakcyjne
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Wypłaty frakcyjne Odpowiedz do tematu

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
Dodaj temat do Ulubionych
Wersja do druku