-
Posts
1,673 -
Joined
-
Last visited
-
Days Won
6
Everything posted by 0xCiBeR
-
Ok 2 cosas mas.. El problema ahora es que la imagen es grande (quiero que sea asi) pero la linea del nombre no se ajusta al tamaño de la imagen..No se si me explico..Ocea que la imagen queda bien pero, no se ajusta el espacio de acuerdo al nombre..
-
Bien, y como hago para que el scoreboard lea ese elementData? que le agrego ami linea? Y otra cosita..Me indicas si puse en el lugar indicado lo de dibujar imagenes en el scoreboard? Gracias -- THESE CAN BE CHANGED triggerKey = "tab" -- default button to open/close scoreboard settingsKey = "F7" -- default button to open the settings window drawOverGUI = true -- draw scoreboard over gui? seperationSpace = 80 -- the space between top/bottom screen and scoreboard top/bottom in pixels -- BUT DON'T TOUCH THESE scoreboardToggled = false scoreboardForced = false scoreboardDrawn = false forceScoreboardUpdate = true useAnimation = true scoreboardIsToggleable = true showServerInfo = true showGamemodeInfo = false showTeams = true useColors = true drawSpeed = 1 scoreboardScale = 1 teamHeaderFont = "clear" contentFont = "default-bold" columnFont = "default-bold" serverInfoFont = "sans" rmbFont = "clear" cBlack = tocolor( 0, 0, 0 ) cWhite = tocolor( 255, 255, 255 ) cRed = tocolor( 255, 0, 0 ) cSettingsBox = tocolor( 255, 255, 255, 150 ) MAX_PRIRORITY_SLOT = 500 scoreboardColumns = {} resourceColumns = {} scoreboardDimensions = { ["width"] = 0, ["height"] = 0, ["phase"] = 1, ["lastSeconds"] = 0 } scoreboardTicks = { ["lastUpdate"] = 0, ["updateInterval"] = 500 } scoreboardContent = {} firstVisibleIndex = 1 sortBy = { ["what"] = "__NONE__", ["dir"] = -1 } -- -1 = dec, 1 = asc sbOutOffset, sbInOffset = 1, 1 sbFont = "clear" sbFontScale = 0.68 serverInfo = {} fontScale = { -- To make all fonts be equal in height ["default"] = 1.0, ["default-bold"] = 1.0, ["clear"] = 1.0, ["arial"] = 1.0, ["sans"] = 1.0, ["pricedown"] = 0.5, ["bankgothic"] = 0.5, ["diploma"] = 0.5, ["beckett"] = 0.5 } selectedRows = {} addEvent( "onClientPlayerScoreboardClick" ) addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource() ), function ( resource ) cScoreboardBackground = tocolor( defaultSettings.bg_color.r, defaultSettings.bg_color.g, defaultSettings.bg_color.b, defaultSettings.bg_color.a ) cSelection = tocolor( defaultSettings.selection_color.r, defaultSettings.selection_color.g, defaultSettings.selection_color.b, defaultSettings.selection_color.a ) cHighlight = tocolor( defaultSettings.highlight_color.r, defaultSettings.highlight_color.g, defaultSettings.highlight_color.b, defaultSettings.highlight_color.a ) cHeader = tocolor( defaultSettings.header_color.r, defaultSettings.header_color.g, defaultSettings.header_color.b, defaultSettings.header_color.a ) cTeam = tocolor( defaultSettings.team_color.r, defaultSettings.team_color.g, defaultSettings.team_color.b, defaultSettings.team_color.a ) cBorder = tocolor( defaultSettings.border_color.r, defaultSettings.border_color.g, defaultSettings.border_color.b, defaultSettings.border_color.a ) cServerInfo = tocolor( defaultSettings.serverinfo_color.r, defaultSettings.serverinfo_color.g, defaultSettings.serverinfo_color.b, defaultSettings.serverinfo_color.a ) cContent = tocolor( defaultSettings.content_color.r, defaultSettings.content_color.g, defaultSettings.content_color.b, defaultSettings.content_color.a ) bindKey( triggerKey, "down", "Toggle scoreboard", "1" ) bindKey( triggerKey, "up", "Toggle scoreboard", "0" ) bindKey( settingsKey, "down", "Open scoreboard settings", "1" ) addEventHandler( "onClientRender", getRootElement(), drawScoreboard ) triggerServerEvent( "onClientDXScoreboardResourceStart", getRootElement() ) readScoreboardSettings() triggerServerEvent( "requestServerInfo", getRootElement() ) colorPicker.constructor() end ) addEventHandler( "onClientPlayerQuit", getRootElement(), function() selectedRows[source] = nil end ) function sendServerInfo( output ) serverInfo = output end addEvent( "sendServerInfo", true ) addEventHandler( "sendServerInfo", getResourceRootElement( getThisResource() ), sendServerInfo ) function toggleScoreboard( _, state ) state = iif( state == "1", true, false ) if scoreboardIsToggleable and state then scoreboardToggled = not scoreboardToggled elseif not scoreboardIsToggleable then scoreboardToggled = state end end addCommandHandler( "Toggle scoreboard", toggleScoreboard ) function openSettingsWindow() if scoreboardDrawn then local sX, sY = guiGetScreenSize() if not (windowSettings and isElement( windowSettings ) and guiGetVisible( windowSettings )) then createScoreboardSettingsWindow( sX-323, sY-350 ) showCursor( true ) elseif isElement( windowSettings ) then destroyScoreboardSettingsWindow() end end end addCommandHandler( "Open scoreboard settings", openSettingsWindow ) addCommandHandler( "scoreboard", function () scoreboardToggled = not scoreboardToggled end ) function iif( cond, arg1, arg2 ) if cond then return arg1 end return arg2 end function doDrawScoreboard( rtPass, onlyAnim, sX, sY ) if #scoreboardColumns ~= 0 then -- -- In/out animation -- local currentSeconds = getTickCount() / 1000 local deltaSeconds = currentSeconds - scoreboardDimensions.lastSeconds scoreboardDimensions.lastSeconds = currentSeconds deltaSeconds = math.clamp( 0, deltaSeconds, 1/25 ) if scoreboardToggled or scoreboardForced then local phases = { [1] = { ["width"] = s(10), ["height"] = s(5), ["incToWidth"] = s(10), ["incToHeight"] = s(5), ["decToWidth"] = 0, ["decToHeight"] = 0 }, [2] = { ["width"] = s(40), ["height"] = s(5), ["incToWidth"] = calculateWidth(), ["incToHeight"] = s(5), ["decToWidth"] = s(10), ["decToHeight"] = s(5) }, [3] = { ["width"] = calculateWidth(), ["height"] = s(30), ["incToWidth"] = calculateWidth(), ["incToHeight"] = calculateHeight(), ["decToWidth"] = calculateWidth(), ["decToHeight"] = s(5) } } if not useAnimation then scoreboardDimensions.width = calculateWidth() scoreboardDimensions.height = calculateHeight() scoreboardDimensions.phase = #phases end local maxChange = deltaSeconds * 30*drawSpeed local maxWidthDiff = math.clamp( -maxChange, phases[scoreboardDimensions.phase].incToWidth - scoreboardDimensions.width, maxChange ) local maxHeightDiff = math.clamp( -maxChange, phases[scoreboardDimensions.phase].incToHeight - scoreboardDimensions.height, maxChange ) if scoreboardDimensions.width < phases[scoreboardDimensions.phase].incToWidth then scoreboardDimensions.width = scoreboardDimensions.width + maxWidthDiff * phases[scoreboardDimensions.phase].width if scoreboardDimensions.width > phases[scoreboardDimensions.phase].incToWidth then scoreboardDimensions.width = phases[scoreboardDimensions.phase].incToWidth end elseif scoreboardDimensions.width > phases[scoreboardDimensions.phase].incToWidth and not scoreboardDrawn then scoreboardDimensions.width = scoreboardDimensions.width - maxWidthDiff * phases[scoreboardDimensions.phase].width if scoreboardDimensions.width < phases[scoreboardDimensions.phase].incToWidth then scoreboardDimensions.width = phases[scoreboardDimensions.phase].incToWidth end end if scoreboardDimensions.height < phases[scoreboardDimensions.phase].incToHeight then scoreboardDimensions.height = scoreboardDimensions.height + maxHeightDiff * phases[scoreboardDimensions.phase].height if scoreboardDimensions.height > phases[scoreboardDimensions.phase].incToHeight then scoreboardDimensions.height = phases[scoreboardDimensions.phase].incToHeight end elseif scoreboardDimensions.height > phases[scoreboardDimensions.phase].incToHeight and not scoreboardDrawn then scoreboardDimensions.height = scoreboardDimensions.height - maxHeightDiff * phases[scoreboardDimensions.phase].height if scoreboardDimensions.height < phases[scoreboardDimensions.phase].incToHeight then scoreboardDimensions.height = phases[scoreboardDimensions.phase].incToHeight end end if scoreboardDimensions.width == phases[scoreboardDimensions.phase].incToWidth and scoreboardDimensions.height == phases[scoreboardDimensions.phase].incToHeight then if phases[scoreboardDimensions.phase + 1] then scoreboardDimensions.phase = scoreboardDimensions.phase + 1 else if not scoreboardDrawn then bindKey( "mouse2", "both", showTheCursor ) bindKey( "mouse_wheel_up", "down", scrollScoreboard, -1 ) bindKey( "mouse_wheel_down", "down", scrollScoreboard, 1 ) addEventHandler( "onClientClick", getRootElement(), scoreboardClickHandler ) if not (windowSettings and isElement( windowSettings )) then showCursor( false ) end triggerServerEvent( "requestServerInfo", getRootElement() ) end scoreboardDrawn = true end end elseif scoreboardDimensions.width ~= 0 and scoreboardDimensions.height ~= 0 then local phases = { [1] = { ["width"] = s(10), ["height"] = s(5), ["incToWidth"] = s(10), ["incToHeight"] = s(5), ["decToWidth"] = 0, ["decToHeight"] = 0 }, [2] = { ["width"] = s(40), ["height"] = s(5), ["incToWidth"] = calculateWidth(), ["incToHeight"] = s(5), ["decToWidth"] = s(10), ["decToHeight"] = s(5) }, [3] = { ["width"] = calculateWidth(),
-
La parte del scoreboard? Ok elseif column.name == "RankTest" then dxDrawImage( topX+theX, y-s(0.5), 30, 30, content, 0, 0, 0, cWhite, drawOverGUI )
-
Hola lo que deseo es agregar un sistema de rangos (medallas) en las cual yo pueda darle cierta imagen, ocea medalla a un jugador en particular..Se como hacer para que el scoreboard dibuje las imagenes y ya lo tengo editado..Ahora..Suponiendo que mi columna donde quiero mis medallas se llama "Rank" y mis imagenes son 0.png 01.png 02.png etc..Como hago para indicarle al scoreboard que imagen dibujar? Gracias!
-
Hola estoy haciendo un script para compra de autos In Game.. Bueno el problema es que debo agregar un timer o algo para que cuando un jugador entre a un auto disponible para la compra no le de el botton a cerrar en vez de comprar y se lleve el auto..Ocea que no permita que se clickee el boton de la gui hasta que pase cierto cantidad de tiempo? como se haria? gracias..
-
Agregar Manualmente los Factions/Tiendas/Interiors/Etc en RP
0xCiBeR replied to TigreBlanco's topic in Scripting
lol la verdad sigo sin entender... a donde quieres agregar un .map manualmente...Version scripting? No entiendo... -
No, por favor :3 ..Avisanos si te sirvio @Jesus
-
Como dice Alex debes hacer el client side con lo que es GUI, y luego triggear cada boton serverside..
-
te corrigo Sasuke: Pequeñisimo error: local hillArea = createColCuboid ( 1187.7066650391, -1409.201171875, 12.010873603821, 150, 122, 35 ) local hillRadar = createRadarArea ( 1187.7066650391, -1409.201171875, 150, 122, 117, 233, 229, 220 ) function hill_Enter ( thePlayer ) if getElementType ( thePlayer ) == "player" then outputChatBox( getPlayerName(thePlayer) .. " Entro a zona de ganar Dinero!", getRootElement(), 255, 255, 109 ) setRadarAreaFlashing ( hillRadar, true ) local ganar = setTimer(givePlayerMoney, 1000, 0, thePlayer, 1000) end end addEventHandler ( "onColShapeHit", hillArea, hill_Enter ) function hill_Leave ( thePlayer ) if isTimer(ganar) then killTimer(ganar) end end addEventHandler ( "onColShapeLeave", hillArea, hill_Leave )
-
No, me anda como dije yo, no intente el tuyo
-
Igual lo de alvarez seria: outputChatBox( .. (getPlayerName(thePlayer)) .. " Entro a zona de ganar Dinero!", getRootElement(), 255, 255, 109 )
-
Lool men no se...Seguro que has copiado todo bien? Xq lo he probado y anda
-
Para el segundo error cambia a esto: if (getElementType(thePlayer) == "player") then Por Esto: if getElementType ( thePlayer ) == "player" then
-
OFFtopic: El mio esta mas ordenado :3 *-*
-
Se no me anda el Quote estoy con el Opera..
-
Lool me equivoque denuevo.. seria asi: local hillArea = createColCuboid ( 1187.7066650391, -1409.201171875, 12.010873603821, 150, 122, 35 ) local hillRadar = createRadarArea ( 1187.7066650391, -1409.201171875, 150, 122, 117, 233, 229, 220 ) function hill_Enter ( thePlayer, matchingDimension ) givePlayerMoney ( thePlayer, 1000 ) if (getElementType(thePlayer) == "player") then outputChatBox( getPlayerName(thePlayer) .. " Entro a zona de ganar Dinero!", getRootElement(), 255, 255, 109 ) setRadarAreaFlashing ( hillRadar, true ) end end function hill_Leave ( thePlayer, matchingDimention ) givePlayerMoney ( thePlayer, 0 ) end addEventHandler ( "onColShapeHit", hillArea, hill_Enter ) addEventHandler ( "onColShapeLeave", hillArea, hill_Leave ) setTimer ( hill_Enter, 1000, 1 )
-
Seria algo como dice AlvareZ_ pero realmente te recomiendo si no sabes mucho de lua lo hagas por gui la ventana y eso..hacelo y pega el codigo final aca..Y te ayudamos a armarlo
-
Eso no sirve de nada..Hace una cosa..Crea una gui que te guste por guieditor, sube el codigo aca y te ayudamos..Vale?!
-
Estas mezlcando conceptos-- O haces lo que queres por gui o por dxDrawTex.. Si es por gui, crea todo por el guieditor ya q te sera mas facil si no sabes mucho de gui. Luego agregale triggers y las funciones
-
Para que un timer? Te conviene igual Hacer un Gui, y si quieres que le salga a todos los jugadores del server usa "getElementsByType ( "player" )
-
Probas asi, me comi una Coma local hillArea = createColCuboid ( 1187.7066650391, -1409.201171875, 12.010873603821, 150, 122, 35 ) local hillRadar = createRadarArea ( 1187.7066650391, -1409.201171875, 150, 122, 117, 233, 229, 220 ) function hill_Enter ( thePlayer, matchingDimension ) givePlayerMoney ( thePlayer, 1000 ) if (getElementType(thePlayer) == "player") then outputChatBox( getPlayerName(thePlayer) .. " Entro a zona de ganar Dinero!", getRootElement(), 255, 255, 109 ) setRadarAreaFlashing ( hillRadar, true ) end end function hill_Leave ( thePlayer, matchingDimention ) givePlayerMoney ( thePlayer, 0 ) end addEventHandler ( "onColShapeHit", hillArea, hill_Enter ) addEventHandler ( "onColShapeHit", hillArea, hill_Leave ) setTimer ( hill_Enter, 1000, 1 )
-
Lo pues asi tienes tu meta? Ya esta server-Side
-
Y si no quieres que te de dinero cuando sales usas "onColShapeLeave" Asi seria: local hillArea = createColCuboid ( 1187.7066650391, -1409.201171875, 12.010873603821, 150, 122, 35 ) local hillRadar = createRadarArea ( 1187.7066650391, -1409.201171875, 150, 122, 117, 233, 229, 220 ) function hill_Enter ( thePlayer, matchingDimension ) givePlayerMoney ( thePlayer, 1000 ) if (getElementType(thePlayer) == "player") then outputChatBox( getPlayerName(thePlayer) .. " Entro a zona de ganar Dinero!", getRootElement(), 255, 255, 109 ) setRadarAreaFlashing ( hillRadar, true ) end end function hill_Leave ( thePlayer, matchingDimention ) givePlayerMoney ( thePlayer, 0 ) end addEventHandler ( "onColShapeHit", hillArea, hill_Enter ) addEventHandler ( "onColShapeHit", hillArea, hill_Leave ) setTimer ( hill_Enter 1000, 1 )