Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. His scripts are vG based, that mean's the bank system uses MySQL.
  2. Castillo

    LUAmatic

    addCommandHandler ( "mtafan", function ( thePlayer ) local x, y, z = getElementPosition ( thePlayer ) outputChatBox ( "X = ".. ( x + 20 ) ..", Y = ".. ( y + 20 ) ..", Z = ".. z, thePlayer, 0, 255, 0 ) end )
  3. Castillo

    Jail Help

    addCommandHandler ( 'aaa', function ( thePlayer, sCommand ) -- First argument is the player who executed the command ( just server side ). if ( isStaff ( thePlayer ) ) then outputChatBox ( 'ADMIN HELP HERE', thePlayer, 193, 13, 13 ); outputChatBox ( 'ADMIN HELP HERE', thePlayer, 193, 13, 13 ); outputChatBox ( 'ADMIN HELP HERE', thePlayer, 193, 13, 13 ); outputChatBox ( 'ADMIN HELP HERE', thePlayer, 193, 13, 13 ); outputChatBox ( 'ADMIN HELP HERE', thePlayer, 193, 13, 13 ); outputChatBox ( 'ADMIN HELP HERE', thePlayer, 193, 13, 13 ); else outputChatBox ( 'Access denied!', thePlayer, 193, 13, 13 ) end end )
  4. Capaz que con shaders puedas hacer algo asi, pero yo ni idea.
  5. Ajam, entonces tenes que usar la funcion: isPedInVehicle.
  6. La funcion: "xd" no tiene sentido. Lo que vos queres es verificar si el jugador esta en un vehiculo?
  7. Ese script no tiene sentido, volve y pensa en que queres hacer y re-hacelo.
  8. GUIEditor_Image = {} tiendaDeArmas2 = guiCreateWindow(181,168,456,318,"Tienda de armas para expertos",false) botonComprarDeagle = guiCreateButton(15,106,99,26,"Comprar($2000)",false,tiendaDeArmas2) botonComprarShotg = guiCreateButton(121,106,99,26,"Comprar($3000)",false,tiendaDeArmas2) botonComprarMp5 = guiCreateButton(226,106,99,26,"Comprar($4000)",false,tiendaDeArmas2) botonComprarM4 = guiCreateButton(330,106,98,26,"Comprar($5000)",false,tiendaDeArmas2) botonComprarMunicDeagle = guiCreateButton(11,234,105,26,"Munic.x50($200)",false,tiendaDeArmas2) botonComprarMunicM4 = guiCreateButton(336,234,105,26,"Munic.x120($300)",false,tiendaDeArmas2) botonComprarMunicMp5 = guiCreateButton(228,234,105,26,"Munic.x90($300)",false,tiendaDeArmas2) botonComprarMunicShotg = guiCreateButton(120,234,105,26,"Munic.x30($100)",false,tiendaDeArmas2) municMp5Img = guiCreateStaticImage(248,154,68,73,"images/53.png",false,tiendaDeArmas2) municM4Img = guiCreateStaticImage(356,155,62,70,"images/55.png",false,tiendaDeArmas2) municDeagleImg = guiCreateStaticImage(35,157,64,71,"images/51.png",false,tiendaDeArmas2) municShotgImg = guiCreateStaticImage(141,154,66,72,"images/52.png",false,tiendaDeArmas2) imageDeagle = guiCreateStaticImage(35,38,63,61,"images/24.png",false,tiendaDeArmas2) imageM4 = guiCreateStaticImage(342,36,64,62,"images/31.png",false,tiendaDeArmas2) imageMp5 = guiCreateStaticImage(242,34,65,65,"images/29.png",false,tiendaDeArmas2) imageEscopeta = guiCreateStaticImage(138,37,65,62,"images/25.png",false,tiendaDeArmas2) Salir = guiCreateButton(362,279,70,25,"Salir",false,tiendaDeArmas2) guiWindowSetMovable(tiendaDeArmas2,false) guiWindowSetSizable(tiendaDeArmas2,false) guiSetVisible(tiendaDeArmas2,false) function mostrarTienda() guiSetVisible (tiendaDeArmas2,true) showCursor(true) end addEvent("mostrarTienda",true) addEventHandler("mostrarTienda",getRootElement(),mostrarTienda) function closeShop2() if guiGetVisible(tiendaDeArmas2) then guiSetVisible(tiendaDeArmas2,false) showCursor(false) end end addEventHandler ("onClientGUIClick", Salir, closeShop2, false) function darDeagle() local itemID = 24 local itemCost = 2000 local itemMunic = 100 triggerServerEvent ("comproDeagle", getLocalPlayer(), itemID, itemCost,itemMunic) end addEventHandler ("onClientGUIClick", botonComprarDeagle, darDeagle, false) function darShotg() local itemID = 25 local itemCost = 3000 local itemMunic = 50 triggerServerEvent ("comproShotgun", getLocalPlayer(), itemID, itemCost,itemMunic) end addEventHandler ("onClientGUIClick", botonComprarShotg, darShotg, false) function darMp5() local itemID = 29 local itemCost = 4000 local itemMunic = 90 triggerServerEvent ("comproMp5", getLocalPlayer(), itemID, itemCost,itemMunic) end addEventHandler ("onClientGUIClick", botonComprarMp5, darMp5, false) function darM4() local itemID = 31 local itemCost = 5000 local itemMunic = 120 triggerServerEvent ("comproM4", getLocalPlayer(), itemID, itemCost,itemMunic) end addEventHandler ("onClientGUIClick", botonComprarM4, darM4, false) function darMunicM4() local armaID = 31 local itemCost = 300 local itemMunic = 120 triggerServerEvent ("comproMunicionM4", getLocalPlayer(), armaID, itemCost,itemMunic) end addEventHandler ("onClientGUIClick", botonComprarMunicM4, darMunicM4, false) function darMunicMp5() local armaID = 29 local itemCost = 300 local itemMunic = 90 triggerServerEvent ("comproMunicionMp5", getLocalPlayer(), armaID, itemCost,itemMunic) end addEventHandler ("onClientGUIClick", botonComprarMunicMp5, darMunicMp5, false) function darMunicShotg() local armaID = 25 local itemCost = 100 local itemMunic = 30 triggerServerEvent ("comproMunicionShotg", getLocalPlayer(), armaID, itemCost,itemMunic) end addEventHandler ("onClientGUIClick", botonComprarMunicShotg, darMunicShotg, false) function darMunicDeagle() local armaID = 24 local itemCost = 200 local itemMunic = 50 triggerServerEvent ("comproMunicionDeagle", getLocalPlayer(), armaID, itemCost,itemMunic) end addEventHandler ("onClientGUIClick", botonComprarMunicDeagle, darMunicDeagle, false)
  9. Talvez esos vehiculos no existan, tenes que verificar si el elemento existe usando: isElement.
  10. Castillo

    Pls help me

    You're welcome.
  11. gate = createObject ( 2951, 3109.0913085938, -842.58416748047, 28.436388015747, 0, 0, 43.170013427734) marker = createMarker ( 3100.59448, -833.24823, 29.19611, "cylinder", 2.0, 255, 255, 255, 170) s2 = createBlip( 2920.76171875, -794.72790527344, 11.571973800659,23) function markerhit (hitPlayer) moveObject ( gate, 2200, 3109.0908203125, -842.63531494141, 24.53639793396) end addEventHandler ("onMarkerHit", marker, markerhit) function markerLeave( leaveElement, matchingDimension ) if getElementType( leaveElement ) == "player" then moveObject ( gate, 6000, 3109.0913085938, -842.58416748047, 28.436388015747) end end addEventHandler( "onMarkerLeave", marker, markerLeave )
  12. Talvez el modelo este mal hecho? podes intentar ponerle + 2 en el valor "z".
  13. You can use the function: setVehicleHandling.
  14. Que queres decir con "buggeado"?
  15. Para que cerrarlo? otro puede que tenga el mismo problema.
  16. You could set a ID to the trailer, e.g the player serial then get the element by the ID using: getElementByID.
  17. What you're trying to do is to check if the vehicle is far from the trailer, that means the trailer is no longer attached, so you'll have to check the trailer, you can't get the "attached" trailer because there isn't.
  18. Castillo

    Pls help me

    I suggest you to use the client animation library by arc_. --[[ Client animation library by arc_ Version 1.0.0 Licence ---------------- You are free to modify this file and redistribute it with your changes. However, always mention that you changed it (and eventually what changes you made) and keep the original author, version number and licence intact. Selling this script or a derivative of it is not allowed. Documentation ---------------- Terminology - Animation: a sequence of phases that act on one or more elements and follow each other sequentially in time. Multiple animations can be running at the same time. All defined animations run in parallel. An animation is in fact one phase with several subphases (see below), with animation specific functions available. - Phase: a part of an animation sequence. A phase consists of a paramater that linearly goes from a given starting value to a given ending value, over the specified amount of time, and is applied to one certain element. While a phase is running, its callback function will be called onClientRender with the following arguments: phase.fn(element elem, float param, table phase) Specifying time and callback function is optional. If no time is specified but a function is, phase.fn(elem) will be called once. If no function is specified but a time is, the phase consists of simply waiting during that time, doing nothing. A phase can be run once, repeated multiple times or loop infinitely. Phases can also contain phases. In that case the parent phase consists of completing all child phases, in order. This allows you to f.e. make an element move left and right continuously: define a phase for moving it to the left, followed by a phase for moving it back to the right, and encapsulate these two phases in a parent phase that loops forever. Phases can be nested to arbitrary depth. The element a subphase works on is inherited from its parent phase (or, if the parent phase doesn't specify an element, from the grandparent, etc). Definition of a phase A phase is simply a table containing properties and (optionally) subphases. Available phase properties are: (the values for the properties are examples, not default values) phase = { from = 0, -- the starting value of the parameter to = 1, -- the ending value of the parameter [time = 1000,] -- the time (in ms) in which to go from start to end [fn = callback,] -- the function to call on each frame update [repeats = 5,] -- how many times to run this phase before going on to -- the next. defaults to 1 [subphase1,] -- optional subphases. if one or more of these are included, [subphase2,] -- only the "repeats" property is valid for this parent phase ... } Available functions anim = Animation.create(elem, phase1, phase2, ...) Creates and returns a new animation. This means nothing more than creating a new phase, putting the specified phases in it as subphases, and making the functions of the Animation class available to it. Once an animation is created, it is not yet running. anim = Animation.createAndPlay(elem, phase1, phase2, ...) Creates a new animation and immediately starts playing it. anim = Animation.createNamed(name, elem, ...) If an animation with the specified name exists, returns that animation. Otherwise creates a new named animation. You can look the animation up again later with Animation.getNamed(name). anim = Animation.createNamedAndPlay(name, elem, ...) Self explanatory. anim = Animation.getNamed(name) Returns the animation with the specified name if it exists, false otherwise. anim:play() Start playing a newly created animation or resume a paused animation. anim:pause() Pauses the animation. Resume it later with anim:play() or delete it with anim:remove(). anim:remove() Deletes the animation completely. It can not be resumed anymore. anim:isPlaying() Returns true if the animation is currently playing, false if not. Animation.playingAnimationsExist() Returns true if there is any animation that is currently playing. anim:addPhase(phase3), phase2:addPhase(phase3) Appends a new subphase to the animation or phase. Can be done while the animation is playing. Note that to be able to use phase2:addPhase(), phase2 first has to be processed (default values filled in, made part of the Phase class) by being passed as an argument to Animation.create[AndPlay] or addPhase. Examples Fade in a picture: local pict = guiCreateStaticImage(...) Animation.createAndPlay(pict, { from = 0, to = 1, time = 2000, fn = guiSetAlpha }) Fade in a picture using a preset (for more presets, see the end of this file): local pict = guiCreateStaticImage(...) Animation.createAndPlay(pict, Animation.presets.guiFadeIn(2000)) Move a label to the right while fading it in: local label = guiCreateLabel(10, 100, 150, 20, 'Test', false) Animation.createAndPlay(label, Animation.presets.guiMove(200, 100, 2000)) Animation.createAndPlay(label, Animation.presets.guiFadeIn(2000)) Move a label left and right forever, without presets: function guiSetX(elem, x) local curX, curY = guiGetPosition(elem, false) guiSetPosition(elem, x, curY, false) end local label = guiCreateLabel(10, 100, 150, 20, 'Test', false) Animation.createAndPlay( label, { repeats = 0, { from = 10, to = 200, time = 2000, fn = guiSetX }, { from = 200, to = 10, time = 2000, fn = guiSetX } } ) ]]-- Phase = {} Phase.__index = Phase Animation = setmetatable({}, { __index = Phase }) Animation.__index = Animation Animation.collection = {} function Animation.create(elem, ...) local anim = setmetatable({ elem = elem, ... }, Animation) anim:_setup() return anim end function Animation.createAndPlay(elem, ...) local anim = Animation.create(elem, ...) anim:play() return anim end function Animation.createNamed(name, elem, ...) local anim = Animation.getNamed(name) or Animation.create(elem, ...) anim.name = name return anim end function Animation.createNamedAndPlay(name, elem, ...) local anim = Animation.createNamed(name, elem, ...) anim:play() return anim end function Animation.getNamed(name) local i, anim = table.find(Animation.collection, 'name', name) return i and anim end function Animation:isPlaying() return self.playing or false end function Animation.playingAnimationsExist() return table.find(Animation.collection, 'playing', true) and true end function Animation:play() if self.playing then return end if not table.find(Animation.collection, self) then table.insert(Animation.collection, self) end if not Animation.playingAnimationsExist() then addEventHandler('onClientRender', getRootElement(), updateAnim) end self.playing = true end function Animation:pause() self.playing = false if not Animation.playingAnimationsExist() then removeEventHandler('onClientRender', getRootElement(), updateAnim) end end function Animation:remove() table.removevalue(Animation.collection, self) if not Animation.playingAnimationsExist() then removeEventHandler('onClientRender', getRootElement(), updateAnim) end self.playing = false end function Phase:_setup(parent) self.parent = parent if self[1] then for i,phase in ipairs(self) do if type(phase) == 'function' then phase = { fn = phase } self[i] = phase end setmetatable(phase, Phase) phase:_setup(self) end self.curphase = 1 elseif self.time then self.from = self.from or 0 self.to = self.to or 1 self.speed = (self.to - self.from) / self.time end self.repeats = self.repeats
  19. That must be because you're using getVehicleTowedByVehicle, after you detach it, the function will return nothing, because you no longer have a trailer attached.
  20. Topic moved to Scripting section. --------------------------------------- What I understand is that your script is working together with a script that set's player health when crash, right? and for that you're using setElementHealth, but this function won't trigger onPlayerDamage event, so it'll never work this way. You have to check if the player has the seatbelt before setting his health instead. I've made your code a little easier: addEventHandler ( "onPlayerDamage", getRootElement ( ), function ( attacker, weapon, bodypart, loss ) if ( getElementData ( source, "seatbelt" ) ) then setElementHealth ( source, ( getElementHealth ( source ) + loss ) ) end end ) function toggleSeatbelt ( thePlayer ) local state = getElementData ( thePlayer, "seatbelt" ) local newState = ( not state ) outputChatBox ( newState and " puts on his seatbelt." or " takes off his seatbelt." ) setElementData ( thePlayer, "seatbelt", newState ) end addCommandHandler ( "seatbelt", toggleSeatbelt ) Instead of two commands you can do: "/seatbelt" and it'll put it on if it's off, else take it off.
  21. local randomSpawnTable = { { -2818.3, 1134.4, 26.1, 179.2 }, { -343.3, 1544.2, 75.5 }, { 2221.3, 1838.4, 10.8, 90.3 } } function randomSpawn ( thePlayer, skin ) local random = math.random ( #randomSpawnTable ) if spawnPlayer ( thePlayer, unpack ( randomSpawnTable [ random ] ) ) then setElementModel ( thePlayer, skin ) end end addEventHandler ( "onPlayerWasted", getRootElement( ), function ( ) local skin = getElementModel ( source ) local accountName = getAccountName ( getPlayerAccount ( source ) ) if isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Admin" ) ) then setTimer( spawnPlayer, 5000, 1, source, 2531.03, 2804.1, 11.1, 180, skin ) elseif isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Moderator" ) ) then setTimer( spawnPlayer, 5000, 1, source, -343.3, 1544.2, 75.5, 180, skin ) elseif isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Everyone" ) ) then setTimer( randomSpawn, 5000, 1, source, skin ) end end )
  22. Skid marks shader example: https://community.multitheftauto.com/index.php?p= ... ls&id=4439 Vehicle mod: https://community.multitheftauto.com/index.php?p= ... ls&id=4443
×
×
  • Create New...