So here's the update I've done:
(Client-side script)
1. results given here: (On variables line, there is one variable added)
-- Weapon tables for ammo.
local noreloadweapons = {} --Weapons that doesn't reload (including the flamethrower, minigun, which doesn't have reload anim).
noreloadweapons[16] = true
noreloadweapons[17] = true
noreloadweapons[18] = true
noreloadweapons[19] = true
noreloadweapons[25] = true
noreloadweapons[33] = true
noreloadweapons[34] = true
noreloadweapons[35] = true
noreloadweapons[36] = true
noreloadweapons[37] = true
noreloadweapons[38] = true
noreloadweapons[39] = true
noreloadweapons[41] = true
noreloadweapons[42] = true
noreloadweapons[43] = true
local meleespecialweapons = {} --Weapons that don't shoot, and special weapons.
meleespecialweapons[0] = true
meleespecialweapons[1] = true
meleespecialweapons[2] = true
meleespecialweapons[3] = true
meleespecialweapons[4] = true
meleespecialweapons[5] = true
meleespecialweapons[6] = true
meleespecialweapons[7] = true
meleespecialweapons[8] = true
meleespecialweapons[9] = true
meleespecialweapons[10] = true
meleespecialweapons[11] = true
meleespecialweapons[12] = true
meleespecialweapons[13] = true
meleespecialweapons[14] = true
meleespecialweapons[15] = true
meleespecialweapons[40] = true
meleespecialweapons[44] = true
meleespecialweapons[45] = true
meleespecialweapons[46] = true
function DXdraw()
--Variables
sWidth, sHeight = guiGetScreenSize()
health = getElementHealth( getLocalPlayer() )
lineLength1 = 114 * ( health / 100 ) -- Health bar
armor = getPedArmor( getLocalPlayer() )
lineLength2 = 114 * ( armor / 100 ) -- Armor bar
ammoinclip = getPedAmmoInClip (getLocalPlayer())
totalammo = getPedTotalAmmo (getLocalPlayer())
showammo1 = ammoinclip
showammo2 = totalammo
moneycount=getPlayerMoney(getLocalPlayer())
money= '$' ..moneycount -- Get the player's money
local hour, mins = getTime ()
time = hour.. ':' ..mins -- Get GTA SA time
local wantedlevel = getPlayerWantedLevel (getLocalPlayer()) --Getting the player's wanted level.
-- End of variables line.
-- first draw the stuff which is visible at all times
dxDrawRectangle(sWidth-206,sHeight-43,lineLength2,14.0,tocolor(200,200,200,200),false) -- Armor active bar
dxDrawRectangle(sWidth-206,sHeight-23,114.0,14.0,tocolor(50,0,0,150),false) -- Health inactive bar
dxDrawRectangle(sWidth-206,sHeight-43,114.0,14.0,tocolor(50,50,50,150),false) -- Armor inactive bar
dxDrawRectangle(sWidth-206,sHeight-23,lineLength1,14.0,tocolor(175,0,0,200),false) --Health active bar
dxDrawRectangle(sWidth-84,sHeight-48,78.0,33.0,tocolor(0,0,0,150),false) -- GTA Time DX Rectangle
dxDrawText(tostring (money),sWidth-200,sHeight-78,sWidth-5,sHeight-54,tocolor(0,0,0,200),1.0,"pricedown","right","top",false,false,false) -- Money DX text (shadow)
dxDrawText(tostring (money),sWidth-202,sHeight-81,sWidth-7,sHeight-57,tocolor(0,100,0,220),1.0,"pricedown","right","top",false,false,false) -- Money DX text
dxDrawText(tostring (time),sWidth-81,sHeight-46,sWidth-10,sHeight-16,tocolor(250,250,250,200),1.0,"diploma","center","top",false,false,false) -- GTA Time DX text
local weaponID = getPedWeapon (getLocalPlayer()); -- Get weapon ID
dxDrawImage(sWidth-266,sHeight-56,48.0,52.0,"icons/".. tostring( weaponID ) .. ".png",0.0,0.0,0.0,tocolor(255,255,255,200),false) -- Weapon icons image.
-- now decide if the optional stuff should be drawn
if noreloadweapons [getPedWeapon(getLocalPlayer())] then
dxDrawText(tostring (showammo2),sWidth-400,sHeight-42,sWidth-288,sHeight-12,tocolor(0,255,255,200),1.0,"bankgothic","right","top",false,false,false) -- No reload weapons (for shotgun, grenades, etc)
elseif meleespecialweapons [getPedWeapon(getLocalPlayer())] then
-- Draw Nothing for melee and special weapons.
else --Weapons that reloads.
dxDrawText(tostring (showammo1),sWidth-455,sHeight-41,sWidth-387,sHeight-13,tocolor(0,255,255,200),1.0,"bankgothic","right","top",false,false,false)
dxDrawText("|",sWidth-381,sHeight-42,sWidth-366,sHeight-8,tocolor(255,200,0,200),1.0,"bankgothic","left","top",false,false,false)
dxDrawText(tostring (showammo2),sWidth-365,sHeight-41,sWidth-272,sHeight-12,tocolor(0,255,255,200),1.0,"bankgothic","left","top",false,false,false)
-- Wanted level DX images
if wantedlevel = 0 then
-- Draw nothing (Wanted level 0)
elseif wantedlevel = 1 then
dxDrawImage(1003.0,556.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(0,0,0,100),false)
dxDrawImage(1003.0,578.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(0,0,0,100),false)
dxDrawImage(1003.0,600.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(0,0,0,100),false)
dxDrawImage(1003.0,620.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(0,0,0,100),false)
dxDrawImage(1003.0,642.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(0,0,0,100),false)
dxDrawImage(1003.0,663.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(255,255,255,200),false) -- Wanted level 1
elseif wantedlevel = 2 then
dxDrawImage(1003.0,556.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(0,0,0,100),false)
dxDrawImage(1003.0,578.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(0,0,0,100),false)
dxDrawImage(1003.0,600.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(0,0,0,100),false)
dxDrawImage(1003.0,620.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(0,0,0,100),false)
dxDrawImage(1003.0,642.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(255,255,255,200),false) -- Wanted level 2
dxDrawImage(1003.0,663.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(255,255,255,200),false)
elseif wantedlevel = 3 then
dxDrawImage(1003.0,556.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(0,0,0,100),false)
dxDrawImage(1003.0,578.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(0,0,0,100),false)
dxDrawImage(1003.0,600.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(0,0,0,100),false)
dxDrawImage(1003.0,620.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(255,255,255,200),false) -- Wanted level 3
dxDrawImage(1003.0,642.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(255,255,255,200),false)
dxDrawImage(1003.0,663.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(255,255,255,200),false)
elseif wantedlevel = 4 then
dxDrawImage(1003.0,556.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(0,0,0,100),false)
dxDrawImage(1003.0,578.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(0,0,0,100),false)
dxDrawImage(1003.0,600.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(255,255,255,200),false) -- Wanted level 4
dxDrawImage(1003.0,620.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(255,255,255,200),false)
dxDrawImage(1003.0,642.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(255,255,255,200),false)
dxDrawImage(1003.0,663.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(255,255,255,200),false)
elseif wantedlevel = 5 then
dxDrawImage(1003.0,556.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(0,0,0,100),false)
dxDrawImage(1003.0,578.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(255,255,255,200),false) -- Wanted level 5
dxDrawImage(1003.0,600.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(255,255,255,200),false)
dxDrawImage(1003.0,620.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(255,255,255,200),false)
dxDrawImage(1003.0,642.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(255,255,255,200),false)
dxDrawImage(1003.0,663.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(255,255,255,200),false)
else
dxDrawImage(1003.0,556.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(255,255,255,200),false) -- Wanted level 6
dxDrawImage(1003.0,578.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(255,255,255,200),false)
dxDrawImage(1003.0,600.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(255,255,255,200),false)
dxDrawImage(1003.0,620.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(255,255,255,200),false)
dxDrawImage(1003.0,642.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(255,255,255,200),false)
dxDrawImage(1003.0,663.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(255,255,255,200),false)
end
end
end
addEventHandler("onClientRender", getRootElement(), DXdraw)
So what's happened here is that the script makes an error: [string = "alternate_hud\client.lua"]:101: "then" expected near "=".
Anybody knows how to fix this?