Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Castillo

    Font changing

    I'm not talking about the MTA DX functions, I'm talking about the dxText library used for race.
  2. Castillo

    Font changing

    the dxText library doesn't support custom fonts if I'm right.
  3. Por lo menos presta atencion si vas a copiar de otro tema. "weaponName" no esta definido, ademas de que es un string seguramente. Te falta un "end".
  4. I don't understand why do you replace it on the first place.
  5. If the wheels are part of the infernus mod, then maybe the problem is that the script is restoring the original infernus too fast.
  6. For scoreboard: elseif column.name == "Home" then local imagePath = ":admin/client/images/flags/".. content:lower ( ) ..".png" if ( fileExists ( imagePath ) ) then dxDrawImage( topX+theX, y+s(1), 16, 11, imagePath, 0, 0, 0, cWhite, drawOverGUI ) end dxDrawText( content, topX+theX+s(1)+20, y+s(1), topX+x+s(1+column.width), y+s(11)+dxGetFontHeight( fontscale(contentFont, scoreboardScale), contentFont ), tocolor( 0, 0, 0, a or 255 ), fontscale(contentFont, s(1)), contentFont, "left", "top", true, false, drawOverGUI ) dxDrawText( content, topX+theX+20, y, topX+x+s(column.width), y+dxGetFontHeight( fontscale(contentFont, scoreboardScale), contentFont ), tocolor( r or 255, g or 255, b or 255, a or 255 ), fontscale(contentFont, s(1)), contentFont, "left", "top", true, false, drawOverGUI ) Script to set home: exports.scoreboard:addScoreboardColumn ( 'Home', getRootElement(), 1, 0.06 ) function showcountry ( ) local flag = exports.admin:getPlayerCountry ( source ) or "N/A" if ( flag ) then setElementData ( source, "Home", flag ) end end addEventHandler ( "onPlayerJoin", getRootElement(), showcountry )
  7. No, that doesn't make any sense.
  8. You can create a table and store the blip element there using the player as index, then on wasted you can get it and destroy it.
  9. Yes, then you add an argument to the function that is executed by "/event".
  10. The flag isn't working?
  11. With these two functions and Lua knowledge.
  12. You can create a function which will loop all players, ignoring the local player, then insert on a table and return a random one. getElementsByType math.random
  13. I guess you have edited the scoreboard to add the country flag, right?
  14. Create a variable, then change the value when you use the command "event" to the value you set. Then you should have a table with all the players in the event, everytime someone joins, check if the limit has been reached.
  15. X~|Mr.ALM's code will show the GUI even if it's a Bus, but it won't do anything if the vehicle is a Bus. ------------------------------------ -- QUANTUMZ - QUANTUMZ - QUANTUMZ -- ------------------------------------ -- 2011 - Romania -- ------------------------------------ -- You can modify this file but -- -- don't change the credits. -- ------------------------------------ ------------------------------------ -- VEHICLECONTROL v1.0 for MTA -- ------------------------------------ GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Scrollbar = {} GUIEditor_Window[1] = guiCreateWindow(709,236,272,288,"Vehicle Control",false) GUIEditor_Scrollbar[1] = guiCreateScrollBar(24,49,225,17,true,false,GUIEditor_Window[1]) GUIEditor_Label[1] = guiCreateLabel(86,30,135,15,"1",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[1],"default-bold-small") GUIEditor_Label[2] = guiCreateLabel(74,72,135,15,"2",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[2],"default-bold-small") GUIEditor_Scrollbar[2] = guiCreateScrollBar(24,91,225,17,true,false,GUIEditor_Window[1]) GUIEditor_Label[3] = guiCreateLabel(68,112,135,15,"3",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[3],"default-bold-small") GUIEditor_Scrollbar[3] = guiCreateScrollBar(24,130,225,17,true,false,GUIEditor_Window[1]) GUIEditor_Label[4] = guiCreateLabel(71,151,135,15,"4",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[4],"default-bold-small") GUIEditor_Scrollbar[4] = guiCreateScrollBar(24,168,225,17,true,false,GUIEditor_Window[1]) GUIEditor_Label[5] = guiCreateLabel(68,189,135,15,"5",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[5],"default-bold-small") GUIEditor_Scrollbar[5] = guiCreateScrollBar(24,206,225,17,true,false,GUIEditor_Window[1]) GUIEditor_Label[6] = guiCreateLabel(83,226,135,15,"6",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[6],"default-bold-small") GUIEditor_Scrollbar[6] = guiCreateScrollBar(24,243,225,17,true,false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(23,265,230,14,"Close",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Button[1],"default-small") guiWindowSetSizable ( GUIEditor_Window[1], false ) setElementData(GUIEditor_Scrollbar[1], "Type", 0) setElementData(GUIEditor_Scrollbar[2], "Type", 2) setElementData(GUIEditor_Scrollbar[3], "Type", 3) setElementData(GUIEditor_Scrollbar[4], "Type", 4) setElementData(GUIEditor_Scrollbar[5], "Type", 5) setElementData(GUIEditor_Scrollbar[6], "Type", 1) guiSetVisible(GUIEditor_Window[1], false) showCursor(false) function enableVehicleControl() if isPedInVehicle( localPlayer ) then local vehicle = getPedOccupiedVehicle ( localPlayer ) if ( getElementModel ( vehicle ) == 431 ) then return end if guiGetVisible(GUIEditor_Window[1]) == false then guiSetVisible(GUIEditor_Window[1], true) showCursor(true) else guiSetVisible(GUIEditor_Window[1], false) showCursor(false) end end end addCommandHandler("cveh", enableVehicleControl) function closeButton() guiSetVisible(GUIEditor_Window[1], false) showCursor(false) end addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], closeButton, false ) function updateRatio(Scrolled) local position = guiScrollBarGetScrollPosition(Scrolled) local door = getElementData(Scrolled, "Type") triggerServerEvent(":~", getLocalPlayer(), door, position) end addEventHandler("onClientGUIScroll", getRootElement(), updateRatio)
  16. You are talking about the scoreboard, right? if you want to also draw the country code, then you can save the country code, and on the scoreboard, draw the image with the path using the country code, then draw also a text.
  17. These wheels are part of the infernus mod itself?
  18. Why create anonymous function if you can pass arguments to setTimer? setTimer ( removeEventHandler, 5000, 1, "onClientRender", root, drawErrorMsg ) Last time I checked, it didn't work this way, haven't tested it since then.
  19. Tenes que obtener el item seleccionado, usa: guiGridListGetSelectedItem guiGridListGetItemText
  20. 'source' esta definido si lo envia desde el cliente.
×
×
  • Create New...