-
Posts
13 -
Joined
-
Last visited
Recent Profile Visitors
630 profile views
FabianRs's Achievements
Square (6/54)
2
Reputation
-
FabianRs started following Dutchman101
-
unfortunately, yes. However you can download this and install it in your singleplayer (also affects mta)
-
yep but it's in spanish https://community.multitheftauto.com/index.php?p=resources&s=details&id=15520
-
Nope, it's a singleplayer mod
-
No leaves mod This mod removes the leaves textures.
-
Hmmm ok tienes razón, es más fácil y el código más corto ?
-
Creo que así es más fácil y más "económico" que andar tomando a todos los jugadores del sv cada vez que alguien habla por el chat customizado.
-
[HELP] How to set the dx text anchor to center ?
FabianRs replied to Gabriel1375's topic in Scripting
try this local x, y = guiGetScreenSize() local font = dxCreateFont('strangerbackinthenight.ttf', 25, false, 'proof') or 'bankgothic' -- fallback to default local textColor = tocolor(255,255,255,255) local outlineColor = tocolor(0,0,0,255) -- custom valores local drawWidth = 0.5 local drawHeight = 0.94 local drawPosX = 9.1 local drawPosY = 367.0 local drawHeightWeapName = 0.91 local drawHeightWatch = 0.1 function hud ( ) clip = getPedAmmoInClip ( getLocalPlayer() ) totalammo = getPedTotalAmmo ( getLocalPlayer() ) weapon = getPedWeapon( getLocalPlayer() ) --auto = getPedWeapon( getLocalPlayer() ) setPlayerHudComponentVisible ("weapon", false ) setPlayerHudComponentVisible ("ammo", false) setPlayerHudComponentVisible ("clock", false) if weapon == 0 or weapon == 46 then return end local arma = getElementData(getLocalPlayer(), "currentweapon_1") local arma2 = getElementData(getLocalPlayer(), "currentweapon_2") local arma3 = getElementData(getLocalPlayer(), "currentweapon_3") if weapon == 25 or weapon == 26 or weapon == 27 or weapon == 30 or weapon == 31 or weapon == 33 or weapon == 34 then dxDrawBorderedText(1, ""..clip.." / "..totalammo, x*drawWidth,y*drawHeight,x*drawPosX,y*drawPosY,textColor,0.8,font,"center","top",false,false,false) dxDrawBorderedText(1, arma, x*drawWidth,y*drawHeightWeapName,x*drawPosX,y*drawPosY,textColor,0.8,font,"center","top") end if weapon == 0 or weapon == 1 or weapon == 2 or weapon == 3 or weapon == 4 or weapon == 5 or weapon == 6 or weapon == 7 or weapon == 8 or weapon == 9 then dxDrawBorderedText(1, arma2, x*drawWidth,y*drawHeightWeapName,x*drawPosX,y*drawPosY,textColor,0.8,font,"center","top") end if weapon == 22 or weapon == 23 or weapon == 24 or weapon == 28 or weapon == 29 or weapon == 43 then dxDrawBorderedText(1, ""..clip.." / "..totalammo, x*drawWidth,y*drawHeight,x*drawPosX,y*drawPosY,textColor,0.8,font,"center","top",false,false,false) dxDrawBorderedText(1, arma2, x*drawWidth,y*drawHeightWeapName,x*drawPosX,y*drawPosY,textColor,0.8,font,"center","top") end if weapon == 16 or weapon == 17 then dxDrawBorderedText(1, ""..clip.." / "..totalammo, x*drawWidth,y*drawHeight,x*drawPosX,y*drawPosY,textColor,0.8,font,"center","top",false,false,false) dxDrawBorderedText(1, arma3, x*drawWidth,y*drawHeightWeapName,x*drawPosX,y*drawPosY,textColor,0.8,font,"center","top") end if not getElementData(getLocalPlayer(), "Watch") then return end if getElementData(getLocalPlayer(),"Watch") >= 1 then local hour, minutes = getTime() dxDrawBorderedText(1, ""..string.format("%02d",hour)..":"..string.format("%02d",minutes), x*0.92,y*drawHeightWatch,x*drawPosX,y*drawPosY,textColor,0.8,font,"left","top",false,false,false) end end addEventHandler("onClientRender",getRootElement(),hud) addEventHandler("onClientPlayerSpawn",getRootElement(),hud) function dxDrawBorderedText (outline, text, left, top, right, bottom, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, colorCoded, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) local outline = (scale or 1) * (1.333333333333334 * (outline or 1)) dxDrawText (text:gsub("#%x%x%x%x%x%x", ""), left - outline, top - outline, right - outline, bottom - outline, tocolor (0, 0, 0, 225), scale, font, alignX, alignY, clip, wordBreak, postGUI, false, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) dxDrawText (text:gsub("#%x%x%x%x%x%x", ""), left + outline, top - outline, right + outline, bottom - outline, tocolor (0, 0, 0, 225), scale, font, alignX, alignY, clip, wordBreak, postGUI, false, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) dxDrawText (text:gsub("#%x%x%x%x%x%x", ""), left - outline, top + outline, right - outline, bottom + outline, tocolor (0, 0, 0, 225), scale, font, alignX, alignY, clip, wordBreak, postGUI, false, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) dxDrawText (text:gsub("#%x%x%x%x%x%x", ""), left + outline, top + outline, right + outline, bottom + outline, tocolor (0, 0, 0, 225), scale, font, alignX, alignY, clip, wordBreak, postGUI, false, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) dxDrawText (text:gsub("#%x%x%x%x%x%x", ""), left - outline, top, right - outline, bottom, tocolor (0, 0, 0, 225), scale, font, alignX, alignY, clip, wordBreak, postGUI, false, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) dxDrawText (text:gsub("#%x%x%x%x%x%x", ""), left + outline, top, right + outline, bottom, tocolor (0, 0, 0, 225), scale, font, alignX, alignY, clip, wordBreak, postGUI, false, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) dxDrawText (text:gsub("#%x%x%x%x%x%x", ""), left, top - outline, right, bottom - outline, tocolor (0, 0, 0, 225), scale, font, alignX, alignY, clip, wordBreak, postGUI, false, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) dxDrawText (text:gsub("#%x%x%x%x%x%x", ""), left, top + outline, right, bottom + outline, tocolor (0, 0, 0, 225), scale, font, alignX, alignY, clip, wordBreak, postGUI, false, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) dxDrawText (text, left, top, right, bottom, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, colorCoded, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) end -
[HELP] How to set the dx text anchor to center ?
FabianRs replied to Gabriel1375's topic in Scripting
local x, y = guiGetScreenSize() local font = dxCreateFont('strangerbackinthenight.ttf', 25, false, 'proof') or 'bankgothic' -- fallback to default local textColor = tocolor(255,255,255,255) local outlineColor = tocolor(0,0,0,255) -- custom valores local drawWidth = 0.5 local drawHeight = 0.94 local drawPosX = 9.1 local drawPosY = 367.0 local drawHeightWeapName = 0.91 local drawHeightWatch = 0.1 function hud ( ) clip = getPedAmmoInClip ( getLocalPlayer() ) totalammo = getPedTotalAmmo ( getLocalPlayer() ) weapon = getPedWeapon( getLocalPlayer() ) --auto = getPedWeapon( getLocalPlayer() ) setPlayerHudComponentVisible ("weapon", false ) setPlayerHudComponentVisible ("ammo", false) setPlayerHudComponentVisible ("clock", false) if weapon == 0 or weapon == 46 then return end local arma = getElementData(getLocalPlayer(), "currentweapon_1") local arma2 = getElementData(getLocalPlayer(), "currentweapon_2") local arma3 = getElementData(getLocalPlayer(), "currentweapon_3") if weapon == 25 or weapon == 26 or weapon == 27 or weapon == 30 or weapon == 31 or weapon == 33 or weapon == 34 then dxDrawBorderedText(1, ""..clip.." / "..totalammo, x*drawWidth,y*drawHeight,x*drawPosX,y*drawPosY,textColor,0.8,font,"center","top",false,false,false) dxDrawBorderedText(1, arma, x*drawWidth,y*drawHeightWeapName,x*drawPosX,y*drawPosY,textColor,0.8,font) end if weapon == 0 or weapon == 1 or weapon == 2 or weapon == 3 or weapon == 4 or weapon == 5 or weapon == 6 or weapon == 7 or weapon == 8 or weapon == 9 then dxDrawBorderedText(1, arma2, x*drawWidth,y*drawHeightWeapName,x*drawPosX,y*drawPosY,textColor,0.8,font) end if weapon == 22 or weapon == 23 or weapon == 24 or weapon == 28 or weapon == 29 or weapon == 43 then dxDrawBorderedText(1, ""..clip.." / "..totalammo, x*drawWidth,y*drawHeight,x*drawPosX,y*drawPosY,textColor,0.8,font,"center","top",false,false,false) dxDrawBorderedText(1, arma2, x*drawWidth,y*drawHeightWeapName,x*drawPosX,y*drawPosY,textColor,0.8,font) end if weapon == 16 or weapon == 17 then dxDrawBorderedText(1, ""..clip.." / "..totalammo, x*drawWidth,y*drawHeight,x*drawPosX,y*drawPosY,textColor,0.8,font,"center","top",false,false,false) dxDrawBorderedText(1, arma3, x*drawWidth,y*drawHeightWeapName,x*drawPosX,y*drawPosY,textColor,0.8,font) end if not getElementData(getLocalPlayer(), "Watch") then return end if getElementData(getLocalPlayer(),"Watch") >= 1 then local hour, minutes = getTime() dxDrawBorderedText(1, ""..string.format("%02d",hour)..":"..string.format("%02d",minutes), x*0.92,y*drawHeightWatch,x*drawPosX,y*drawPosY,textColor,0.8,font,"left","top",false,false,false) end end addEventHandler("onClientRender",getRootElement(),hud) addEventHandler("onClientPlayerSpawn",getRootElement(),hud) function dxDrawBorderedText (outline, text, left, top, right, bottom, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, colorCoded, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) local outline = (scale or 1) * (1.333333333333334 * (outline or 1)) dxDrawText (text:gsub("#%x%x%x%x%x%x", ""), left - outline, top - outline, right - outline, bottom - outline, tocolor (0, 0, 0, 225), scale, font, alignX, alignY, clip, wordBreak, postGUI, false, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) dxDrawText (text:gsub("#%x%x%x%x%x%x", ""), left + outline, top - outline, right + outline, bottom - outline, tocolor (0, 0, 0, 225), scale, font, alignX, alignY, clip, wordBreak, postGUI, false, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) dxDrawText (text:gsub("#%x%x%x%x%x%x", ""), left - outline, top + outline, right - outline, bottom + outline, tocolor (0, 0, 0, 225), scale, font, alignX, alignY, clip, wordBreak, postGUI, false, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) dxDrawText (text:gsub("#%x%x%x%x%x%x", ""), left + outline, top + outline, right + outline, bottom + outline, tocolor (0, 0, 0, 225), scale, font, alignX, alignY, clip, wordBreak, postGUI, false, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) dxDrawText (text:gsub("#%x%x%x%x%x%x", ""), left - outline, top, right - outline, bottom, tocolor (0, 0, 0, 225), scale, font, alignX, alignY, clip, wordBreak, postGUI, false, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) dxDrawText (text:gsub("#%x%x%x%x%x%x", ""), left + outline, top, right + outline, bottom, tocolor (0, 0, 0, 225), scale, font, alignX, alignY, clip, wordBreak, postGUI, false, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) dxDrawText (text:gsub("#%x%x%x%x%x%x", ""), left, top - outline, right, bottom - outline, tocolor (0, 0, 0, 225), scale, font, alignX, alignY, clip, wordBreak, postGUI, false, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) dxDrawText (text:gsub("#%x%x%x%x%x%x", ""), left, top + outline, right, bottom + outline, tocolor (0, 0, 0, 225), scale, font, alignX, alignY, clip, wordBreak, postGUI, false, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) dxDrawText (text, left, top, right, bottom, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, colorCoded, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) end Test it -
[HELP] How to set the dx text anchor to center ?
FabianRs replied to Gabriel1375's topic in Scripting
Show your code -
Si, estas en la sección equivocada, pero no te preocupes. Pronto algún staff te la va a cambiar. Con respecto a tu pregunta, tienes que ir al panel admin ( P ) -> Resources -> Seleccionar el resource freeroam -> Settings -> Cambias la cantidad de vehículos por jugador ( no recuerdo cual era, pero si sabes un poco de inglés la identificaras facilmente ?
-
Puedes empezar asi... --SERVER SIDE addCommandHandler("lchat", function(player,cmd,...) local msg = table.concat( {...}, " " ) if msg then local x,y,z = getElementPosition(player) local sp = createColSphere( x, y, z, 20 ) setTimer( destroyElement, 100, 1, sp ) local name = getPlayerName(player) for k,v in ipairs(getElementsWithinColShape(sp,"player")) do outputChatBox( "* "..name..": "..msg, v, 200, 250, 200, true ) end end end ) addEventHandler("onPlayerJoin", root, function() bindKey(source, "U", "down", "chatbox", "lchat") end )
-
addEventHandler('onClientGUIClick',root, function() if source == contrar then local row = guiGridListGetSelectedItem(jugador) local text = guiGridListGetItemText(jugador,row,1) if ( row > -1 ) then triggerServerEvent('setEmpresa',getPlayerFromName(text)) guiSetVisible(contrataciones,false) showCursor(false) end end end) No lo probe, pero creeria que anda.
-
triggerServerEvent('setEmpresa',localPlayer) Ese es tu error, debes cambiar el localPlayer por el jugador al que deseas contratar
-
FabianRs changed their profile photo