Jump to content

xRGamingx

Members
  • Posts

    191
  • Joined

  • Last visited

Everything posted by xRGamingx

  1. Hello friends, I need a little help How can I make this height meter appear only for the jetpack ? Sorry for my bad English function height() local Vehicle = getPedOccupiedVehicle(getLocalPlayer()) if Vehicle then local Type = getVehicleType(Vehicle) if Type == "Plane" then dxDrawRectangle(40, 498, 20, 163, tocolor(0 , 0 , 0 , 100), false) local x,y,z = getElementPosition (getLocalPlayer()) local height = math.floor((z*001)) if height < 161 then dxDrawRectangle(30, 659-height, 45, 2, tocolor(255 , 255 , 255 , 115), false) elseif height < 322 then dxDrawRectangle(30, 820-height, 45, 2, tocolor(255 , 255 , 255 , 115), false) elseif height < 483 then dxDrawRectangle(30, 981-height, 45, 2, tocolor(255 , 255 , 255 , 115), false) elseif height < 644 then dxDrawRectangle(30, 1142-height, 45, 2, tocolor(255 , 255 , 255 , 115), false) elseif height < 803 then dxDrawRectangle(30, 1303-height, 45, 2, tocolor(255 , 255 , 255 , 115), false) elseif height < 962 then dxDrawRectangle(30, 1464-height, 45, 2, tocolor(255 , 255 , 255 , 115), false) end end end end addEventHandler ( "onClientRender", getRootElement(), height ) --doesPedHaveJetPack
  2. ---example¿? function jobL() for k, v in ipairs(getElementsByType("marker")) do local info = getElementData(v, "infojob") if info then local x, y, z = getElementPosition(localPlayer) local mx, my, mz = getElementPosition(v) local a, b = 50, 30 local cx, cy, cz = getCameraMatrix() if getDistanceBetweenPoints3D(x, y, z, mx, my, mz + 0.5) < 65 and isLineOfSightClear(cx, cy, cz, mx, my, mz + 0.5, true, true, false) then local sx, sy = getScreenFromWorldPosition(mx, my, mz + 0.5) if sx and sy then sx, sy = sx - a, sy - b dxDrawText(info, (sx - 30)-1, sy-1, sx-1, sy-1, tocolor(r, g, b, alpha), 0.6, "bankgothic") dxDrawText(info, (sx - 30)+1, sy-1, sx+1, sy-1, tocolor(r, g, b, alpha), 0.6, "bankgothic") dxDrawText(info, (sx - 30)-1, sy+1, sx-1, sy+1, tocolor(r, g, b, alpha), 0.6, "bankgothic") dxDrawText(info, (sx - 30)+1, sy+1, sx+1, sy+1, tocolor(r, g, b, alpha), 0.6, "bankgothic") dxDrawText(info, sx - 30, sy, sx, sy, tocolor(243, 0, 0, alpha), 0.6, "bankgothic") end end end end end addEventHandler("onClientRender", root, jobL) ?? look broth
  3. How to fade this text while I'm moving away from it? ? function jobL() for k, v in ipairs(getElementsByType("marker")) do local info = getElementData(v, "infojob") if info then local x, y, z = getElementPosition(localPlayer) local mx, my, mz = getElementPosition(v) local a, b = 50, 30 local cx, cy, cz = getCameraMatrix() if getDistanceBetweenPoints3D(x, y, z, mx, my, mz + 0.5) < 65 and isLineOfSightClear(cx, cy, cz, mx, my, mz + 0.5, true, true, false) then local sx, sy = getScreenFromWorldPosition(mx, my, mz + 0.5) if sx and sy then sx, sy = sx - a, sy - b dxDrawText(info, (sx - 30)-1, sy-1, sx-1, sy-1, tocolor(0, 0, 0, 255), 0.6, "bankgothic") dxDrawText(info, (sx - 30)+1, sy-1, sx+1, sy-1, tocolor(0, 0, 0, 255), 0.6, "bankgothic") dxDrawText(info, (sx - 30)-1, sy+1, sx-1, sy+1, tocolor(0, 0, 0, 255), 0.6, "bankgothic") dxDrawText(info, (sx - 30)+1, sy+1, sx+1, sy+1, tocolor(0, 0, 0, 255), 0.6, "bankgothic") dxDrawText(info, sx - 30, sy, sx, sy, tocolor(243, 0, 0, 255), 0.6, "bankgothic") end end end end end addEventHandler("onClientRender", root, jobL)
  4. local screenW, screenH = guiGetScreenSize() addEventHandler("onClientRender", root, function() dxDrawRectangle(screenW * 0.3280, screenH * 0.4609, 469, 45, tocolor(0, 0, 0, 169), false) dxDrawLine(screenW * 0.3280, screenH * 0.4609, (screenW * 0.3280) + 469, ( screenH * 0.4609) + 0, tocolor(0, 0, 0, 254), 2, false) dxDrawLine(screenW * 0.3280, screenH * 0.5195, (screenW * 0.3280) + 469, ( screenH * 0.5195) + 0, tocolor(0, 0, 0, 254), 2, false) dxDrawLine(screenW * 0.6713, screenH * 0.4609, (screenW * 0.6713) + 0, ( screenH * 0.4609) + 45, tocolor(0, 0, 0, 254), 2, false) dxDrawLine((screenW * 0.3272) + 1, screenH * 0.4609, screenW * 0.3272, ( screenH * 0.4609) + 44, tocolor(0, 0, 0, 254), 2, false) dxDrawRectangle(screenW * 0.3280, screenH * 0.4609, 469, 45, tocolor(12, 251, 1, 254), false) ----dxDrawLoading - Green bar dxDrawText("Hacking the safe", 541 - 1, 370 - 1, 917 - 1, 399 - 1, tocolor(0, 0, 0, 255), 0.60, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("Hacking the safe", 541 + 1, 370 - 1, 917 + 1, 399 - 1, tocolor(0, 0, 0, 255), 0.60, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("Hacking the safe", 541 - 1, 370 + 1, 917 - 1, 399 + 1, tocolor(0, 0, 0, 255), 0.60, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("Hacking the safe", 541 + 1, 370 + 1, 917 + 1, 399 + 1, tocolor(0, 0, 0, 255), 0.60, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("Hacking the safe", screenW * 0.3960, screenH * 0.4818, (screenW * 0.3960) + 376, ( screenH * 0.4818) + 29, tocolor(255, 255, 255, 255), 0.60, "bankgothic", "left", "top", false, false, false, false, false) end ) Hello friends Someone helps me create this bar dxDrawLoading ? Plz
  5. Thank you very much brother I thank you very much it works perfectly Thank you so so so much
  6. ----Corregido debes crear un team llamado , Staff o Admin ... Luego al estar en ese team podran usar /superman o saltar 2 veces y listo local Superman = {} -- Settings local ZERO_TOLERANCE = 0.00001 local MAX_ANGLE_SPEED = 6 -- In degrees per frame local MAX_SPEED = 1.3 local EXTRA_SPEED_FACTOR = 2.6 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 = 1000 -- change back to 1.25 to enable smoke creation, disabled due to FPS lag concerns 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 = 70 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) attachElements(smokeGenerators[1], player, 0.75, -0.2, -0.4, -40, 0, 60) smokeGenerators[2] = self:createSmokeGenerator(player) attachElements(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 isElementInWater(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 --Initializate custom events addEvent("superman:updateRight",true) -- 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("onClientPlayerVehicleEnter",localPlayer,Superman.onEnter) addEventHandler("onClientElementDataChange", rootElement, Superman.onDataChange) addEventHandler("onClientElementStreamIn", rootElement, Superman.onStreamIn) addEventHandler("onClientElementStreamOut", rootElement, Superman.onStreamOut) addEventHandler("superman:updateRight",rootElement,Superman.updateRight) -- Bind keys bindKey("jump", "down", Superman.onJump) -- Register commands addCommandHandler("superman", Superman.cmdSuperman) -- Initializate attributes self.smokeGenerators = {} self.rotations = {} self.previousVelocity = {} --Check right triggerServerEvent("superman:checkRight",localPlayer) 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 -- --onEnter: superman cant enter vehicles -- Fix (in serverside) for players glitching other players' vehicles by warping into them while superman is active, causing them to flinch into air and get stuck. function showWarning() local x,y,z = getPedBonePosition(localPlayer,6) local sx,sy,dist = getScreenFromWorldPosition(x,y,z+0.3) if sx and sy and dist and dist < 100 then dxDrawText("You can not warp into a vehicle when superman is activated.",sx,sy,sx,sy,tocolor(255,0,0,255),1.1,"default-bold","center") end end function hideWarning() removeEventHandler("onClientRender",root,showWarning) end function Superman.onEnter() if (isPlayerFlying(localPlayer) or getElementData(localPlayer,"superman:takingOff")) and not isTimer(warningTimer) then addEventHandler("onClientRender",root,showWarning) warningTimer = setTimer(hideWarning,5000,1) end end -- --updateRight: Update right state of player -- function Superman.updateRight(state) IS_ALLOWED = state 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() local self = Superman end function Superman.onStreamOut() local self = Superman if source and isElement(source) and getElementType(source) == "player" and isPlayerFlying(source) then self.rotations[source] = nil self.previousVelocity[source] = nil end end -- -- onDataChange: Check if somebody who is out of stream stops being superman -- function Superman.onDataChange(dataName, oldValue) local self = Superman if dataName == "superman:flying" and isElement(source) and getElementType(source) == "player" and oldValue ~= getElementData(source, dataName) and oldValue == true and getElementData(source, dataName) == false then self:restorePlayer(source) end end -- -- onJump: Combo to start flight without any command -- function Superman.onJump(key, keyState) if not getElementData(localPlayer, "class") then return end if getElementData(localPlayer, "class") ~= "Staff" and getElementData(localPlayer, "class") ~= "Admin" then return end if not getPlayerTeam(localPlayer) then return end if getTeamName(getPlayerTeam(localPlayer)) ~= "Admins" then return end local self = Superman local task = getPedSimplestTask(localPlayer) if not isPlayerFlying(localPlayer) then if task == "TASK_SIMPLE_IN_AIR" then setElementVelocity(localPlayer, 0, 0, TAKEOFF_VELOCITY) setTimer(Superman.startFlight, 100, 1) end end end -- -- Commands -- function Superman.cmdSuperman() if not getElementData(localPlayer, "class") then return end if getElementData(localPlayer, "class") ~= "Staff" and getElementData(localPlayer, "class") ~= "Admin" then return end if not getPlayerTeam(localPlayer) then return end if getTeamName(getPlayerTeam(localPlayer)) ~= "Admins" then return end local self = Superman if isPedInVehicle(localPlayer) or isPlayerFlying(localPlayer) then return end setElementVelocity(localPlayer, 0, 0, TAKEOFF_VELOCITY) setTimer(Superman.startFlight, TAKEOFF_FLIGHT_DELAY, 1) setElementData(localPlayer,"superman:takingOff",true) end function Superman.startFlight() local self = Superman setElementData(localPlayer,"superman:takingOff",false) if isPlayerFlying(localPlayer) then return end triggerServerEvent("superman:start", rootElement) setPlayerFlying(localPlayer, true) setElementVelocity(localPlayer, 0, 0, 0) self.currentSpeed = 0 self.extraVelocity = { x = 0, y = 0, z = 0 } end -- -- Controls processing -- local jump, oldJump = false, false function Superman.processControls() local self = Superman if not isPlayerFlying(localPlayer) then jump, oldJump = getPedControlState("jump"), jump if not oldJump and jump then Superman.onJump() end return end -- Calculate the requested movement direction local Direction = Vector3D:new(0, 0, 0) if getPedControlState("forwards") then Direction.y = 1 elseif getPedControlState("backwards") then Direction.y = -1 end if getPedControlState("left") then Direction.x = 1 elseif getPedControlState("right") then Direction.x = -1 end Direction:Normalize() -- Calculate the sight direction local cameraX, cameraY, cameraZ, lookX, lookY, lookZ = getCameraMatrix() local SightDirection = Vector3D:new((lookX - cameraX), (lookY - cameraY), (lookZ - cameraZ)) SightDirection:Normalize() if getPedControlState("look_behind") then SightDirection = SightDirection:Mul(-1) end -- Calculate the current max speed and acceleration values local maxSpeed = MAX_SPEED local acceleration = ACCELERATION if getPedControlState("sprint") then maxSpeed = MAX_SPEED * EXTRA_SPEED_FACTOR acceleration = acceleration * EXTRA_ACCELERATION_FACTOR elseif getPedControlState("walk") then maxSpeed = MAX_SPEED * LOW_SPEED_FACTOR acceleration = acceleration * LOW_ACCELERATION_FACTOR end local DirectionModule = Direction:Module() -- Check if we must change the gravity if DirectionModule == 0 and self.currentSpeed ~= 0 then setGravity(0) else setGravity(serverGravity) end -- Calculate the new current speed if self.currentSpeed ~= 0 and (DirectionModule == 0 or self.currentSpeed > maxSpeed) then -- deccelerate self.currentSpeed = self.currentSpeed - acceleration if self.currentSpeed < 0 then self.currentSpeed = 0 end elseif DirectionModule ~= 0 and self.currentSpeed < maxSpeed then -- accelerate self.currentSpeed = self.currentSpeed + acceleration if self.currentSpeed > maxSpeed then self.currentSpeed = maxSpeed end end -- Calculate the movement requested direction if DirectionModule ~= 0 then Direction = Vector3D:new(SightDirection.x * Direction.y - SightDirection.y * Direction.x, SightDirection.x * Direction.x + SightDirection.y * Direction.y, SightDirection.z * Direction.y) -- Save the last movement direction for when player releases all direction keys self.lastDirection = Direction else -- Player is not specifying any direction, use last known direction or the current velocity if self.lastDirection then Direction = self.lastDirection if self.currentSpeed == 0 then self.lastDirection = nil end else Direction = Vector3D:new(getElementVelocity(localPlayer)) end end Direction:Normalize() Direction = Direction:Mul(self.currentSpeed) -- Applicate a smooth direction change, if moving if self.currentSpeed > 0 then local VelocityDirection = Vector3D:new(getElementVelocity(localPlayer)) VelocityDirection:Normalize() if math.sqrt(VelocityDirection.x^2 + VelocityDirection.y^2) > 0 then local DirectionAngle = getVector2DAngle(Direction) local VelocityAngle = getVector2DAngle(VelocityDirection) local diff = angleDiff(DirectionAngle, VelocityAngle) local calculatedAngle if diff >= 0 then if diff > MAX_ANGLE_SPEED then calculatedAngle = VelocityAngle + MAX_ANGLE_SPEED else calculatedAngle = DirectionAngle end else if diff < MAX_ANGLE_SPEED then calculatedAngle = VelocityAngle - MAX_ANGLE_SPEED else calculatedAngle = DirectionAngle end end calculatedAngle = calculatedAngle % 360 local DirectionModule2D = math.sqrt(Direction.x^2 + Direction.y^2) Direction.x = -DirectionModule2D*math.cos(math.rad(calculatedAngle)) Direction.y = DirectionModule2D*math.sin(math.rad(calculatedAngle)) end end if Direction:Module() == 0 then self.extraVelocity = { x = 0, y = 0, z = 0 } end -- Set the new velocity setElementVelocity(localPlayer, Direction.x + self.extraVelocity.x, Direction.y + self.extraVelocity.y, Direction.z + self.extraVelocity.z) if self.extraVelocity.z > 0 then self.extraVelocity.z = self.extraVelocity.z - 1 if self.extraVelocity.z < 0 then self.extraVelocity.z = 0 end elseif self.extraVelocity.z < 0 then self.extraVelocity.z = self.extraVelocity.z + 1 if self.extraVelocity.z > 0 then self.extraVelocity.z = 0 end end end -- -- Players flight processing -- function Superman.processFlight() local self = Superman for player in iterateFlyingPlayers() do local Velocity = Vector3D:new(getElementVelocity(player)) local distanceToBase = getElementDistanceFromCentreOfMassToBaseOfModel(player) local playerPos = Vector3D:new(getElementPosition(player)) playerPos.z = playerPos.z - distanceToBase local distanceToGround if playerPos.z > 0 then local hit, hitX, hitY, hitZ, hitElement = processLineOfSight(playerPos.x, playerPos.y, playerPos.z, playerPos.x, playerPos.y, playerPos.z - LANDING_DISTANCE - 1, true, true, true, true, true, false, false, false) if hit then distanceToGround = playerPos.z - hitZ end end if distanceToGround and distanceToGround < GROUND_ZERO_TOLERANCE then self:restorePlayer(player) if player == localPlayer then setGravity(serverGravity) triggerServerEvent("superman:stop", getRootElement()) end elseif distanceToGround and distanceToGround < LANDING_DISTANCE then self:processLanding(player, Velocity, distanceToGround) elseif Velocity:Module() < ZERO_TOLERANCE then self:processIdleFlight(player) else self:processMovingFlight(player, Velocity) end end end function Superman:processIdleFlight(player) -- Set the proper animation on the player local animLib, animName = getPedAnimation(player) if animLib ~= IDLE_ANIMLIB or animName ~= IDLE_ANIMATION then setPedAnimation(player, IDLE_ANIMLIB, IDLE_ANIMATION, -1, IDLE_ANIM_LOOP, false, false) end setElementCollisionsEnabled(player, false) -- If this is myself, calculate the ped rotation depending on the camera rotation if player == localPlayer then local cameraX, cameraY, cameraZ, lookX, lookY, lookZ = getCameraMatrix() local Sight = Vector3D:new(lookX - cameraX, lookY - cameraY, lookZ - cameraZ) Sight:Normalize() if getPedControlState("look_behind") then Sight = Sight:Mul(-1) end Sight.z = math.atan(Sight.x / Sight.y) if Sight.y > 0 then Sight.z = Sight.z + math.pi end Sight.z = math.deg(Sight.z) + 180 setPedRotation(localPlayer, Sight.z) setElementRotation(localPlayer, 0, 0, Sight.z) else local Zangle = getPedCameraRotation(player) setPedRotation(player, Zangle) setElementRotation(player, 0, 0, Zangle) end end function Superman:processMovingFlight(player, Velocity) -- Set the proper animation on the player local animLib, animName = getPedAnimation(player) if animLib ~= FLIGHT_ANIMLIB or animName ~= FLIGHT_ANIMATION then setPedAnimation(player, FLIGHT_ANIMLIB, FLIGHT_ANIMATION, -1, FLIGHT_ANIM_LOOP, true, false) end if player == localPlayer then setElementCollisionsEnabled(player, true) else setElementCollisionsEnabled(player, false) end -- Calculate the player rotation depending on their velocity local Rotation = Vector3D:new(0, 0, 0) if Velocity.x == 0 and Velocity.y == 0 then Rotation.z = getPedRotation(player) else Rotation.z = math.deg(math.atan(Velocity.x / Velocity.y)) if Velocity.y > 0 then Rotation.z = Rotation.z - 180 end Rotation.z = (Rotation.z + 180) % 360 end Rotation.x = -math.deg(Velocity.z / Velocity:Module() * 1.2) -- Rotation compensation for the self animation rotation Rotation.x = Rotation.x - 40 -- Calculate the Y rotation for barrel rotations if not self.rotations[player] then self.rotations[player] = 0 end if not self.previousVelocity[player] then self.previousVelocity[player] = Vector3D:new(0, 0, 0) end local previousAngle = getVector2DAngle(self.previousVelocity[player]) local currentAngle = getVector2DAngle(Velocity) local diff = angleDiff(currentAngle, previousAngle) if isnan(diff) then diff = 0 end local calculatedYRotation = -diff * MAX_Y_ROTATION / MAX_ANGLE_SPEED if calculatedYRotation > self.rotations[player] then if calculatedYRotation - self.rotations[player] > ROTATION_Y_SPEED then self.rotations[player] = self.rotations[player] + ROTATION_Y_SPEED else self.rotations[player] = calculatedYRotation end else if self.rotations[player] - calculatedYRotation > ROTATION_Y_SPEED then self.rotations[player] = self.rotations[player] - ROTATION_Y_SPEED else self.rotations[player] = calculatedYRotation end end if self.rotations[player] > MAX_Y_ROTATION then self.rotations[player] = MAX_Y_ROTATION elseif self.rotations[player] < -MAX_Y_ROTATION then self.rotations[player] = -MAX_Y_ROTATION elseif math.abs(self.rotations[player]) < ZERO_TOLERANCE then self.rotations[player] = 0 end Rotation.y = self.rotations[player] -- Apply the calculated rotation setPedRotation(player, Rotation.z) setElementRotation(player, Rotation.x, Rotation.y, Rotation.z) -- Save the current velocity self.previousVelocity[player] = Velocity -- If the speed is over the given value, create the smoke generators if Velocity:Module() > (SMOKING_SPEED - ZERO_TOLERANCE) and not isElementInWater(player) then self:createSmokeGenerators(player) else self:destroySmokeGenerators(player) end end function Superman:processLanding(player, Velocity, distanceToGround) -- Set the proper animation on the player local animLib, animName = getPedAnimation(player) if animLib ~= FLIGHT_ANIMLIB or animName ~= FLIGHT_ANIMATION then setPedAnimation(player, FLIGHT_ANIMLIB, FLIGHT_ANIMATION, -1, FLIGHT_ANIM_LOOP, true, false) end if player == localPlayer then setElementCollisionsEnabled(player, true) else setElementCollisionsEnabled(player, false) end -- If the speed is over the given value, create the smoke generators if Velocity:Module() > (SMOKING_SPEED - ZERO_TOLERANCE) and not isElementInWater(player) then self:createSmokeGenerators(player) else self:destroySmokeGenerators(player) end -- Calculate the player rotation depending on their velocity and distance to ground local Rotation = Vector3D:new(0, 0, 0) if Velocity.x == 0 and Velocity.y == 0 then Rotation.z = getPedRotation(player) else Rotation.z = math.deg(math.atan(Velocity.x / Velocity.y)) if Velocity.y > 0 then Rotation.z = Rotation.z - 180 end Rotation.z = (Rotation.z + 180) % 360 end Rotation.x = -(85 - (distanceToGround * 85 / LANDING_DISTANCE)) -- Rotation compensation for the self animation rotation Rotation.x = Rotation.x - 40 -- Apply the calculated rotation setPedRotation(player, Rotation.z) setElementRotation(player, Rotation.x, Rotation.y, Rotation.z) end -- -- Vectors -- Vector3D = { new = function(self, _x, _y, _z) local newVector = { x = _x or 0.0, y = _y or 0.0, z = _z or 0.0 } return setmetatable(newVector, { __index = Vector3D }) end, Copy = function(self) return Vector3D:new(self.x, self.y, self.z) end, Normalize = function(self) local mod = self:Module() if mod ~= 0 then self.x = self.x / mod self.y = self.y / mod self.z = self.z / mod end end, Dot = function(self, V) return self.x * V.x + self.y * V.y + self.z * V.z end, Module = function(self) return math.sqrt(self.x * self.x + self.y * self.y + self.z * self.z) end, AddV = function(self, V) return Vector3D:new(self.x + V.x, self.y + V.y, self.z + V.z) end, SubV = function(self, V) return Vector3D:new(self.x - V.x, self.y - V.y, self.z - V.z) end, CrossV = function(self, V) return Vector3D:new(self.y * V.z - self.z * V.y, self.z * V.x - self.x * V.z, self.x * V.y - self.y * V.z) end, Mul = function(self, n) return Vector3D:new(self.x * n, self.y * n, self.z * n) end, Div = function(self, n) return Vector3D:new(self.x / n, self.y / n, self.z / n) end, MulV = function(self, V) return Vector3D:new(self.x * V.x, self.y * V.y, self.z * V.z) end, DivV = function(self, V) return Vector3D:new(self.x / V.x, self.y / V.y, self.z / V.z) end, }
  7. Thank you brother, I am very grateful !
  8. it's an information chat,. it's called guitext, example call(getResourceFromName("guitext"),"outputServerGuiText",thePlayer,"You are already working, you do not need another vehicle.",255,0,0)
  9. But how do I start? the chat is all good, but I do not know how to fade them
  10. xRGamingx

    dxDrawText

    Hello Friends, I need your help.. I have this random chat, and I want the chat to disappear in slow motion. interpolateBetween Help me please How to fade out DX? ---Client setElementData (localPlayer,"SXPadMensajes",true) function removeColorCoding( name ) return type(name)=='string' and string.gsub ( name, '#%x%x%x%x%x%x', '' ) or name end addCommandHandler ("chat", function () if isTimer (ReactivacionTimer) then killTimer (ReactivacionTimer) end if getElementData (localPlayer,"SXPadMensajes") == true then addGuiText ("Chat Off",255,255,255) addGuiText ("Chat of for 15min",255,255,255) setElementData (localPlayer,"SXPadMensajes",false) ReactivacionTimer = setTimer (function () setElementData (localPlayer,"SXPadMensajes",true) end, 600000, 1) else setElementData (localPlayer,"SXPadMensajes",true) addGuiText ("Chat On.",255,255,255) end end) function addGuiText(text,c1,c2,c3) if getElementData (localPlayer,"SXPadMensajes") == true then outputSGuiText(text,c1,c2,c3) if not isTimer (removeall) then removeall = setTimer (epic, 10000, 1) else killTimer (removeall) removeall = setTimer (epic, 8000, 1) end end end addEvent("callOutputGuiText",true) addEventHandler("callOutputGuiText",root, addGuiText ) x,y = guiGetScreenSize() gui1 = guiCreateLabel(x,0,0,0,"",false) gui2 = guiCreateLabel(x,0,0,0,"",false) gui3 = guiCreateLabel(x,0,0,0,"",false) gui4 = guiCreateLabel(x,0,0,0,"",false) gui5 = guiCreateLabel(x,0,0,0,"",false) guiSetVisible(gui1,false) guiSetVisible(gui2,false) guiSetVisible(gui3,false) guiSetVisible(gui4,false) guiSetVisible(gui5,false) guic1 = guiCreateLabel(x,0,0,0,"-65536",false) guic2 = guiCreateLabel(x,0,0,0,"-65536",false) guic3 = guiCreateLabel(x,0,0,0,"-65536",false) guic4 = guiCreateLabel(x,0,0,0,"-65536",false) guic5 = guiCreateLabel(x,0,0,0,"-65536",false) guiSetVisible(guic1,false) guiSetVisible(guic2,false) guiSetVisible(guic3,false) guiSetVisible(guic4,false) guiSetVisible(guic5,false) guit1 = guiCreateLabel(x,0,0,0,"10000000",false) guit2 = guiCreateLabel(x,0,0,0,"10000000",false) guit3 = guiCreateLabel(x,0,0,0,"10000000",false) guit4 = guiCreateLabel(x,0,0,0,"10000000",false) guit5 = guiCreateLabel(x,0,0,0,"10000000",false) guiSetVisible(guit1,false) guiSetVisible(guit2,false) guiSetVisible(guit3,false) guiSetVisible(guit4,false) guiSetVisible(guit5,false) function drawit() text1 = guiGetText(gui1) text2 = guiGetText(gui2) text3 = guiGetText(gui3) text4 = guiGetText(gui4) text5 = guiGetText(gui5) color1 = guiGetText(guic1) color2 = guiGetText(guic2) color3 = guiGetText(guic3) color4 = guiGetText(guic4) color5 = guiGetText(guic5) a = 0.02 dx5 = dxDrawText(removeColorCoding(text5), (x * 0.0078) - 1, (y * 0.4367) - 1, (x * 0.8930) - 1, (y * 0.4633) - 1, tocolor(0, 0, 0, 255), 1, "default-bold", "left", "top", false, false, false, true, false) dx5 = dxDrawText(removeColorCoding(text5), (x * 0.0078) + 1, (y * 0.4367) - 1, (x * 0.8930) + 1, (y * 0.4633) - 1, tocolor(0, 0, 0, 255), 1, "default-bold", "left", "top", false, false, false, true, false) dx5 = dxDrawText(removeColorCoding(text5), (x * 0.0078) - 1, (y * 0.4367) + 1, (x * 0.8930) - 1, (y * 0.4633) + 1, tocolor(0, 0, 0, 255), 1, "default-bold", "left", "top", false, false, false, true, false) dx5 = dxDrawText(removeColorCoding(text5), (x * 0.0078) + 1, (y * 0.4367) + 1, (x * 0.8930) + 1, (y * 0.4633) + 1, tocolor(0, 0, 0, 255), 1, "default-bold", "left", "top", false, false, false, true, false) dx5 = dxDrawText(text5, x * 0.0078, y * 0.4367, x * 0.8930, y * 0.4633, tonumber(color5), 1, "default-bold", "left", "top", false, false, false, true, false) dx4 = dxDrawText(removeColorCoding(text4), (x * 0.0078) - 1, (y * 0.4633) - 1, (x * 0.8930) - 1, (y * 0.4900) - 1, tocolor(0, 0, 0, 255), 1, "default-bold", "left", "top", false, false, false, true, false) dx4 = dxDrawText(removeColorCoding(text4), (x * 0.0078) + 1, (y * 0.4633) - 1, (x * 0.8930) + 1, (y * 0.4900) - 1, tocolor(0, 0, 0, 255), 1, "default-bold", "left", "top", false, false, false, true, false) dx4 = dxDrawText(removeColorCoding(text4), (x * 0.0078) - 1, (y * 0.4633) + 1, (x * 0.8930) - 1, (y * 0.4900) + 1, tocolor(0, 0, 0, 255), 1, "default-bold", "left", "top", false, false, false, true, false) dx4 = dxDrawText(removeColorCoding(text4), (x * 0.0078) + 1, (y * 0.4633) + 1, (x * 0.8930) + 1, (y * 0.4900) + 1, tocolor(0, 0, 0, 255), 1, "default-bold", "left", "top", false, false, false, true, false) dx4 = dxDrawText(text4, x * 0.0078, y * 0.4633, x * 0.8930, y * 0.4900, tonumber(color4), 1, "default-bold", "left", "top", false, false, false, true, false) dx3 = dxDrawText(removeColorCoding(text3), (x * 0.0078) - 1, (y * 0.4900) - 1, (x * 0.8930) - 1, (y * 0.5167) - 1, tocolor(0, 0, 0, 255), 1, "default-bold", "left", "top", false, false, false, true, false) dx3 = dxDrawText(removeColorCoding(text3), (x * 0.0078) + 1, (y * 0.4900) - 1, (x * 0.8930) + 1, (y * 0.5167) - 1, tocolor(0, 0, 0, 255), 1, "default-bold", "left", "top", false, false, false, true, false) dx3 = dxDrawText(removeColorCoding(text3), (x * 0.0078) - 1, (y * 0.4900) + 1, (x * 0.8930) - 1, (y * 0.5167) + 1, tocolor(0, 0, 0, 255), 1, "default-bold", "left", "top", false, false, false, true, false) dx3 = dxDrawText(removeColorCoding(text3), (x * 0.0078) + 1, (y * 0.4900) + 1, (x * 0.8930) + 1, (y * 0.5167) + 1, tocolor(0, 0, 0, 255), 1, "default-bold", "left", "top", false, false, false, true, false) dx3 = dxDrawText(text3, x * 0.0078, y * 0.4900, x * 0.8930, y * 0.5167, tonumber(color3), 1, "default-bold", "left", "top", false, false, false, true, false) dx2 = dxDrawText(removeColorCoding(text2), (x * 0.0078) - 1, (y * 0.5167) - 1, (x * 0.8930) - 1, (y * 0.5433) - 1, tocolor(0, 0, 0, 255), 1, "default-bold", "left", "top", false, false, false, true, false) dx2 = dxDrawText(removeColorCoding(text2), (x * 0.0078) + 1, (y * 0.5167) - 1, (x * 0.8930) + 1, (y * 0.5433) - 1, tocolor(0, 0, 0, 255), 1, "default-bold", "left", "top", false, false, false, true, false) dx2 = dxDrawText(removeColorCoding(text2), (x * 0.0078) - 1, (y * 0.5167) + 1, (x * 0.8930) - 1, (y * 0.5433) + 1, tocolor(0, 0, 0, 255), 1, "default-bold", "left", "top", false, false, false, true, false) dx2 = dxDrawText(removeColorCoding(text2), (x * 0.0078) + 1, (y * 0.5167) + 1, (x * 0.8930) + 1, (y * 0.5433) + 1, tocolor(0, 0, 0, 255), 1, "default-bold", "left", "top", false, false, false, true, false) dx2 = dxDrawText(text2, x * 0.0078, y * 0.5167, x * 0.8930, y * 0.5433, tonumber(color2), 1, "default-bold", "left", "top", false, false, false, true, false) dx1 = dxDrawText(removeColorCoding(text1), (x * 0.0078) - 1, (y * 0.5433) - 1, (x * 0.8930) - 1, (y * 0.5700) - 1, tocolor(0, 0, 0, 255), 1, "default-bold", "left", "top", false, false, false, true, false) dx1 = dxDrawText(removeColorCoding(text1), (x * 0.0078) + 1, (y * 0.5433) - 1, (x * 0.8930) + 1, (y * 0.5700) - 1, tocolor(0, 0, 0, 255), 1, "default-bold", "left", "top", false, false, false, true, false) dx1 = dxDrawText(removeColorCoding(text1), (x * 0.0078) - 1, (y * 0.5433) + 1, (x * 0.8930) - 1, (y * 0.5700) + 1, tocolor(0, 0, 0, 255), 1, "default-bold", "left", "top", false, false, false, true, false) dx1 = dxDrawText(removeColorCoding(text1), (x * 0.0078) + 1, (y * 0.5433) + 1, (x * 0.8930) + 1, (y * 0.5700) + 1, tocolor(0, 0, 0, 255), 1, "default-bold", "left", "top", false, false, false, true, false) dx1 = dxDrawText(text1, x * 0.0078, y * 0.5433, x * 0.8930, y * 0.5700, tonumber(color1), 1, "default-bold", "left", "top", false, false, false, true, false) end addEventHandler("onClientRender",root,drawit) function outputSGuiText(text,c1,c2,c3) text1 = guiGetText(gui1) text2 = guiGetText(gui2) text3 = guiGetText(gui3) text4 = guiGetText(gui4) guiSetText(gui2,text1) guiSetText(gui3,text2) guiSetText(gui4,text3) guiSetText(gui5,text4) -- textc1 = guiGetText(guic1) textc2 = guiGetText(guic2) textc3 = guiGetText(guic3) textc4 = guiGetText(guic4) guiSetText(guic2,textc1) guiSetText(guic3,textc2) guiSetText(guic4,textc3) guiSetText(guic5,textc4) -- guiSetText(gui1,text) c1,c2,c3 = tonumber(c1),tonumber(c2),tonumber(c3) color = tocolor(c1,c2,c3) guiSetText(guic1,color) end function outputGuiText(text,c1,c2,c3) text1 = guiGetText(gui1) text2 = guiGetText(gui2) text3 = guiGetText(gui3) text4 = guiGetText(gui4) guiSetText(gui2,text1) guiSetText(gui3,text2) guiSetText(gui4,text3) guiSetText(gui5,text4) -- textt1 = guiGetText(guit1) textt2 = guiGetText(guit2) textt3 = guiGetText(guit3) textt4 = guiGetText(guit4) guiSetText(guic2,textt1) guiSetText(guic3,textt2) guiSetText(guic4,textt3) guiSetText(guic5,textt4) guiSetText(guit1,"15") -- textc1 = guiGetText(guic1) textc2 = guiGetText(guic2) textc3 = guiGetText(guic3) textc4 = guiGetText(guic4) guiSetText(guic2,textc1) guiSetText(guic3,textc2) guiSetText(guic4,textc3) guiSetText(guic5,textc4) -- c1,c2,c3 = tonumber(c1),tonumber(c2),tonumber(c3) color = tocolor(c1,c2,c3) guiSetText(guic1,color) return "true: added text '"..text.."'" end function epic() text1 = guiGetText(guic1) text2 = guiGetText(guic2) text3 = guiGetText(guic3) text4 = guiGetText(guic4) text5 = guiGetText(guic5) guiSetText(gui1,tostring(tonumber(text1)-5)) guiSetText(gui2,tostring(tonumber(text2)-4)) guiSetText(gui3,tostring(tonumber(text3)-3)) guiSetText(gui4,tostring(tonumber(text4)-2)) guiSetText(gui5,tostring(tonumber(text5)-1)) if tonumber(text1) <= 4 then guiSetText(gui1,"") end if tonumber(text2) <= 3 then guiSetText(gui2,"") end if tonumber(text3) <= 2 then guiSetText(gui3,"") end if tonumber(text4) <= 1 then guiSetText(gui4,"") end if tonumber(text5) <= 0 then guiSetText(gui5,"") end end
  11. addEventHandler("onClientRender", root, function() local screenW,screenH = guiGetScreenSize() -- The variables local SonR = getElementData(localPlayer, "SonidoNotiReproducido") if SonR == "Si" then playSound("files/noti.ogg") setElementData (localPlayer, "SonidoNotiReproducido", "No") end local NumNoti = getElementData(localPlayer, "CuantaNotificacion") if NumNoti == 1 then dxDrawRectangle(screenW * 0.0578, screenH * 0.9333, screenW * 0.1578, screenH * 0.0574, tocolor(1, 0, 0, 110), false) dxDrawImage(screenW * 0.0578, screenH * 0.9333, screenW * 0.0354, screenH * 0.0574, "Images/Noti.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText(""..NumNoti.." Notificación", (screenW * 0.0932) - 1, (screenH * 0.9333) - 1, (screenW * 0.2156) - 1, (screenH * 0.9907) - 1, tocolor(0, 0, 0, 255), 1.10, "sans", "center", "center", false, false, false, false, false) dxDrawText(""..NumNoti.." Notificación", (screenW * 0.0932) + 1, (screenH * 0.9333) - 1, (screenW * 0.2156) + 1, (screenH * 0.9907) - 1, tocolor(0, 0, 0, 255), 1.10, "sans", "center", "center", false, false, false, false, false) dxDrawText(""..NumNoti.." Notificación", (screenW * 0.0932) - 1, (screenH * 0.9333) + 1, (screenW * 0.2156) - 1, (screenH * 0.9907) + 1, tocolor(0, 0, 0, 255), 1.10, "sans", "center", "center", false, false, false, false, false) dxDrawText(""..NumNoti.." Notificación", (screenW * 0.0932) + 1, (screenH * 0.9333) + 1, (screenW * 0.2156) + 1, (screenH * 0.9907) + 1, tocolor(0, 0, 0, 255), 1.10, "sans", "center", "center", false, false, false, false, false) dxDrawText(""..NumNoti.." Notificación", screenW * 0.0932, screenH * 0.9333, screenW * 0.2156, screenH * 0.9907, tocolor(255, 255, 255, 255), 1.10, "sans", "center", "center", false, false, false, false, false) end if NumNoti >= 2 and NumNoti <= 99999 then ----------------Line 647 dxDrawRectangle(screenW * 0.0578, screenH * 0.9333, screenW * 0.1578, screenH * 0.0574, tocolor(1, 0, 0, 110), false) dxDrawImage(screenW * 0.0578, screenH * 0.9333, screenW * 0.0354, screenH * 0.0574, "Images/Noti.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText(""..NumNoti.." Notificaciones", (screenW * 0.0932) - 1, (screenH * 0.9333) - 1, (screenW * 0.2156) - 1, (screenH * 0.9907) - 1, tocolor(0, 0, 0, 255), 1.10, "sans", "center", "center", false, false, false, false, false) dxDrawText(""..NumNoti.." Notificaciones", (screenW * 0.0932) + 1, (screenH * 0.9333) - 1, (screenW * 0.2156) + 1, (screenH * 0.9907) - 1, tocolor(0, 0, 0, 255), 1.10, "sans", "center", "center", false, false, false, false, false) dxDrawText(""..NumNoti.." Notificaciones", (screenW * 0.0932) - 1, (screenH * 0.9333) + 1, (screenW * 0.2156) - 1, (screenH * 0.9907) + 1, tocolor(0, 0, 0, 255), 1.10, "sans", "center", "center", false, false, false, false, false) dxDrawText(""..NumNoti.." Notificaciones", (screenW * 0.0932) + 1, (screenH * 0.9333) + 1, (screenW * 0.2156) + 1, (screenH * 0.9907) + 1, tocolor(0, 0, 0, 255), 1.10, "sans", "center", "center", false, false, false, false, false) dxDrawText(""..NumNoti.." Notificaciones", screenW * 0.0932, screenH * 0.9333, screenW * 0.2156, screenH * 0.9907, tocolor(255, 255, 255, 255), 1.10, "sans", "center", "center", false, false, false, false, false) end local cantidadnew = getElementData(localPlayer, "NotificacionNews") if cantidadnew == 0 then guiSetVisible(notificacion1, false) end if cantidadnew >= 1 and cantidadnew <= 100 then guiSetVisible(notificacion1, true) end end ) ERROR: PANEL\C_Panel.lua:647 attemp to compare number with bolean ----Helps Please
  12. Hi Friends! Help me plz.. Help me solve this error [2017-12-18 23:28:42] WARNING: [ServerNG]\NGTeam\kill.lua:518: Bad argument @ 'getPlayerTeam' [Expected player at argument 1, got nil] function isPlayerInTeam(src, TeamName) local team = getPlayerTeam(src) ----Line 518 if team then if getTeamName(team) == TeamName then return true else return false end end end
  13. Hello! Any friend who can operate the yacht of gta V in mta sa? Let him contact me and I can pay him I want to make it appear in an area and that it can not be use thanks
  14. Hello friends who help me? I need to put the GTA V yate for the mta: sa and I have these 7 Files .. What is my errors? Help please Friends --Client function replaceModel() col = engineLoadCOL("models/Barandas_sx.col") engineReplaceCOL(col, Barandas_sx,493) col = engineLoadCOL( "models/Yate.col" ) engineReplaceCOL(col, Yate,493) txd_floors = engineLoadTXD('Yate_0.txd',493) engineImportTXD(txd_floors,493) ---- txd_floors = engineLoadTXD ( "models/Barandas_sx.txd" ) engineImportTXD ( txd_floors, 493 ) --- txd_floors = engineLoadTXD ( "modelsYate.txd" ) engineImportTXD ( txd_floors, 493 ) ----- dff_floors = engineLoadDFF ( "modelsYate.dff" ) engineReplaceModel ( dff_floors, 493 ) ---- dff_floors = engineLoadDFF ( "models/Barandas_sx.dff" ) engineReplaceModel ( dff_floors, 493 ) end addEventHandler ( 'onClientResourceStart', getResourceRootElement(getThisResource()), replaceModel) addCommandHandler ( 'reloadcar', replaceModel --Meta <meta> <info author="Gaming" description="Yate" version="1.5" type="script" /> <script src="client.lua" type="client"/> <script src="server.lua" type="server"/> <file src="models/Yate.txd" type="client"/> <file src="models/Yate.dff" type="client"/> <file src="models/Yate_0.txd" type="client"/> <file src='models/Yate.col' /> <file src="models/Barandas_sx.dff" type="client"/> <file src="models/Barandas_sx.txd" type="client"/> <file src='models/Barandas_sx.col' /> </meta> --Files Look
  15. Hola, Miguel para que tipo de sv es ? RPG
  16. Hello guys, I would like to know how I can get position in the HUD interface is that I want to make a dxDrawRectangle apart a resistance script would help me?
  17. xRGamingx

    Resource

    Hi friend, anyone knows of any script that makes the truck loads heavier ?
  18. Hi ,I do not walk, you know why? The script found it in the community but does not walk The first picture shows how the script is local w, h = guiGetScreenSize() local resx local resy function resY(value) if h <= 600 then resy = 600 elseif h <= 768 then resy = 768 elseif h <= 720 then resy = 720 elseif h <=900 then resy = 900 elseif h <=1000 then resy = 1000 else resy = 1080 end return (value/resy) * h end function resX(value) if w <= 800 then resx = 800 elseif w <= 1024 then resx = 1024 elseif w <= 1280 then resx = 1280 elseif w <=1400 then resx = 1400 elseif w <= 1650 then resx = 1650 else resx = 1920 end return (value/resx) * w end local MainX = (w/2-resX(190))/w local MainY = (h/2-resY(320))/h local progress = 0 local activo = false local ancho = 5 local timer local tiempo = 0 function _dxDrawRectangle(x,y,w,h,r,g,b,a) dxDrawRectangle(x,y,w,h,tocolor(r,g,b,80*a)) dxDrawRectangle(x+resY(2),y+resY(2),w-resY(4),h-resY(4),tocolor(r,g,b,170*a)) end function principal (thePlayer) local theVehicle = getPedOccupiedVehicle(thePlayer) if ( getElementModel ( theVehicle ) == 520 ) then setElementData(thePlayer,"on",true) addEventHandler("onClientRender",getRootElement(),start) end end addEventHandler ( "onClientVehicleEnter", getRootElement(), principal ) function salida (player) setElementData(player,"on",false) toggleControl ( "vehicle_secondary_fire", true ) removeEventHandler("onClientRender",getRootElement(),start) activo = false progress= 0 ancho = 0 tiempo = 0 end addEventHandler ( "onClientVehicleExit", getRootElement(), salida ) function start () if not getElementData(getLocalPlayer(),"on") then return end init() if activo then progress = progress+0.00010 ancho,tiempo = interpolateBetween(ancho,tiempo,0,299,100,0,progress,"Linear") end _dxDrawRectangle(MainX+resX(680),MainY+resY(850),resX(300),resY(40),0,0,0,180) _dxDrawRectangle(MainX+resX(681),MainY+resY(850),resX(ancho),resY(40),0,0,255,255) dxDrawImage(MainX+resX(620),MainY+resY(850),resX(40),resY(40),"img.png",0,0,0,tocolor(0,0,180,255)) dxDrawText("Misil:"..math.ceil(tiempo).."%",MainX+resX(775),MainY+resY(860),w,h,tocolor(255,255,255,255),1.5,"default-bold") end function active() toggleControl ( "vehicle_secondary_fire", true ) activo = false progress= 0 end function init() if not getElementData(getLocalPlayer(),"on") then return end local control = getControlState ("vehicle_secondary_fire") if control == true then toggleControl ( "vehicle_secondary_fire", false ) activo = true progress= 0 ancho = 0 tiempo = 0 if isTimer(timer) then killTimer(timer) end timer = setTimer(active,9000,1) else end end <meta> <script src = "script.lua" type="client" /> <file src="img.png" /> </meta> img
  19. Cody Friend this is an example of what I want.
  20. Hello friends, I need you to help me, How can I make the name Squad appear in Blue . function PonerGruposCreados(tab) guiGridListClear(listatodoslosgrupos) local migrupo = getElementData(localPlayer, "Group") for i, grupo in pairs(tab) do local row = guiGridListAddRow(listatodoslosgrupos) guiGridListSetItemText(listatodoslosgrupos, row, 1, "["..tostring(grupo.TagGrupo).."] - "..tostring(grupo.GrupoNombre).."", false, true) guiGridListSetItemText(listatodoslosgrupos, row, 2, tostring(grupo.NombreLider), false, true) guiGridListSetItemText(listatodoslosgrupos, row, 3, tostring(grupo.Miembros), false, true) guiGridListSetItemText(listatodoslosgrupos, row, 4, tostring(grupo.TipoGrupo), false, true) guiGridListSetItemText(listatodoslosgrupos, row, 5, tostring(grupo.DineroGrupo), false, true) guiGridListSetItemText(listatodoslosgrupos, row, 6, tostring(grupo.GrupoAliado), false, true) guiGridListSetItemText(listatodoslosgrupos, row, 7, tostring(grupo.FechaCreacion), false, true) local cantidaddemiembrostotal = 1---SLOT local cantidadmiembro = tostring(grupo.Miembros) if ( tonumber (cantidadmiembro) >= tonumber(cantidaddemiembrostotal) ) then for i = 1, 7 do guiGridListSetItemColor(listatodoslosgrupos, row, i, 255, 0, 0) end end if grupo.GangNamea == migrupo then local player = getPlayerFromName(grupo.GangNamea) if player and getElementData(player, "Group") == migrupo then end end end guiSetText(PanelTodoGrupo, "Group - "..guiGridListGetRowCount ( listatodoslosgrupos ).." Group)") end addEvent("PonerGruposCreados", true) addEventHandler("PonerGruposCreados", root, PonerGruposCreados)
  21. Oh my friend, if you look at the image the celestial circles are my members,. Since my server has the panel of recruits, I just need to add that when they enter a group is marked the blip That's what I try to do on my server,
  22. Hello friends, how can I make all members of my group have the same blip? That when a user enters my gang a blip is added to recognize them
×
×
  • Create New...