Jump to content

dxDrawImage poblem heeeelp


yoya99

Recommended Posts

Hello friends ...here is my codefor my lvl system...i have a problem i want it to draw images for each lvl...But for some reason it is not working....here are all codes:

a part only_:

function win(ammo, killer, weapon, bodypart) 
    if (killer and getElementType(killer) == "player" and killer ~= source) then 
        local H = getElementData(killer, "XP") or 5 
        local S = getElementData(killer, "Level") 
        local killer1 = getPlayerName(killer) 
        local noob = getPlayerName(source) 
        local X = 1 
        setElementData(killer, "XP", tonumber(H)+X) 
        local H = tonumber(H) + X 
        if tonumber(H) == 2 then 
        setElementData(killer, "Level", "1") 
        elseif tonumber(H) == 5 then 
        setElementData(killer, "Level", "2") 
        elseif tonumber(H) == 10 then 
        setElementData(killer, "Level", "3") 

addEventHandler("onPlayerSpawn",root, 
function() 
    local account = getPlayerAccount(source) 
    local S = getElementData(killer, "Level") 
if tonumber(S) == 0 then 
setElementData(source,"Emblems","ranks/lvl_0.png") 
elseif tonumber(S) == 1 then 
setElementData(source,"Emblems","ranks/lvl_1.png") 
elseif tonumber(S) == 2 then 
setElementData(source,"Emblems","ranks/lvl_2.png") 
elseif tonumber(S) == 3 then 
setElementData(source,"Emblems","ranks/lvl_3.png") 
elseif tonumber(S) == 4 then 
setElementData(source,"Emblems","ranks/lvl_4.png") 
elseif tonumber(S) == 5 then 
setElementData(source,"Emblems","ranks/lvl_5.png") 
elseif tonumber(S) == 6 then 
setElementData(source,"Emblems","ranks/lvl_6.png") 
elseif tonumber(S) == 7 then 
setElementData(source,"Emblems","ranks/lvl_7.png") 
elseif tonumber(S) == 8 then 
setElementData(source,"Emblems","ranks/lvl_8.png") 
elseif tonumber(S) == 9 then 
setElementData(source,"Emblems","ranks/lvl_9.png") 
elseif tonumber(S) == 10 then 
setElementData(source,"Emblems","ranks/lvl_10.png") 
elseif tonumber(S) == 11 then 
setElementData(source,"Emblems","ranks/lvl_11.png") 
elseif tonumber(S) == 12 then 
setElementData(source,"Emblems","ranks/lvl_12.png") 
elseif tonumber(S) == 13 then 
setElementData(source,"Emblems","ranks/lvl_13.png") 
elseif tonumber(S) == 14 then 
setElementData(source,"Emblems","ranks/lvl_14.png") 
elseif tonumber(S) == 15 then 
setElementData(source,"Emblems","ranks/lvl_15.png") 
elseif tonumber(S) == 16 then 
setElementData(source,"Emblems","ranks/lvl_16.png") 
elseif tonumber(S) == 17 then 
setElementData(source,"Emblems","ranks/lvl_17.png") 
elseif tonumber(S) == 18 then 
setElementData(source,"Emblems","ranks/lvl_18.png") 
elseif tonumber(S) == 19 then 
setElementData(source,"Emblems","ranks/lvl_19.png") 
elseif tonumber(S) == 20 then 
setElementData(source,"Emblems","ranks/lvl_20.png") 
elseif tonumber(S) == 21 then 
setElementData(source,"Emblems","ranks/lvl_21.png") 
elseif tonumber(S) == 22 then 
setElementData(source,"Emblems","ranks/lvl_22.png") 
elseif tonumber(S) == 23 then 
setElementData(source,"Emblems","ranks/lvl_23.png") 
end 
end 
) 
  
addEventHandler("onPlayerSpawn",root, 
function () 
    local account = getPlayerAccount(source) 
    if isGuestAccount(account) then return end 
    local Emblems = getAccountData(account,"LV") 
    if emblems then 
        setElementData(source,"Emblems", emblems) 
end 
end 
) 

hud part:

  if XP then 
    dxDrawText("XP: "..XP, (336/1024)*sWidth, (745/768)*sHeight, (289/1024)*sWidth, (250/768)*sHeight, tocolor (255, 255, 255, 255), (0.85/1366)*sWidth,(0.9/768)*sHeight,"bankgothic","left","top",false,false,false,true) 
    end 
    if Level then 
    dxDrawText("LV: "..Level, (466/1024)*sWidth, (745/768)*sHeight, (289/1024)*sWidth, (250/768)*sHeight, tocolor (255, 255, 255, 255), (0.85/1366)*sWidth,(0.9/768)*sHeight,"bankgothic","left","top",false,false,false,true) 
    end 
    if emblems and fileExists ( ":experiences/ranks/lvl_"..Rank..".png" ) then 
    size = dxGetFontHeight((0.7/1366)*sWidth, "bankgothic") 
    dxDrawImage((557/1024)*sWidth, (745/768)*sHeight, size, size, ":experiences/ranks/lvl_"..Rank..".png") 

I would be happy ifthis topic would be done ....thx in advance

Edited by Guest
Link to comment
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...