
daniel735
-
Posts
20 -
Joined
-
Last visited
Posts posted by daniel735
-
-
hola muchachos tengo un recurso de volar en mi servar pero el comando del recurso funciona para todos los usuarios y quisiera saber si hay forma de que solo el comando de el recurso funcione para los admin
-- 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()
-
Sólo por curiosidad, ¿Por qué veo tu script en inglés y en español? ._.
PD: A mi parecer eso no funcionaría
+1 el lenguaje oficial y único de .lua es inglés, es la primera vez que veo un script en español...
lo que pasa es que el chrome me tradujo el scrip
-
ayuda con este scrip de blip que hace ver a los jugadores de tu clan en el mapa lo que pasa es que funciona bien pero si entro con una cuenta sin clan y camino y me monto en un auto empiezo a ver a personas en el mapa quisiera que si no tienes clan no veas a los de mas en el mapa solo si te unes a un clan puedas ver a los compañeros
playerBlibs = {} amouunt = 0 function updateGPS() amouunt = 0 local gangname = getElementData(getLocalPlayer(),"gang") for i, blip in ipairs(playerBlibs) do destroyElement(blip) end if not getElementData(getLocalPlayer(),"gang") then return end playerBlibs = {} for i, player in ipairs(getElementsByType("player")) do if gangname == getElementData(player,"gang") then amouunt = amouunt+1 playerBlibs[amouunt] = createBlipAttachedTo(player,0,2,22,255,22) setBlipVisibleDistance(playerBlibs[amouunt],1000) end end end setTimer(updateGPS,1000,0)
-
tomas me refiero que en el modo de juego de dayz mta hay un radar en area donde muestra todas las ubicaciones de los jugadores me preguntaba si podria hacer lo mismo pero en una base
-
hola muchachos tengo una duda sera que se puede poner un radar como el del area 51 con la ubicacion de todos los jugadores en una base?
-
Gracias tomas funciono gracias por toda tu ayuda men
-
ayuda tengo este recurso de blip que es para cuando entro a una gang pueda ver los mienbros de la gang en el gps y en el mapa pero tengo unos problemas con el lo que pasa es que Prendes el resource todo esta bien,reconnectas y la gente en tu gang aun te ve pero voz no a ellos alguien de tu gang reconnecta le comienzas aver al de tu gang pero solo el que reconnecto
local pBlips = { } function blipsRestart() for index, player in ipairs(getElementsByType("player")) do addTeamBlip(player) end end setTimer(blipsRestart,10000,0) addEventHandler("onResourceStart", resourceRoot, blipsRestart) function blipJoin() addTeamBlip(source) end addEventHandler("onPlayerJoin",getRootElement(),blipJoin) function addTeamBlip(player) if ( pBlips[player] ) then return false end -- Adding a prevention of duplicate blips local theGang = getElementData ( player, "gang" ) if ( theGang and theGang ~= "None" ) then local r, g, b = getPlayerNametagColor( player ) local theBlip = createBlipAttachedTo( player, 0, 2, 0, 255, 0 ) -- Change visibility to only the team members setElementVisibleTo( theBlip, root, false ) for index, value in ipairs ( getPlayersByGang ( theGang ) ) do -- THIS setElementVisibleTo( theBlip, value, true ) end pBlips[player] = theBlip end end function destroyBlip(element) local theElement = source or element if ( theElement ) then destroyElement(pBlips[theElement]) pBlips[theElement] = nil -- Just in-case... end end -- Events addEventHandler ( "onPlayerSpawn", root, addTeamBlip ) addEventHandler ( "onPlayerQuit", root, destroyBlip ) function getPlayersByGang ( gang ) local players = { } for _, player in ipairs ( getElementsByType ( "player" ) ) do if ( getElementData ( player, "gang" ) == gang ) then table.insert ( players, player ) end end return players end
-
hola muchachos gracias por su ayuda me han ayudado bastante con este scrip ya estoy seria lo ultimo que necesito
como hago para que el scrip funcione con una gang en ves de un grupo de acl
local gate3 = createObject(10841, -1078.9000244141, -1647.3000488281, 83.199996948242, 0, 0, 267.99499511719 ) open = false function OpenObjectt ( thePlayer ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "SOH" ) ) then if not open then moveObject(gate3, 1000, -1079, -1647.0999755859, 90.199996948242, 0, 0, 0 ) open = true outputChatBox ( "#00FF00Abriendo Puerta", thePlayer, 255, 255, 255, true ) elseif open then moveObject(gate3, 1000, -1078.9000244141, -1647.3000488281, 83.199996948242, 0, 0, 0 ) open = false outputChatBox ( "#ff0000Cerrando Puerta", thePlayer, 255, 255, 255, true ) end end end addCommandHandler("soh", OpenObjectt )
-
hola muchachos gracias por su ayuda me han ayudado bastante con este recurso ya estoy seria lo ultimo que necesito
como hago para que el scrip funcione con una gang en ves de un grupo de acl
local gate3 = createObject(10841, -1078.9000244141, -1647.3000488281, 83.199996948242, 0, 0, 267.99499511719 ) open = false function OpenObjectt ( thePlayer ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "SOH" ) ) then if not open then moveObject(gate3, 1000, -1079, -1647.0999755859, 90.199996948242, 0, 0, 0 ) open = true outputChatBox ( "#00FF00Abriendo Puerta", thePlayer, 255, 255, 255, true ) elseif open then moveObject(gate3, 1000, -1078.9000244141, -1647.3000488281, 83.199996948242, 0, 0, 0 ) open = false outputChatBox ( "#ff0000Cerrando Puerta", thePlayer, 255, 255, 255, true ) end end end addCommandHandler("soh", OpenObjectt )
-
no funciono
-
listo muchachos gracias me funciono ahora lo ultimo que necesito es que el scrip funcione con un grupo de una gang en ves de un grupo de acl
-
hola amigos como hago para que este con este scrip cuando abra una puerta me diga abierto y cuando la cierre me diga cerrado
local gate3 = createObject(10841, -1078.9000244141, -1647.3000488281, 83.199996948242, 0, 0, 267.99499511719 ) open = false function OpenObjectt ( thePlayer ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "SOH" ) ) then if not open then moveObject(gate3, 1000, -1079, -1647.0999755859, 90.199996948242, 0, 0, 0 ) open = true elseif open then moveObject(gate3, 1000, -1078.9000244141, -1647.3000488281, 83.199996948242, 0, 0, 0 ) open = false end end end addCommandHandler("soh", OpenObjectt )
-
Gracias muchachos me funciono el scrip
-
Mr.Aleks explícame como porque no se mucho de esto
-
como hago para que este scrip me funcione con el grupo del acl porque cree un grupo y puse el nombre en el scrip del grupo y no me funciona
local gate3 = createObject(2951, 233.5, 1822.3000488281, 6.4000000953674, 0, 0, 270 ) open = false function OpenObjectt ( thePlayer ) if ( getTeamName(getPlayerTeam(thePlayer)) == "Burning Crusaders" ) then if not Open then moveObject(gate3, 4000, 233.5, 1818.8000488281, 6.4000000953674 , 0, 0, 0 ) else moveObject(gate3, 4000, 233.5, 1822.3000488281, 6.4000000953674, 0, 0, 0 ) end Open = not Open end end addCommandHandler("warroom", OpenObjectt )
-
This scrip worked but now I need to add that when someone joins the clan to automatically group acl
local gate3 = createObject(2951, 233.5, 1822.3000488281, 6.4000000953674, 0, 0, 270 ) open = false function OpenObjectt ( thePlayer ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Burning Crusaders" ) ) then if not open then moveObject(gate3, 4000, 233.5, 1818.8000488281, 6.4000000953674 , 0, 0, 0 ) open = true elseif open then moveObject(gate3, 4000, 233.5, 1822.3000488281, 6.4000000953674, 0, 0, 0 ) open = false end end end addCommandHandler("warroom", OpenObjectt )
-
necesito un script para clanes q les mande automaticamente al acl de tu clan si se unen y que los quite si se van del clan
-
ayuda necesito un scrip para hacer puertas para bases que solo los mienbros de un clan lo puedan usar y si se salen del clan ya no lo puedan abrir
-
help I need a scrip to doors only a member of a clan can use it and if you leave the clan no longer works for you
como reparo este scrip
in Scripting
Posted
ayuda con este scrip de blip que hace ver a los jugadores de tu clan en el mapa lo que pasa es que funciona bien pero si entro con una cuenta sin clan y camino y me monto en un auto empiezo a ver a personas en el mapa quisiera que si no tienes clan no veas a los de mas en el mapa solo si te unes a un clan puedas ver a los compañeros