WASSIm. Posted March 19, 2013 Share Posted March 19, 2013 hi guys i have problem plis help local sx,sy = guiGetScreenSize ( ) addEventHandler ( "onClientRender", root, function ( ) local noreloadweapons = {} 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 = {} 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 local playerWeapon = getPedWeapon ( localPlayer ) local playerAmmo = getPedTotalAmmo ( localPlayer ) local playerAmmo2 = getPedTotalAmmo(localPlayer)-getPedAmmoInClip(localPlayer) local playerAmmoc = getPedAmmoInClip (localPlayer) local playerHealth = getElementHealth ( localPlayer ) local playerArmor = getPedArmor ( localPlayer ) local hour, mins = getTime ( ) local money = getPlayerMoney ( ) local wanted = getPlayerWantedLevel ( ) -------------------- weapon local wpx1, wpy1, wpx2, wpy2 = sx*(1205.0/1440),sy*(75.0/900),sx*(232.0/1440),sy*(27.0/900) local wpx5, wpy5, wpx6, wpy6 = sx*(1310.0/1440),sy*(76.0/900),sx*(20.0/1440),sy*(20.0/900) -------------------- ammo local amx1, amy1, amx2, amy2 = sx*(1205.0/1440),sy*(117.0/900),sx*(232.0/1440),sy*(27.0/900) local amx3, amy3, amx4, amy4 = sx*(1209.0/1440),sy*(119.0/900),playerAmmo*sx*(224.0/1440)/100,sy*(19.0/900) local amx5, amy5, amx6, amy6 = sx*(1310.0/1440),sy*(118.0/900),sx*(20.0/1440),sy*(20.0/900) -------------------- health local hx1, hy1, hx2, hy2 = sx*(1205.0/1440),sy*(157.0/900),sx*(232.0/1440),sy*(27.0/900) local hx3, hy3, hx4, hy4 = sx*(1209.0/1440),sy*(161.0/900),playerHealth*sx*(224.0/1440)/100,sy*(19.0/900) local hx5, hy5, hx6, hy6 = sx*(1310.0/1440),sy*(160.0/900),sx*(20.0/1440),sy*(20.0/900) -------------------- Armor local ax1, ay1, ax2, ay2 = sx*(1205.0/1440),sy*(197.0/900),sx*(232.0/1440),sy*(27.0/900) local ax3, ay3, ax4, ay4 = sx*(1209.0/1440),sy*(201.0/900),playerArmor*sx*(224.0/1440)/100,sy*(19.0/900) local ax5, ay5, ax6, ay6 = sx*(1310.0/1440),sy*(202.0/900),sx*(23.0/1440),sy*(20.0/900) --------------------time local tx1, ty1, tx2, ty2 = sx*(1205.0/1440),sy*(235.0/900),sx*(232.0/1440),sy*(27.0/900) local tx5, ty5, tx6, ty6 = sx*(1310.0/1440),sy*(238.0/900),sx*(20.0/1440),sy*(20.0/900) --------------------money local mx1, my1, mx2, my2 = sx*(1205.0/1440),sy*(275.0/900),sx*(232.0/1440),sy*(27.0/900) local mx5, my5, mx6, my6 = sx*(1310.0/1440),sy*(278.0/900),sx*(20.0/1440),sy*(20.0/900) --------------------wanted local wx1, wy1, wx2, wy2 = sx*(1205.0/1440),sy*(315.0/900),sx*(232.0/1440),sy*(27.0/900) local wx5, wy5, wx6, wy6 = sx*(1310.0/1440),sy*(314.0/900),sx*(20.0/1440),sy*(20.0/900) local showammo1 = playerAmmoc local showammo2 = playerAmmo local showammo3 = playerAmmo2 local currenthealth = math.floor(playerHealth) local currentarmor = math.floor(playerArmor) local currentammo = math.floor(playerAmmo) local time = hour .. ":" .. (((mins < 10) and "0"..mins) or mins) theAmmo = ( currentammo * 10 ) local AmmoColor = math.max(theAmmo - 250, 0)/750 local AmmoColorMath = -510*(AmmoColor^2) local rh, gh = math.max(math.min(AmmoColorMath + 255*AmmoColor + 255, 255), 0), math.max(math.min(AmmoColorMath + 765*AmmoColor, 255), 0) theHealth = ( playerHealth * 10 ) local HealthColor = math.max(theHealth - 250, 0)/750 local HealthColorMath = -510*(HealthColor^2) local rh, gh = math.max(math.min(HealthColorMath + 255*HealthColor + 255, 255), 0), math.max(math.min(HealthColorMath + 765*HealthColor, 255), 0) theArmor = ( playerArmor * 10 ) local ArmorColor = math.max(theArmor - 250, 0)/750 local ArmorColorMath = -510*(ArmorColor^2) local ra, ga = math.max(math.min(ArmorColorMath + 255*ArmorColor + 255, 255), 0), math.max(math.min(ArmorColorMath + 765*ArmorColor, 255), 0) if ( playerWeapon ) then dxDrawRectangle(wpx1, wpy1, wpx2, wpy2,tocolor(0,0,0,150),false) dxDrawImage(wpx5-150, wpy5+1, wpx6, wpy6,"images/health.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) dxDrawText(""..tostring(playerWeapon).."%",wpx1+100, wpy1-2, wpx2, wpy2,tocolor(255,255,255,255),1.6,"sans","left","top",false,false,false) end if ( playerAmmo ) then dxDrawRectangle(amx1, amy1, amx2, amy2,tocolor(0,0,0,150),false) dxDrawRectangle(amx3, amy3, amx4, amy4,tocolor(rh,gh,0,170),false) dxDrawImage(amx5-150, amy5+1, amx6, amy6,"images/health.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) if noreloadweapons [playerWeapon] then dxDrawText(""..tostring(showammo3).."",amx3+100, amy3-2, amx4, amy4,tocolor(255,255,255,255),1.6,"sans","left","top",false,false,false) elseif meleespecialweapons [playerWeapon] then --nothing else noreloadweapons [playerWeapon] dxDrawText(""..tostring(showammo1).."-",amx3+50, amy3-2, amx4, amy4,tocolor(255,255,255,255),1.6,"sans","left","top",false,false,false) dxDrawText(""..tostring(showammo2).."",amx3+100, amy3-2, amx4, amy4,tocolor(255,255,255,255),1.6,"sans","left","top",false,false,false) end end if ( playerHealth ) then dxDrawRectangle(hx1, hy1, hx2, hy2,tocolor(0,0,0,150),false) dxDrawRectangle(hx3, hy3, hx4, hy4,tocolor(rh,gh,0,170),false) dxDrawImage(hx5-150, hy5+1, hx6, hy6,"images/health.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) dxDrawText(""..tostring(currenthealth).."%",hx3+100, hy3-2, hx4, hy4,tocolor(255,255,255,255),1.6,"sans","left","top",false,false,false) end if ( playerArmor ) then dxDrawRectangle(ax1, ay1, ax2, ay2,tocolor(0,0,0,150),false) dxDrawRectangle(ax3, ay3, ax4, ay4,tocolor(ra,ga,0,170),false) dxDrawImage(ax5-150, ay5+1, ax6, ay6,"images/armor.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) dxDrawText(""..tostring(currentarmor).."%",ax3+100, ay3-2, ax4, ay4,tocolor(255,255,255,255),1.6,"sans","left","top",false,false,false) end if ( hour ) then dxDrawRectangle(tx1, ty1, tx2, ty2,tocolor(0,0,0,150),false) dxDrawImage(tx5-150, ty5+1, tx6, ty6,"images/time.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) dxDrawText(""..tostring(time).."",tx1+110, ty1+2, tx2, ty4,tocolor(255,255,255,255),1.6,"sans","left","top",false,false,false) end if ( money ) then dxDrawRectangle(mx1, my1, mx2, my2,tocolor(0,0,0,150),false) dxDrawImage(mx5-150, my5+1, mx6, my6,"images/money.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) dxDrawText(""..tostring(money).."",mx1+125, my1+2, mx2, my4,tocolor(255,255,255,255),1.6,"sans","left","top",false,false,false) end if ( wanted ) then dxDrawRectangle(wx1, wy1, wx2, wy2,tocolor(0,0,0,150),false) dxDrawImage(wx5-150, wy5+1, wx6, wy6,"images/wanted.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) dxDrawText(""..tostring(wanted).."",wx1+125, wy1+2, wx2, wy4,tocolor(255,255,255,255),1.6,"sans","left","top",false,false,false) end end ) Link to comment
50p Posted March 19, 2013 Share Posted March 19, 2013 Oh wait. It's an "else", so remove everything on that line except for else. Also, it's better to speak to the script author rather than ask here. He will be able to help you quicker because he knows his scripts. Link to comment
50p Posted March 19, 2013 Share Posted March 19, 2013 You're asking me who made this script? How am I supposed to know that? Check meta.xml to find out who made it. Link to comment
WASSIm. Posted March 19, 2013 Author Share Posted March 19, 2013 no no no me i made this script jus i need help fix my problem Link to comment
DNL291 Posted March 19, 2013 Share Posted March 19, 2013 Try this: local sx,sy = guiGetScreenSize ( ) addEventHandler ( "onClientRender", root, function ( ) local noreloadweapons = {} 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 = {} 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 local playerWeapon = getPedWeapon ( localPlayer ) local playerAmmo = getPedTotalAmmo ( localPlayer ) local playerAmmo2 = getPedTotalAmmo(localPlayer)-getPedAmmoInClip(localPlayer) local playerAmmoc = getPedAmmoInClip (localPlayer) local playerHealth = getElementHealth ( localPlayer ) local playerArmor = getPedArmor ( localPlayer ) local hour, mins = getTime ( ) local money = getPlayerMoney ( ) local wanted = getPlayerWantedLevel ( ) -------------------- weapon local wpx1, wpy1, wpx2, wpy2 = sx*(1205.0/1440),sy*(75.0/900),sx*(232.0/1440),sy*(27.0/900) local wpx5, wpy5, wpx6, wpy6 = sx*(1310.0/1440),sy*(76.0/900),sx*(20.0/1440),sy*(20.0/900) -------------------- ammo local amx1, amy1, amx2, amy2 = sx*(1205.0/1440),sy*(117.0/900),sx*(232.0/1440),sy*(27.0/900) local amx3, amy3, amx4, amy4 = sx*(1209.0/1440),sy*(119.0/900),playerAmmo*sx*(224.0/1440)/100,sy*(19.0/900) local amx5, amy5, amx6, amy6 = sx*(1310.0/1440),sy*(118.0/900),sx*(20.0/1440),sy*(20.0/900) -------------------- health local hx1, hy1, hx2, hy2 = sx*(1205.0/1440),sy*(157.0/900),sx*(232.0/1440),sy*(27.0/900) local hx3, hy3, hx4, hy4 = sx*(1209.0/1440),sy*(161.0/900),playerHealth*sx*(224.0/1440)/100,sy*(19.0/900) local hx5, hy5, hx6, hy6 = sx*(1310.0/1440),sy*(160.0/900),sx*(20.0/1440),sy*(20.0/900) -------------------- Armor local ax1, ay1, ax2, ay2 = sx*(1205.0/1440),sy*(197.0/900),sx*(232.0/1440),sy*(27.0/900) local ax3, ay3, ax4, ay4 = sx*(1209.0/1440),sy*(201.0/900),playerArmor*sx*(224.0/1440)/100,sy*(19.0/900) local ax5, ay5, ax6, ay6 = sx*(1310.0/1440),sy*(202.0/900),sx*(23.0/1440),sy*(20.0/900) --------------------time local tx1, ty1, tx2, ty2 = sx*(1205.0/1440),sy*(235.0/900),sx*(232.0/1440),sy*(27.0/900) local tx5, ty5, tx6, ty6 = sx*(1310.0/1440),sy*(238.0/900),sx*(20.0/1440),sy*(20.0/900) --------------------money local mx1, my1, mx2, my2 = sx*(1205.0/1440),sy*(275.0/900),sx*(232.0/1440),sy*(27.0/900) local mx5, my5, mx6, my6 = sx*(1310.0/1440),sy*(278.0/900),sx*(20.0/1440),sy*(20.0/900) --------------------wanted local wx1, wy1, wx2, wy2 = sx*(1205.0/1440),sy*(315.0/900),sx*(232.0/1440),sy*(27.0/900) local wx5, wy5, wx6, wy6 = sx*(1310.0/1440),sy*(314.0/900),sx*(20.0/1440),sy*(20.0/900) local showammo1 = playerAmmoc local showammo2 = playerAmmo local showammo3 = playerAmmo2 local currenthealth = math.floor(playerHealth) local currentarmor = math.floor(playerArmor) local currentammo = math.floor(playerAmmo) local time = hour .. ":" .. (((mins < 10) and "0"..mins) or mins) theAmmo = ( currentammo * 10 ) local AmmoColor = math.max(theAmmo - 250, 0)/750 local AmmoColorMath = -510*(AmmoColor^2) local rh, gh = math.max(math.min(AmmoColorMath + 255*AmmoColor + 255, 255), 0), math.max(math.min(AmmoColorMath + 765*AmmoColor, 255), 0) theHealth = ( playerHealth * 10 ) local HealthColor = math.max(theHealth - 250, 0)/750 local HealthColorMath = -510*(HealthColor^2) local rh, gh = math.max(math.min(HealthColorMath + 255*HealthColor + 255, 255), 0), math.max(math.min(HealthColorMath + 765*HealthColor, 255), 0) theArmor = ( playerArmor * 10 ) local ArmorColor = math.max(theArmor - 250, 0)/750 local ArmorColorMath = -510*(ArmorColor^2) local ra, ga = math.max(math.min(ArmorColorMath + 255*ArmorColor + 255, 255), 0), math.max(math.min(ArmorColorMath + 765*ArmorColor, 255), 0) if ( playerWeapon ) then dxDrawRectangle(wpx1, wpy1, wpx2, wpy2,tocolor(0,0,0,150),false) dxDrawImage(wpx5-150, wpy5+1, wpx6, wpy6,"images/health.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) dxDrawText(""..tostring(playerWeapon).."%",wpx1+100, wpy1-2, wpx2, wpy2,tocolor(255,255,255,255),1.6,"sans","left","top",false,false,false) end if ( playerAmmo ) then dxDrawRectangle(amx1, amy1, amx2, amy2,tocolor(0,0,0,150),false) dxDrawRectangle(amx3, amy3, amx4, amy4,tocolor(rh,gh,0,170),false) dxDrawImage(amx5-150, amy5+1, amx6, amy6,"images/health.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) if noreloadweapons [playerWeapon] then dxDrawText(""..tostring(showammo3).."",amx3+100, amy3-2, amx4, amy4,tocolor(255,255,255,255),1.6,"sans","left","top",false,false,false) elseif meleespecialweapons [playerWeapon] then --nothing elseif not noreloadweapons [playerWeapon] then dxDrawText(""..tostring(showammo1).."-",amx3+50, amy3-2, amx4, amy4,tocolor(255,255,255,255),1.6,"sans","left","top",false,false,false) dxDrawText(""..tostring(showammo2).."",amx3+100, amy3-2, amx4, amy4,tocolor(255,255,255,255),1.6,"sans","left","top",false,false,false) end end if ( playerHealth ) then dxDrawRectangle(hx1, hy1, hx2, hy2,tocolor(0,0,0,150),false) dxDrawRectangle(hx3, hy3, hx4, hy4,tocolor(rh,gh,0,170),false) dxDrawImage(hx5-150, hy5+1, hx6, hy6,"images/health.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) dxDrawText(""..tostring(currenthealth).."%",hx3+100, hy3-2, hx4, hy4,tocolor(255,255,255,255),1.6,"sans","left","top",false,false,false) end if ( playerArmor ) then dxDrawRectangle(ax1, ay1, ax2, ay2,tocolor(0,0,0,150),false) dxDrawRectangle(ax3, ay3, ax4, ay4,tocolor(ra,ga,0,170),false) dxDrawImage(ax5-150, ay5+1, ax6, ay6,"images/armor.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) dxDrawText(""..tostring(currentarmor).."%",ax3+100, ay3-2, ax4, ay4,tocolor(255,255,255,255),1.6,"sans","left","top",false,false,false) end if ( hour ) then dxDrawRectangle(tx1, ty1, tx2, ty2,tocolor(0,0,0,150),false) dxDrawImage(tx5-150, ty5+1, tx6, ty6,"images/time.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) dxDrawText(""..tostring(time).."",tx1+110, ty1+2, tx2, ty4,tocolor(255,255,255,255),1.6,"sans","left","top",false,false,false) end if ( money ) then dxDrawRectangle(mx1, my1, mx2, my2,tocolor(0,0,0,150),false) dxDrawImage(mx5-150, my5+1, mx6, my6,"images/money.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) dxDrawText(""..tostring(money).."",mx1+125, my1+2, mx2, my4,tocolor(255,255,255,255),1.6,"sans","left","top",false,false,false) end if ( wanted ) then dxDrawRectangle(wx1, wy1, wx2, wy2,tocolor(0,0,0,150),false) dxDrawImage(wx5-150, wy5+1, wx6, wy6,"images/wanted.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) dxDrawText(""..tostring(wanted).."",wx1+125, wy1+2, wx2, wy4,tocolor(255,255,255,255),1.6,"sans","left","top",false,false,false) end end ) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now