Hi,
ich habe ein kleines Problem undzwar die Wanteds im HUD sind wenn man 0 Wanteds hat bereits da jedoch klein, wenn man Wantedlevel erhält werden sie größer, wie könnte man es machen das die Wanteds erst erscheinen wenn man Wanted leven erhält?
Externer Inhalt
www11.pic-upload.de
Inhalte von externen Seiten werden ohne Ihre Zustimmung nicht automatisch geladen und angezeigt.
Lua
_G["w_1"] = 15
_G["w_2"] = 15
_G["w_3"] = 15
_G["w_4"] = 15
_G["w_5"] = 15
_G["w_6"] = 15
function wanteds_remove(wo, wn)
if isTimer(w_timer) then
killTimer(w_timer)
end
w_1 = 15
w_2 = 15
w_3 = 15
w_4 = 15
w_5 = 15
w_6 = 15
if wo >= 1 then
for i = 1,wo do
_G["w_"..i] = 0
end
end
w_timer = setTimer(function()
if w_1 == 14 or w_2 == 14 or w_3 == 14 or w_4 == 14 or w_5 == 14 or w_6 == 14 then
playSoundFrontEnd ( 42 )
end
if w_6 < 15 then
w_6 = w_6+1
elseif w_5 < 15 then
w_5 = w_5+1
elseif w_4 < 15 then
w_4 = w_4+1
elseif w_3 < 15 then
w_3 = w_3+1
elseif w_2 < 15 then
w_2 = w_2+1
elseif w_1 < 15 then
w_1 = w_1+1
end
end, 50, tonumber(wo-wn)*15)
end
function wanteds_add(wo, wn)
if isTimer(w_timer) then
killTimer(w_timer)
end
w_2 = 15
w_3 = 15
w_4 = 15
w_5 = 15
w_6 = 15
if wo >= 1 then
for i = 1,wo do
__G["w_"..i] = 0
end
end
w_timer = setTimer(function()
if w_1 == 1 or w_2 == 1 or w_3 == 1 or w_4 == 1 or w_5 == 1 or w_6 == 1 then
playSoundFrontEnd ( 42 )
end
if w_1 > 0 then
w_1 = w_1-1
elseif w_2 > 0 then
w_2 = w_2-1
elseif w_3 > 0 then
w_3 = w_3-1
elseif w_4 > 0 then
w_4 = w_4-1
elseif w_5 > 0 then
w_5 = w_5-1
elseif w_6 > 0 then
w_6 = w_6-1
end
end, 50, tonumber(wn-wo)*15)
end
local w_old = 0
local w_new = 0
addEventHandler("onClientRender", root,
function()
local w_new = getPlayerWantedLevel(lp) or 0
if w_new > w_old then
wanteds_add(w_old, w_new)
w_old = w_new
elseif w_new < w_old then
wanteds_remove(w_old, w_new)
w_old = w_new
end
dxDrawImage(1117+21+30*0+w_1*valx, 196+w_1*valy, 30-w_1*2*valx, 30-w_1*2*valy, "images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), true)
dxDrawImage(1117+21+30*1+w_2*valx, 196+w_2*valy, 30-w_2*2*valx, 30-w_2*2*valy, "images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), true)
dxDrawImage(1117+21+30*2+w_3*valx, 196+w_3*valy, 30-w_3*2*valx, 30-w_3*2*valy, "images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), true)
dxDrawImage(1117+21+30*3+w_4*valx, 196+w_4*valy, 30-w_4*2*valx, 30-w_4*2*valy, "images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), true)
dxDrawImage(1117+21+30*4+w_5*valx, 196+w_5*valy, 30-w_5*2*valx, 30-w_5*2*valy, "images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), true)
dxDrawImage(1117+21+30*5+w_6*valx, 196+w_6*valy, 30-w_6*2*valx, 30-w_6*2*valy, "images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), true)
end
Alles anzeigen
MfG Bolschek