Jump to content

iSmokee

Members
  • Posts

    175
  • Joined

  • Last visited

Everything posted by iSmokee

  1. Gracias iLunux y a todos
  2. no quiero crear un boton -.- el boton ya esta creado lo que quiero que cuando el mouse pase x ese boton se cree un elemento como por ejemplo una m4
  3. Tengo este codigo que es un dxButton que lo dieron aqui en el forum lo que necesito es que me ayuden para que cuando pase el mouse por el boton me cree un objeto y si sale del boton que se borre si alguien sabe como podria hacer eso se lo agradeceria muchisimo. local xxx, yyy, www, hhh = 0.037, 0.33, 0.220, 0.03 function equipamiento() dxDrawRectangle(xxx*sW, yyy*sH, www*sW, hhh*sH, color3, false) dxDrawText ( 'Equipamientos', (60/mi_x)*user_x, (255/mi_y)*user_y, (0/mi_x)*user_x, (30/mi_y)*user_y, tocolor ( 255, 255, 255, 255 ), 1, "default-bold" ) showCursor(true) if isCursorShowing() then sX, sY, _, _, _ = getCursorPosition() if sX >= xxx and sX <= xxx+www and sY >= yyy and sY <= yyy+hhh then color3 = tocolor(255, 255, 255, 150) else color3 = tocolor(0, 0, 0, 210) end end end addEventHandler("onClientClick", getRootElement(), function(button, state, px, py) if (button == "left" and state == "down") then if (px > xxx*sW and px < (xxx+www)*sW and py > yyy*sH and py < (yyy+hhh)*sH) then if(isEventHandlerAdded("onClientRender", getRootElement(getThisResource()), equipamiento)) then end end end end)
  4. hasta ahora no estoy utilizando ningún método yo quiero saber uno.
  5. Hola estoy creando mi propio login para mi servidor y lo que quisiera saver es que podria usar para guardar datos como usuarios y esas cosas por si mi servidor se cae para no perder todas las cosas ya me a pasado en otros servidores mios :v Gracias espero una respuesta.
  6. Hola vengo a pedir una pequeña ayuda!! Lo que quiero es que cuando el cursor pase por encima de un dxDrawText Cambie de color y cuando saque el mouse de ese texto aparesca el default y tambien q al hacer click te ejecute una function se que es con onClientClick.
  7. local name = getPlayerName(source) outputChatBox ( "Has comprado una Minigun.", localPlayer, 0, 255, 0, true ) else outputChatBox ( "No tienes dinero para comprar una Minigun.", localPlayer, 255, 0, 0, true ) end end)
  8. how I can create a command like that. instance: /give [weaponIDorName] [player] [ammo].
  9. mmmm @Tomas se que ni me registras pero que es un loop ?
  10. me pueden ayudar yo lo saque de la wiki y fui a donde dice que seria en el centro del mundo del gta sa y no hay ningun dxDrawRectangle3D
  11. @Bc# ¿me puedes ayudar? :c por favor
  12. si puse la posicion del mapa del gta pero no me aparece local dot = dxCreateTexture(1,1) local white = tocolor(255,255,255,255) function dxDrawRectangle3D(x,y,z,w,h,c,r,...) local lx, ly, lz = x+w, y+h, (z+tonumber(r or 0)) or z return dxDrawMaterialLine3D(x,y,z, lx, ly, lz, dot, h, c or white, ...) end addEventHandler("onClientRender", root, function() dxDrawRectangle3D(-720.701171875, 971.2275390625, 12.148136138916, 20, 20, tocolor(255,255,255,255)) end )
  13. Hola agarre este código de la wiki de mta y puse eso para probar haber si aparecía y no aparece alguien me podría explicar como lo podria lograr aca les dejo el codigo es de la wiki si alguien lo quiere se los dejo aca DxDrawRectangle3D local dot = dxCreateTexture(1,1) local white = tocolor(255,255,255,255) function dxDrawRectangle3D(x,y,z,w,h,c,r,...) local lx, ly, lz = x+w, y+h, (z+tonumber(r or 0)) or z return dxDrawMaterialLine3D(x,y,z, lx, ly, lz, dot, h, c or white, ...) end addEventHandler("onClientRender", root, function() dxDrawRectangle3D(0,0, 20, 20, 20, tocolor(255,255,255,255)) end )
  14. iSmokee

    MySQL

    Hola cree mi login para mi clan ya lo tengo terminado lo que quiero saber es como hago para que se logeen atravez del foro del clan alguien me puede ayudar y si me da un ejemplo mejor
  15. Client: -- Copyright (c) 2008, Alberto Alonso -- -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without modification, -- are permitted provided that the following conditions are met: -- -- * Redistributions of source code must retain the above copyright notice, this -- list of conditions and the following disclaimer. -- * Redistributions in binary form must reproduce the above copyright notice, this -- list of conditions and the following disclaimer in the documentation and/or other -- materials provided with the distribution. -- * Neither the name of the superman script nor the names of its contributors may be used -- to endorse or promote products derived from this software without specific prior -- written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. local Superman = {} -- Settings local ZERO_TOLERANCE = 0.00001 local MAX_ANGLE_SPEED = 6 -- In degrees per frame local MAX_SPEED = 1.0 local EXTRA_SPEED_FACTOR = 1.85 local LOW_SPEED_FACTOR = 0.40 local ACCELERATION = 0.025 local EXTRA_ACCELERATION_FACTOR = 1.8 local LOW_ACCELERATION_FACTOR = 0.85 local TAKEOFF_VELOCITY = 1.75 local TAKEOFF_FLIGHT_DELAY = 750 local SMOKING_SPEED = 1.25 local GROUND_ZERO_TOLERANCE = 0.18 local LANDING_DISTANCE = 3.2 local FLIGHT_ANIMLIB = "swim" local FLIGHT_ANIMATION = "Swim_Dive_Under" local FLIGHT_ANIM_LOOP = false local IDLE_ANIMLIB = "cop_ambient" local IDLE_ANIMATION = "Coplook_loop" local IDLE_ANIM_LOOP = true local MAX_Y_ROTATION = 55 local ROTATION_Y_SPEED = 3.8 -- Static global variables local thisResource = getThisResource() local rootElement = getRootElement() local localPlayer = getLocalPlayer() local serverGravity = getGravity() -- -- Utility functions -- local function isPlayerFlying(player) local data = getElementData(player, "superman:flying") if not data or data == false then return false else return true end end local function setPlayerFlying(player, state) if state == true then state = true else state = false end setElementData(player, "superman:flying", state) end local function iterateFlyingPlayers() local current = 1 local allPlayers = getElementsByType("player") return function() local player repeat player = allPlayers[current] current = current + 1 until not player or (isPlayerFlying(player) and isElementStreamedIn(player)) return player end end function Superman:restorePlayer(player) setPlayerFlying(player, false) setPedAnimation(player, false) setElementVelocity(player, 0, 0, 0) setElementRotation(player, 0, 0, 0) --setPedRotation(player, getPedRotation(player)) setElementCollisionsEnabled(player, true) self:destroySmokeGenerators(player) self.rotations[player] = nil self.previousVelocity[player] = nil end function Superman:createSmokeGenerator(player) local generator = createObject(2780, getElementPosition(player)) setElementCollisionsEnabled(generator, false) setObjectScale(generator, 0) return generator end function Superman:createSmokeGenerators(player) if not self.smokeGenerators[player] then local smokeGenerators = {} smokeGenerators[1] = self:createSmokeGenerator(player) attachElementToElement(smokeGenerators[1], player, 0.75, -0.2, -0.4, -40, 0, 60) smokeGenerators[2] = self:createSmokeGenerator(player) attachElementToElement(smokeGenerators[2], player, -0.75, -0.2, -0.4, -40, 0, -60) self.smokeGenerators[player] = smokeGenerators end end function Superman:destroySmokeGenerators(player) if self.smokeGenerators[player] then for k, v in ipairs(self.smokeGenerators[player]) do destroyElement(v) end self.smokeGenerators[player] = nil end end function angleDiff(angle1, angle2) angle1, angle2 = angle1 % 360, angle2 % 360 local diff = (angle1 - angle2) % 360 if diff <= 180 then return diff else return -(360 - diff) end end local function isPedInWater(ped) local pedPosition = Vector3D:new(getElementPosition(ped)) if pedPosition.z <= 0 then return true end local waterLevel = getWaterLevel(pedPosition.x, pedPosition.y, pedPosition.z) if not isElementStreamedIn(ped) or not waterLevel or waterLevel < pedPosition.z then return false else return true end end local function isnan(x) math.inf = 1/0 if x == math.inf or x == -math.inf or x ~= x then return true end return false end local function getVector2DAngle(vec) if vec.x == 0 and vec.y == 0 then return 0 end local angle = math.deg(math.atan(vec.x / vec.y)) + 90 if vec.y < 0 then angle = angle + 180 end return angle end -- -- Initialization and shutdown functions -- function Superman.Start() local self = Superman -- Register events addEventHandler("onClientResourceStop", getResourceRootElement(thisResource), Superman.Stop, false) addEventHandler("onPlayerJoin", rootElement, Superman.onJoin) addEventHandler("onPlayerQuit", rootElement, Superman.onQuit) addEventHandler("onClientRender", rootElement, Superman.processControls) addEventHandler("onClientRender", rootElement, Superman.processFlight) addEventHandler("onClientPlayerDamage", localPlayer, Superman.onDamage, false) addEventHandler("onClientElementDataChange", rootElement, Superman.onDataChange) addEventHandler("onClientElementStreamIn", rootElement, Superman.onStreamIn) addEventHandler("onClientElementStreamOut", rootElement, Superman.onStreamOut) -- Bind keys -- Register commands -- addCommandHandler("mansuper", Superman.cmdSuperman) -- Initializate attributes self.smokeGenerators = {} self.rotations = {} self.previousVelocity = {} end addEventHandler("onClientResourceStart", getResourceRootElement(thisResource), Superman.Start, false) function Superman.Stop() local self = Superman setGravity(serverGravity) -- Restore all players animations, collisions, etc for player in iterateFlyingPlayers() do self:restorePlayer(player) end end -- -- Join/Quit -- function Superman.onJoin(player) local self = Superman local player = player or source setPlayerFlying(player, false) end function Superman.onQuit(reason, player) local self = Superman local player = player or source if isPlayerFlying(player) then self:restorePlayer(player) end end -- -- onDamage: superman is invulnerable -- function Superman.onDamage() local self = Superman if isPlayerFlying(localPlayer) then cancelEvent() end end -- -- onStreamIn: Reset rotation attribute for player -- function Superman.onStreamIn()
  16. iSmokee

    dxGridLsit

    es una gridlist....
  17. iSmokee

    dxGridLsit

    @CiBer yo no quiero crear un gui quiero crear una dxGridList yo quiero lograr algo haci mira
  18. iSmokee

    dxGridLsit

    Alguien me podria dar una GridList o ayudarme a crear una ?
  19. iSmokee

    Una Pregunta

    Censurado 19/10/2014 17:40 By .:CiBeR:.
  20. iSmokee

    Una Pregunta

    Censurado 19/10/2014 17:40 By .:CiBeR:.
  21. iSmokee

    Una Pregunta

    Censurado 19/10/2014 17:40 By .:CiBeR:.
  22. iSmokee

    Una Pregunta

    Hola encontré esto en la parte de scripting en ingles bueno esto es lo que buscaba mi pregunta es como puedo crear mas dxDrawRectangle y moverlos abajo del otro igual con el dxDrawText estuve mas de 3 horas probando cosas y nunca me los movia si alguien me puede ayudar se lo agradecería mucho bueno Gracias local step = 0.05 local x,y = guiGetScreenSize() local sx,sy = 200,40 local px,py = x/2-sx/2,y local progress = 0 function renderWindow() progress = progress + step if progress > 1 then progress = 1 end py = interpolateBetween(y,0,0,y/2-sy/2,0,0,progress,"InOutQuad") dxDrawRectangle(px*0,py,sx,sy,tocolor(0,0,0,170)) dxDrawText("Stats",px*0,py,sx,sy,tocolor(255,255,255,255), 2, "default-bold", "left", "top", false, false, false, false, false) end addEventHandler("onClientRender",getRootElement(),renderWindow)
×
×
  • Create New...