Jump to content

xeon17

Members
  • Posts

    1,903
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by xeon17

  1. @Dealman , Can you tell me what is MTA Eir? never heard that. @Xward , use the following functions if you want to replace some existing weapons models. engineLoadTXD engineImportTXD engineLoadDFF engineReplaceModel Also , it's possible to create weapons , but they can't be used by players ( as i know ) createWeapon
  2. Everything is correct , are you sure it doesn't work?
  3. function disableSounds() setAmbientSoundEnabled( "gunfire", false ) setWorldSoundEnabled ( 5, false) end addEventHandler("onClientResourceStart",resourceRoot,disableSounds)
  4. I'm not sure , createWeapon fireWeapon setWeaponState setWeaponAmmo
  5. Your code only attach the minigun to the vehicle , post the part of the script where you make the minigun fire.
  6. Please read the following topic viewtopic.php?f=91&t=47897
  7. Yoo is english allowed here ?
  8. @Tomas , Didn't knew that. @nk0zkh0z, Have you solved it alone or you still heed help?
  9. And what isn't working? any errors in debugscript3?
  10. @TAPL, hehehe, your post make me laugh @Hassan Meke, Keep it nice
  11. You're right , there isn't any way to add a new animation to MTA.
  12. You don't need to be angry , i'm just asking you to explain better so me and other peoples can help you. If you have a bad english , i would like to recommend you the languages section where you can talk with other peoples in your native language. viewforum.php?f=117 Kind regards.
  13. Hello there, I don't know if i'm posting in the correct board , if not , an moderator please move this topic to the correct board. My suggestion is more and better moderators for the portugues section , since it's one of biggest language sections on forum but without good moderation. In the last time , there are a lot flame wars , hard insults and similar things. But the section moderators are doing pretty nothing. I've already reported some topics and posts in that section , but the reaction wasn't so good. I would like to criticize the modeator Cadu12 i don't even know why he is a moderator , since he NEVER enter in the portugues section. So the only active moderator is DNL261 who isn't mature enough to solve problems which the section actually have , such as flame wars and insults. I've already reported some problems to the global moderator Tete omar who helped me a lot! big thanks to him! but i can't report it every time , so i found it would be better to change the moderation of portuguese section. I'm creating this topic , because i think it's better then sending the same message to every moderator or administrator. The portugues section really have problems , which need to be solved. There are a lot guys who are helping every day and who are mature enough to be in the moderation of portugues section. I don't have nothing against if users of forums ( non-admins) want to post here no matter if it's negative or positive opinion or post. If an administrator or moderator want proofs of that what i said about Cadu12 and DNL261 feel free to send me a private message. Kind regards.
  14. Can you explain what do you want please? i'm pretty sure nobody understood you.
  15. xeon17

    Server Linux

    I'm not interested to script for you , but thanks for the offer. Of course you got the Valhalla MTA RolePlay 4.0.24 gamemode free , but this gamemode were stolen and posted on the internet. If you are still searching a scripter i would like to recommend you the following section. viewforum.php?f=177
  16. xeon17

    Server Linux

    Hello, Here on forum we don't help peoples with leaked/stolen scripts.
  17. Replace client.lua with this -- 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 bindKey("jump", "down", Superman.onJump) -- Register commands addCommandHandler("superman", Superman.cmdSuperman,true) -- 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()
  18. Post the superman script here.
×
×
  • Create New...