Szerző Téma: Mta san andreas scriptelés segitség kérés  (Megtekintve 3185 alkalommal)

Mta san andreas scriptelés segitség kérés
« Dátum: 2019. Június 29. - 23:06:12 »
0
Mta san andreas scriptelés segitség kérés
Sziasztok tudnátok abban segíten nekem hogy ezt a money módót segítetek át javítani úgy hogy két eltérő money kapjunk vagyis úgy hogy azt tervezem hogy amit most csinálok abból legyen egy Dollár meg egy forint mod és ezt kéne úgy ki javitani hogy ne legyen egy máshoz köze a két pénz modhóz ????????? 
 
Ez a dollár pénz scriptje másolva ezt kéne ki javítani forintra de úgy hogy ne legyen köze dollárhoz !!!local money = getElementData(localPlayer, \"char >> money\")
local moneyChanging = false
local newMoney = 0
local maxNuls = 10
local nulsText = \"0000\"
local nuls = utfSub(nulsText, 1, maxNuls - string.len(tostring(money)))
--local money = convertNumber(getElementData(localPlayer, \"char >> money\"))
local typeColors = {
    [\"+\"] = \"#7cc576\",
    [\"-\"] = \"#d02424\",
}

 
addEventHandler(\"onClientElementDataChange\", localPlayer,
    function(dName, oValue)
        if oValue == nil or not oValue then oValue = 0 end
        if dName == \"char >> money\" then
            local value = getElementData(source, dName)
            nuls = utfSub(nulsText, 1, maxNuls - string.len(tostring(value)))
            money = convertNumber(value)
            if value > oValue then
                moneyChangeType = \"+\"
                newMoney = value - oValue
                money = typeColors[moneyChangeType] .. money
            elseif oValue > value then
                moneyChangeType = \"-\"
                newMoney = oValue - value
                money = typeColors[moneyChangeType] .. money
            end
            playSound(\"files/moneychange.mp3\")
            money = convertNumber(money)
            moneyChanging = true
            setTimer(
                function()
                    moneyChanging = false
                    money = getElementData(localPlayer, \"char >> money\")
                    nuls = utfSub(nulsText, 1, maxNuls - string.len(tostring(money)))
                end, 2500, 1
            )
        end
    end
)
function drawnMoney()
    if not getElementData(localPlayer, \"hudVisible\") then return end
    --Money
    local enabled,x,y,w,h,sizable,turnable = getDetails(\"money\")
    if moneyChanging then
        shadowedText(moneyChangeType .. newMoney .. \" $\", x, y, x + w, y + h, tocolor(255,255,255,255), 1, \"pricedown\", \"center\", \"center\", false, false, false, true)
        dxDrawText(moneyChangeType .. typeColors[moneyChangeType] .. newMoney .. \" #ffffff$\", x, y, x + w, y + h, tocolor(255,255,255,255), 1, \"pricedown\", \"center\", \"center\", false, false, false, true)
    else
        if money < 0 then
            shadowedText(nuls .. money ..\" $\", x, y, x + w, y + h, tocolor(255,255,255,255), 1, \"pricedown\", \"center\", \"center\", false, false, false, true)
            dxDrawText(nuls .. typeColors[\"-\"] .. money ..\" #ffffff$\", x, y, x + w, y + h, tocolor(255,255,255,255), 1, \"pricedown\", \"center\", \"center\", false, false, false, true)
        else
            shadowedText(nuls .. money ..\" $\", x, y, x + w, y + h, tocolor(255,255,255,255), 1, \"pricedown\", \"center\", \"center\", false, false, false, true)
            dxDrawText(nuls .. hexColor .. money ..\" #ffffff$\", x, y, x + w, y + h, tocolor(255,255,255,255), 1, \"pricedown\", \"center\", \"center\", false, false, false, true)
        end
    end
end

 
 
 

Nem elérhető Dia

Mta san andreas scriptelés segitség kérés
« Válasz #1 Dátum: 2019. Augusztus 17. - 18:57:38 »
0

local money = getElementData(localPlayer, \"char >> money\")
local moneyChanging = false
local newMoney = 0
local maxNuls = 10
local nulsText = \"0000\"
local nuls = utfSub(nulsText, 1, maxNuls - string.len(tostring(money)))
--local money = convertNumber(getElementData(localPlayer, \"char >> money\"))
local typeColors = {
    [\"+\"] = \"#7cc576\",
    [\"-\"] = \"#d02424\",
}
addEventHandler(\"onClientElementDataChange\", localPlayer,
    function(dName, oValue)
        if oValue == nil or not oValue then oValue = 0 end
        if dName == \"char >> money\" then
            local value = getElementData(source, dName)
            nuls = utfSub(nulsText, 1, maxNuls - string.len(tostring(value)))
            money = convertNumber(value)
            if value > oValue then
                moneyChangeType = \"+\"
                newMoney = value - oValue
                money = typeColors[moneyChangeType] .. money
            elseif oValue > value then
                moneyChangeType = \"-\"
                newMoney = oValue - value
                money = typeColors[moneyChangeType] .. money
            end
            playSound(\"files/moneychange.mp3\")
            money = convertNumber(money)
            moneyChanging = true
            setTimer(
                function()
                    moneyChanging = false
                    money = getElementData(localPlayer, \"char >> money\")
                    nuls = utfSub(nulsText, 1, maxNuls - string.len(tostring(money)))
                end, 2500, 1
            )
        end
    end
)
function drawnMoney()
    if not getElementData(localPlayer, \"hudVisible\") then return end
    --Money
    local enabled,x,y,w,h,sizable,turnable = getDetails(\"money\")
    if moneyChanging then
        shadowedText(moneyChangeType .. newMoney .. \" Ft\", x, y, x + w, y + h, tocolor(255,255,255,255), 1, \"pricedown\", \"center\", \"center\", false, false, false, true)
        dxDrawText(moneyChangeType .. typeColors[moneyChangeType] .. newMoney .. \" #ffffffFt\", x, y, x + w, y + h, tocolor(255,255,255,255), 1, \"pricedown\", \"center\", \"center\", false, false, false, true)
    else
        if money < 0 then
            shadowedText(nuls .. money ..\" Ft\", x, y, x + w, y + h, tocolor(255,255,255,255), 1, \"pricedown\", \"center\", \"center\", false, false, false, true)
            dxDrawText(nuls .. typeColors[\"-\"] .. money ..\" #ffffffFt\", x, y, x + w, y + h, tocolor(255,255,255,255), 1, \"pricedown\", \"center\", \"center\", false, false, false, true)
        else
            shadowedText(nuls .. money ..\" Ft\", x, y, x + w, y + h, tocolor(255,255,255,255), 1, \"pricedown\", \"center\", \"center\", false, false, false, true)
            dxDrawText(nuls .. hexColor .. money ..\" #ffffffFt\", x, y, x + w, y + h, tocolor(255,255,255,255), 1, \"pricedown\", \"center\", \"center\", false, false, false, true)
        end
    end
end

 
 

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal