Jump to content

Blinker.

Members
  • Posts

    148
  • Joined

  • Last visited

Everything posted by Blinker.

  1. local font = dxCreateFont( "font.ttf",19 ) function render() local vehicle = getPedOccupiedVehicle(localPlayer) local health = math.round(((getElementHealth(vehicle)-250)/750*100),0) local speed = getElementSpeed(vehicle) if health <= 0 then health = 0 end dxDrawImage ( sw-118, sh/1.15,110,70, 'progress_health_bg.png') dxDrawImage ( sw-118, sh/1.15,speed,70, 'progress_speed.png') dxDrawText(health.."%", sw-118, (sh/1.15)+5,sw-6,1,tocolor(r,g,b,255),1,font,"right") end addEventHandler("onClientRender",root,render)
  2. Blinker.

    Custom font

    Hello folks, i'm using a custom font to draw a vehicle's health ,but i got 2 problems , 1 - it lags when the number changes like if i had 99% hp and i hit someone it will go down to 90 % and here it lags for 1 sec 2 - when the number changes also , a line is drawn under the number like in this photo : http://imgur.com/9PlrSfz nothing more to say.. i've tried bangothic font and it works with 0 lag. any help would be greatly appreciated.
  3. Blinker.

    math.round

    ooo thank you a lot its working !
  4. Blinker.

    math.round

    Hello , sorry i wasn't home , i was on my phone. @ xXMADEXx i did what u said , i got Type: number Value: 0.42857098579407 and no errors in debug @Dealman i got number 0 and number 1 and number 2 in scoreboard without period when my ratio increases
  5. Blinker.

    math.round

    No its a number , i gave just an example , it has a period not a comma on scoreboard
  6. Blinker.

    math.round

    Well so what's the problem here?
  7. Blinker.

    math.round

    i've added it already function math.round(number, decimals, method) decimals = decimals or 0 local factor = 10 ^ decimals if (method == "ceil" or method == "floor") then return math[method](number * factor) / factor else return tonumber(("%."..decimals.."f"):format(number)) end end
  8. Blinker.

    math.round

    Hello , i've got no idea why that's not working , it shows on the column "R" the value '4,5012304213' with so much numbers . i'm using that : setElementData(v,"R",math.round((select[1].r),2) i've tried also tonumber and still not working and no errors in debug , thanks in advance.
  9. it works , thank you
  10. Hello , table[1].arg i was wondering if its possible to change 'arg' to any other thing like that arg = "name" table[1].."."..arg i tried everything with no result Thanks in advance.
  11. well i just figured out the flags were different. thanks anyway
  12. oo yes you're right , thanks. EDIT: well i did : texture = dxCreateTexture( flagPath ) local flag_width, flag_height = dxGetMaterialSize( texture ) dxDrawImage ( dx.Flag, dx.normalpos + 1 - number[1] + (i*20), flag_width, flag_height , flagPath) its same as in scoreboard , and still same result , the flags are now a bit bigger but low resolution also..
  13. Hello folks , i was wondering why the graphics are different in these two images , well i'm trying to draw flags , but it has so low graphics unlike in the scoreboard 1. the flags i'm trying to draw : http://imgur.com/5RrhGWr 2. the flags in scoreboard: http://imgur.com/448MjL0 thats what i'm using dxDrawImage ( dx.Flag, dx.normalpos + 1 - number[1] + (i*20), number[1] - 5,number[1] - 11 , flagPath) thanks
  14. Blinker.

    Question

    Hello folks, i was wondering if there is a way to get mta settings. for example ,i want to get FX quality in video settings of a player. is it possible? Thanks in advance.
  15. Blinker.

    Question

    well , couple days ago i changed my server's name , accounts data are removed now ..
  16. Blinker.

    Question

    Hello Folks , i have a question , does changing the server's name removes accounts data? Thanks in advance.
  17. function teamSetName1(command,Name1) local team1x = tostring(Name1) T1Name = team1x end addCommandHandler("tsn1",teamSetName1)
  18. how did you fix it linkin , can you share the way you fixed it ? or just functions.. hm i need to add it in my script .. so i can't add your whole resource to my script
  19. Necktrox thanks for the tip ... Et-win it was working in my server , but now it stopped working .. no idea what's the problem EDIT : ah i tested it on my friend's server and its working well .. thank you all for help.
  20. i did that Maps = {} function maps() for i, map in ipairs (exports.mapmanager:getMapsCompatibleWithGamemode(exports.mapmanager:getRunningGamemode() )) do if get(getResourceName(map)..".#respawn") == "none" then Maps[i] = getResourceInfo(map, "name") outputChatBox(Maps[i]) -- it does output the maps , so no problem here end end end maps() for i ,v in ipairs (Maps) do outputChatBox'1' -- doesn't output 1 so it fails here end
  21. nah , its same you can write it like that outputChatBox'1' or outputChatBox("1")
  22. @Anubhav , Necktrox it doesn't work.. well i tried that Maps = {} function maps() for i, map in ipairs (exports.mapmanager:getMapsCompatibleWithGamemode(exports.mapmanager:getRunningGamemode() )) do if get(getResourceName(map)..".#respawn") == "none" then Maps[i] = getResourceInfo(map, "name") outputChatBox(Maps[i]) end end end maps() for i ,v in ipairs (Maps) do outputChatBox'1' end it will output the maps but it won't output "1"
  23. I know insert and remove , but this method should work too .. but i don't know the problem
  24. Hello novo , my problem isn't with many words .. , i mean i only need 1 word like "/check ZY" and the script should output "[DD] Cross ZY" but it's not working ..
  25. Hello , function maps() Maps = {} for i, map in ipairs (exports.mapmanager:getMapsCompatibleWithGamemode(exports.mapmanager:getRunningGamemode() )) do if get(getResourceName(map)..".#respawn") == "none" then Maps[i] = getResourceInfo(map, "name") end end end function check(p,_,mapName) maps() for i, v in ipairs (Maps) do outputChatBox(i.." - "..v) if string.find(v,string.upper(mapName)) then outputChatBox("map found") end end end addCommandHandler("check",check) no errors , the script doesn't output anything. any help would be greatly appreciated.
×
×
  • Create New...