Jump to content

Banex

Members
  • Posts

    230
  • Joined

  • Last visited

Everything posted by Banex

  1. Banex

    dxdraw problem

    Try this: Server side local account = getPlayerAccount(thePlayer) local accountName = getAccountName(account) function setDataOnLogin(thePlayer) if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Admin" ) ) ) then setElementData(thePlayer,"showimg",true) end end addEventHandler ( "onPlayerLogin", root, setDataOnLogin ) Client side local sx,sy = guiGetScreenSize() local px,py = 1600,900 local x,y = (sx/px), (sy/py) function showImage() if getElementData(localPlayer, "showimg") then dxDrawImage(x*800, y*600, x*800, y*600, "player.png" ) end end addEventHandler("onClientRender", root, showImage)
  2. Banex

    dxdraw problem

    Use the last code of MrBrutus, and the server-side script you posted here before
  3. Banex

    dxdraw problem

    You need to get the player's account on the server side To answer your other question: local sx,sy = guiGetScreenSize() local px,py = 1600,900 local x,y = (sx/px), (sy/py) dxDrawImage(x*800, y*600, x*800,y*600, "player.png" )
  4. addEventHandler ("onClientGUIClick", root, function () if (source == spawnBut) then triggerServerEvent ("carSpawn", lp) guiSetVisible (theWindow, false) showCursor (false) elseif (source == destroyBut) then triggerServerEvent ("carDestroy", lp) guiSetVisible (theWindow, false) showCursor (false) elseif (source == closeBut) then guiSetVisible (theWindow, false) showCursor (false) end end)
  5. @Sr.Zika you put a label on top of the rectangle to the panel? That is not to create a panel in DX ... you just is giving a false appearance to the panel. Since the panel always work with functions in GUI
  6. oh, he did not ask how to do GUI @XeroxMTA maybe this will help you https://forum.multitheftauto.com/viewtopic.php?f ... 62#p653562
  7. function FOYChat ( thePlayer, _, ... ) local message = table.concat ( { ... }, " " ) local team = getPlayerTeam(thePlayer) local r, g, b = getPlayerNametagColor(thePlayer) for _, member in ipairs( getPlayersInTeam(team) ) do outputChatBox('#00FF00|FOY Chat| :' .. getPlayerName(thePlayer) .. ': #FFFFFF' .. message, member, r, g, b, true) end end end) addCommandHandler ( "FOYChat", FOYChat ) addEventHandler ( 'onPlayerJoin', getRootElement(), function () bindKey(source,"y","down","chatbox","FOYChat") end)
  8. addEventHandler("onPlayerChat", root, function(msg, messageType) if messageType == 2 then cancelEvent() local team = getPlayerTeam(source) local r, g, b = getPlayerNametagColor(source) for _, member in ipairs( getPlayersInTeam(team) ) do outputChatBox('#00FF00|FOY Chat| :' .. getPlayerName(source) .. ': #FFFFFF' .. msg:gsub('#%x%x%x%x%x%x', ''), member, r, g, b, true) end end end)
  9. addEventHandler ( "onClientGUIClick", root, function () if ( source == closeBut ) then destroyElement(theWindow,false) showCursor ( false ) end end)
  10. Is this what you're looking for? https://community.multitheftauto.com/in ... ls&id=2136
  11. Edit This is not the best way to do this
  12. Good job, keep it up
  13. Original: https://community.multitheftauto.com/in ... ls&id=9192 Copy: https://community.multitheftauto.com/ind ... s&id=10208 DONE
  14. Banex

    Hud

    ever heard of /debugscript 3? try this tables = { health="", } function convertNumber ( number ) local formatted = number while true do formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2') if ( k==0 ) then break end end return formatted end function getPedMaxHealth(ped) -- Output an error and stop executing the function if the argument is not valid assert(isElement(ped) and (getElementType(ped) == "ped" or getElementType(ped) == "player"), "Bad argument @ 'getPedMaxHealth' [Expected ped/player at argument 1, got " .. tostring(ped) .. "]") -- Grab his player health stat. local stat = getPedStat(ped, 24) -- Do a linear interpolation to get how many health a ped can have. -- Assumes: 100 health = 569 stat, 200 health = 1000 stat. local maxhealth = 100 + (stat - 569) / 4.31 -- Return the max health. Make sure it can't be below 1 return math.max(1, maxhealth) end addEventHandler("onClientRender", root, function() setPlayerHudComponentVisible( "money", false ) setPlayerHudComponentVisible( "armour", false ) setPlayerHudComponentVisible( "clock", false ) setPlayerHudComponentVisible( "health", false ) setPlayerHudComponentVisible( "ammo", false ) setPlayerHudComponentVisible( "weapon", false ) local hp = getElementHealth (localPlayer) local money = convertNumber(getPlayerMoney(localPlayer)) local h, m = getTime() local ammo = getPedTotalAmmo(localPlayer)-getPedAmmoInClip(localPlayer).."-"..getPedAmmoInClip(localPlayer) local screenW, screenH = guiGetScreenSize() dxDrawText("HEALTH: "..math.floor(tostring(hp)).."%", 280, (screenH - 42) / 1.09, (280) + 423, ( (screenH - 42) / 1.09) + 42, tocolor(255, 0, 0, 255), 1.00, "pricedown", "left", "top", true, true, true, true, false) dxDrawText("HEALTH: "..math.floor(tostring(hp)).."%", 281, 862, 538, 904, tocolor(0, 0, 0, 255), 1.00, "pricedown", "center", "top", true, true, true, true, false) dxDrawText("MONEY: $"..money, 281, 862, 538, 904, tocolor(0, 0, 0, 255), 1.00, "pricedown", "center", "top", true, true, true, true, false) dxDrawText("MONEY: $"..money, 280, (screenH - 42) / 1.14, (280) + 257, ( (screenH - 42) / 1.14) + 42, tocolor(0, 100, 0, 154), 1.00, "pricedown", "center", "top", true, true, true, true, false) dxDrawText("TIME: "..h..":"..m, 277, 828, 416, 860, tocolor(0, 0, 0, 255), 1.00, "pricedown", "left", "top", true, true, true, true, false) dxDrawText("TIME: "..h..":"..m, 276, (screenH - 32) / 1.2, (276) + 139, ( (screenH - 32) / 1.2) + 32, tocolor(56, 56, 56, 255), 1.00, "pricedown", "left", "top", true, true, true, true, false end )
  15. Banex

    Carspeed

    This is not a forum for requests, if you want someone to create something for you, you will have to pay for it.
  16. Banex

    New Hud #Samy

    You put a false image of a HUD, and I come here and post the original image. And I'm boring? Okay ... @Edit And besides, it's only a HUD, I would be ashamed to create a topic about HUD and still have created a topic asking for help. That for a person who is already scripter more than two years already should know this
  17. Banex

    New Hud #Samy

    Sure ... DEMO version but at least you should show the original image version
  18. Banex

    New Hud #Samy

    It really is no big deal
  19. I repeat, convertNumber is not a function of the MTA convertNumber is a function created by any one person, she has no connection with the MTA So it will not work if you do not add the code to your script !!! if you do not put the code in your script, you will have no result https://wiki.multitheftauto.com/wiki/ConvertNumber @Edit I tested it and it works normally you just need to add the convertNumber function in your script. Can not you understand that?
  20. convertNumber and tonumber bears no resemblance ConverteNumber will show the number with commas, for example: 1,000,000 In this example the wiki, tonumber will be the number you want to set your Money, example: / setcash 1000000 If you are asking this because of the lcd1232 reply, he is wrong, it is not necessary to use tonumber because getPlayerMoney already generates a number
×
×
  • Create New...