Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Skin mod: https://community.multitheftauto.com/index.php?p= ... ls&id=3582
  2. addEventHandler("onClientResourceStart",resourceRoot, function () if (not isElement(sound)) then sound = playSound("songs/song1.mp3") end end)
  3. Castillo

    Firstperson

    Copia los scripts del FPS a un recurso separado y listo, no es tan dificil.
  4. Works perfectly here, I can warp to myself.
  5. Castillo

    Socoro

    No hay de que . P.D: Es "Gracias", no "Grasias", con "C".
  6. function warpInit() local players = table.map(getElementsByType('player'), function(p) return { name = getPlayerName(p):gsub("#%x%x%x%x%x%x","") } end) table.sort(players, function(a, b) return a.name < b.name end) bindGridListToTable(wndWarp, 'playerlist', players, true) local gui = getControl(wndWarp, 'search') removeEventHandler ( "onClientGUIChanged", gui, findPlayer, false ) addEventHandler ( "onClientGUIChanged", gui, findPlayer, false ) end function findPlayer () local text = guiGetText ( source ) if (text == "") then local players = table.map(getElementsByType('player'), function(p) return { name = getPlayerName(p):gsub("#%x%x%x%x%x%x","") } end) table.sort(players, function(a, b) return a.name < b.name end) bindGridListToTable(wndWarp, 'playerlist', players, true) return end local matches = {} for index, playeritem in ipairs (getElementsByType("player")) do if ( string.find ( string.upper ( getPlayerName ( playeritem ):gsub("#%x%x%x%x%x%x","") ), string.upper ( text ), 1, true ) ) then table.insert(matches, playeritem) end end local players = table.map(matches, function(p) return { name = getPlayerName(p):gsub("#%x%x%x%x%x%x","") } end) table.sort(players, function(a, b) return a.name < b.name end) bindGridListToTable(wndWarp, 'playerlist', players, true) end
  7. I don't understand what do you mean, this script will search for part of names, you can remove HEX codes from the player name just before add to gridlist.
  8. Castillo

    Socoro

    addCommandHandler('redo', function( player, command, value ) if isPlayerInACLGroup(player, g_GameOptions.admingroup) then local currentMap = exports.mapmanager:getRunningGamemodeMap() if currentMap then local r, g, b = getPlayerNametagColor(player) local hex = RGBToHex(r, g, b) outputChatBox('Map restarted by'.. hex ..' ' .. _getPlayerName(player), root, 255, 50, 0, true) if not exports.mapmanager:changeGamemodeMap (currentMap, nil, true) then problemChangingMap() end else outputRace("You can't restart the map because no map is running", player) end else outputRace("You are not an Admin", player) end end ) function RGBToHex(red, green, blue, alpha) if((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alpha and (alpha < 0 or alpha > 255))) then return nil end if(alpha) then return string.format("#%.2X%.2X%.2X%.2X", red,green,blue,alpha) else return string.format("#%.2X%.2X%.2X", red,green,blue) end end
  9. It returns a relative values, but you need absolute values for dxDrawImage. addEventHandler( "onClientRender", getRootElement(), function() if ( isCursorShowing() == true ) then local sx, sy, wx, wy, wz = getCursorPosition() local sx, sy = relativeToAbsolute(sx, sy) dxDrawImage( sx, sy, 55, 75, "mainFiles/elementCursor.png" ) end end ) function relativeToAbsolute( X, Y ) local rX, rY = guiGetScreenSize() local x = X*rX local y = Y*rY return x, y end
  10. If you mean remove them, then go to "race/race_server.lua" and search for "scoreboard", remove the lines which should say something like: "addScoreboardColumn".
  11. Te di las funciones, ahora debes leer los ejemplos y editarlos para que remplazen skins.
  12. Ok, this should work: --------------------------- -- Warp to player window --------------------------- function warpInit() local players = table.map(getElementsByType('player'), function(p) return { name = getPlayerName(p) } end) table.sort(players, function(a, b) return a.name < b.name end) bindGridListToTable(wndWarp, 'playerlist', players, true) local gui = getControl(wndWarp, 'search') addEventHandler ( "onClientGUIChanged", gui, findPlayer, false ) end function findPlayer () local text = guiGetText ( source ) if (text == "") then local players = table.map(getElementsByType('player'), function(p) return { name = getPlayerName(p) } end) table.sort(players, function(a, b) return a.name < b.name end) bindGridListToTable(wndWarp, 'playerlist', players, true) return end local matches = {} for index, playeritem in ipairs (getElementsByType("player")) do if ( string.find ( string.upper ( getPlayerName ( playeritem ) ), string.upper ( text ), 1, true ) ) then table.insert(matches, playeritem) end end local players = table.map(matches, function(p) return { name = getPlayerName(p) } end) table.sort(players, function(a, b) return a.name < b.name end) bindGridListToTable(wndWarp, 'playerlist', players, true) end function warpTo(leaf) if not leaf then leaf = getSelectedGridListLeaf(wndWarp, 'playerlist') if not leaf then return end end local player = getPlayerFromNick(leaf.name) if player then server.warpMe(player) end closeWindow(wndWarp) end wndWarp = { 'wnd', text = 'Warp to player', width = 300, controls = { {'txt', id='search', text='', width=280}, { 'lst', id='playerlist', width=280, height=300, columns={ {text='Player', attr='name'} }, onitemdoubleclick=warpTo }, {'btn', id='warp', onclick=warpTo}, {'btn', id='cancel', closeswindow=true} }, oncreate = warpInit } I only tested it with myself, so I'm not sure if it completely works.
  13. You forgot about the link to the resource . Good work btw.
  14. You can edit the scoreboard resource and add colored texts (HEX colors) or just remove the HEX colors from the nickname. This resource: https://community.multitheftauto.com/index.php?p= ... ls&id=3421 Is a function to draw a text with HEX colors enabled.
  15. I could so some scripts for money, but not the whole server as I'm already on a RPG and I have not much time.
  16. Vehicle mod: https://community.multitheftauto.com/index.php?p= ... ls&id=3576
  17. Usa las funciones de Engine: https://wiki.multitheftauto.com/wiki/Cli ... _functions Tienen ejemplos de como remplazar autos, deberian ayudarte.
  18. Lo que quieres es editar el recurso para que algunos teams esten restringidos? si es asi, entonces tendras que aprender lo basico y luego ir avanzando.
  19. https://nightly.multitheftauto.com/
  20. Yours is messed up, no offense.
  21. Si hablas de un grupo de ACL, entonces debes usar esta funcion: isObjectInACLGroup
  22. Yo diria que una faccion es un grupo, si.
  23. Vehicle mod: https://community.multitheftauto.com/index.php?p= ... ls&id=3575
  24. No, you must be in a vehicle and write /grav.
×
×
  • Create New...