Jump to content

xXMADEXx

Members
  • Posts

    2,718
  • Joined

  • Last visited

Everything posted by xXMADEXx

  1. xXMADEXx

    SOLVED

    You can try to use this script, but I didn't test it local files = { ["files/mydff.dff"] = { id=400, type="dff" }, ["files/mytxd.txd"] = { id=400, type="txd" }, } for i, v in pairs ( files ) do downloadFile ( i ) end addEventHandler ( "onClientFileDownloadComplete", root, function ( _, success ) if ( success ) then local allDone = true for i, v in pairs ( files ) do if ( not fileExists ( i ) ) then allDone = false break end end if ( allDone ) then for i, v in pairs( files ) do local v.type = tostring ( v.type ):lower ( ) if ( v.type == "dff" ) then local dff = engineLoadDFF ( i, 0 ) if ( not dff or not engineReplaceModel ( dff, v.id ) ) then outputDebugString ( "Failed to replace ".. tostring ( i ).. " (Loading file as .dff | Tryed to replace model "..tostring(v.id)..")" ) end elseif ( v.type == 'txd' ) then local txd = engineLoadTXD ( i ) if ( not txd or not engineImportTXD ( txd, v.id ) ) then outputDebugString ( "Failed to replace ".. tostring ( i ).. " (Loading file as .txd | Tryed to replace model "..tostring(v.id)..")" ) end else outputDebugString ( "Failed to replace ".. tostring ( i ).. " (Unknown type -> Allowed: txd, dff)" ) end end end end end )
  2. You can request it at http://mtamarket.com/contact.php?request
  3. We don't support leaked scripts.
  4. You just need to map it somewhere outside of SA.
  5. viewtopic.php?f=148&t=75501 (In the "variables" section) Only allows that variable or function be called in the block of code that it's in. local functions work the same way as local variables.
  6. You should use the dxDrawImage function. You can try using this code, but I didn't test it: local sWidth,sHeight = guiGetScreenSize() local Width,Height = 395,910 local X = (sWidth/2) - (Width/2) local Y = (sHeight/2) - (Height/2) local alpha = 255 local mode = "fade" local img = "img/login_bg.png" addEventHandler ( "onClientRender", root, function ( ) if ( mode == "fade" ) then if ( alpha <= 10 ) then img = "img/login_bgfinal.png" mode = "build" else alpha = alpha - 2 end else alpha = alpha + 2 if ( alpha > 255 ) then alpha = 255 end end dxDrawImage ( 0, 0, 1920, 1200, img, tocolor ( 255, 255, 255, alpha ) ) end )
  7. This script isn't even worth selling... Edit Thiz tok me 1 hur to mke, plis lik (Requires bone_attach) meta.xml: <meta> <info author="xXMADEXx" name="Breif Case" type="script" version="1.0" /> <script src="breif_shared.lua" type="shared" /> <script src="breif_c.lua" type="client" /> <script src="breif_s.lua" type="server" /> <oop>true</oop> </meta> breif_c.lua --[[Command.add ( "pos", function ( ) local x, y, z = getElementPosition ( localPlayer ) local str = table.concat ( { x, y, z }, ", " ) setClipboard ( str ); print ( str ); end )]] Breif = { vars = { marker = null, blip = null, dxAlpha = 0, dxCount = "up" }, onMarker = function ( p ) if ( p ~= localPlayer ) then return end Event.remove ( "onClientPickupHit", source, Breif.onMarker ) source:destroy ( ); Event.trigger ( "BreifCase:onPlayerWin!", p ) Breif.vars.dxAlpha = 0 Breif.vars.dxCount = "up" Event.add ( "onClientRender", root, Breif.onRender ) Breif.vars.blip:destroy( ); end , onRender = function ( ) dxDrawText ( "+ $2,000", 0, 0, sx, sy, tocolor ( 0, 255, 0, Breif.vars.dxAlpha ), 2, "pricedown", "center", "center") if ( Breif.vars.dxCount == "up" ) then if ( Breif.vars.dxAlpha >= 245 ) then Breif.vars.dxCount = "down" else Breif.vars.dxAlpha = Breif.vars.dxAlpha + 2 end else if ( Breif.vars.dxAlpha <= 10 ) then Event.remove ( "onClientRender", root, Breif.onRender ) else Breif.vars.dxAlpha = Breif.vars.dxAlpha - 2 end end end } Event.add_ ( "BreifCase:DestroyClientElements", true ) Event.add ( "BreifCase:DestroyClientElements", root, function ( ) if ( Breif.vars.marker and isElement ( Breif.vars.marker ) ) then Event.remove ( "onClientPickupHit", Breif.vars.marker, Breif.onMarker ) destroyElement( Breif.vars.marker ) Breif.vars.blip:destroy( ); end end ) Event.add_ ( "BreifCase:onClientPickup", true ) Event.add ( "BreifCase:onClientPickup", root, function ( pos ) if ( isElement ( Breif.vars.marker ) ) then Event.remove ( "onClientMarkerHit", Breif.vars.marker, Breif.onMarker ) destroyElement ( Breif.vars.marker ); Breif.vars.blip:destroy( ); end local x, y, z = unpack ( pos ) Breif.vars.marker = Marker.create ( x, y, z-1, "cylinder", 2, 255, 255, 0, 120 ) Breif.vars.blip = Blip.create ( x, y, z, 41 ) Event.add ( "onClientMarkerHit", Breif.vars.marker, Breif.onMarker ) end ) breif_s.lua Breif = { vars = { holder = null, element = null, object = null, goto = null, blip = null }, create = function ( ) local this = Breif this.remove ( ); local info = this.positions [ math.random ( #this.positions ) ] local x, y, z = unpack ( info.create ) Breif.vars.element = Pickup.create ( x, y, z, 3, 1210 ) Breif.vars.goto = info.goTo Breif.vars.blip = Blip.create ( x, y, z, 33 ) Event.add ( "onPickupHit", Breif.vars.element, this.onHit ) print ( "A breif case has been created in "..tostring(getZoneName(x,y,z))..", "..tostring(getZoneName(x,y,z,true)).."!", root, 0, 255, 0) end, remove = function ( ) local this = Breif if ( this.vars.element and isElement ( this.vars.element ) ) then destroyElement ( this.vars.element ) end Breif.vars.element = null Breif.vars.goto = null if ( this.vars.object and isElement ( this.vars.object ) ) then destroyElement ( this.vars.object ) end Breif.vars.object = null if ( this.vars.blip and isElement ( this.vars.blip ) ) then this.vars.blip:destroy ( ) end Breif.vars.blip = null if ( this.vars.holder and isElement ( this.vars.holder ) ) then Event.trigger ( this.vars.holder, "BreifCase:DestroyClientElements", this.vars.holder ) end Breif.vars.holder = null end, onHit = function ( p ) if ( not p or getElementType ( p ) ~= "player" ) then return end local this = Breif setTimer ( destroyElement, 500, 1, source ) Breif.vars.holder = p Breif.vars.object = Object.create ( 1210, 0, 0, 0 ) exports.bone_attach:attachElementToBone ( Breif.vars.object, p, 11, 0, 0, 0.3, 0, 180, 0 ) Event.remove ( "onPickupHit", source, Breif.onHit ) print ( p:getName ( ).." has got the breif case!", root, 255, 255, 0 ) Event.trigger ( p, "BreifCase:onClientPickup", p, Breif.vars.goto ) Breif.vars.blip:destroy ( ); end, triggerDrop = function ( ) local this = Breif if ( this.vars.holder ) then Event.trigger ( this.vars.holder, "BreifCase:DestroyClientElements", this.vars.holder ) local x, y, z = getElementPosition ( this.vars.holder ) if ( isElement ( Breif.vars.object ) ) then Breif.vars.object:destroy ( ); end if ( isElement ( Breif.vars.element ) ) then Breif.vars.element:destroy ( ) end Breif.vars.holder = null print ( "The breif case has been dropped in "..getZoneName(x,y,z)..", "..getZoneName(x,y,z,true), root, 255, 255, 0 ) Breif.vars.element = Pickup.create ( x, y, z, 3, 1210 ) Event.add ( "onPickupHit", Breif.vars.element, Breif.onHit ) Breif.vars.blip = Blip.create ( x, y, z, 33 ) end end, positions = { { create = { -708.50079345703, 962.47711181641, 12.477653503418 }, goTo = { -703.84838867188, 956.98223876953, 12.398029327393 } }, } } if ( not getResourceFromName ( "bone_attach" ) or getResourceState ( getResourceFromName ( "bone_attach" ) ) ~= "running" ) then return print ( "The "..getResourceName(getThisResource()).." resource requires bone_attach.", root, 255, 0, 0 ) end Event.add ( "onPlayerWasted", root, function ( ) local this = Breif if ( this.vars.holder and this.vars.holder == source ) then Breif.triggerDrop ( ); end end ) Event.add ( "onPlayerQuit", root, function ( ) local this = Breif if ( this.vars.holder and this.vars.holder == source ) then Breif.triggerDrop ( ); end end ) Event.add_ ( "BreifCase:onPlayerWin!", true ) Event.add ( "BreifCase:onPlayerWin!", root, function ( ) Breif.remove ( ); print ( source:getName ( ).." captured the breif case and got $2,000!", root, 0, 255, 0 ) source:giveMoney ( 2000 ); end ) Breif.create ( ); breif_shared.lua local function __isServer ( ) if ( _G['dbConnect'] ) then return true end return false end print = outputChatBox null = nil Command = { add = addCommandHandler, remove = removeCommandHandler, execute = executeCommandHandler } Event = { add_ = addEvent, add = addEventHandler, remove = removeEventHandler } if ( __isServer ( ) ) then Event.trigger = triggerClientEvent else Event.trigger = triggerServerEvent sx, sy = guiGetScreenSize ( ); end
  8. If the code is server side, then you'll need the following: triggerClientEvent addEvent -- client side addEventHandler -- client side and for the client side: playSound destroyElement -- potentially
  9. It's actually totally possible to make it in 1-2 weeks without bugs, that is if you know what you're doing... It's really not that hard.
  10. MTA doesn't support gif formats yet, if it ever will.
  11. local fontSize = 2 -- the original text size local dist = getDistanceBetweenPoints3D ( x, y, z, x1, y1, z1 ); -- Set the distance with getDistanceBetweenPoints3D\ local allowedDistance = 13; -- The max distance you can be to see the text local scale = fontSize * ( ( defdd - dist ) / defdd ) (Formula taken from the following resource) https://community.multitheftauto.com/index.php?p= ... ls&id=3090
  12. It could be one of your scripts causing this.
  13. https://community.multitheftauto.com/index.php?p= ... s&id=10014 - It was originally made by me Original: https://community.multitheftauto.com/index.php?p= ... ls&id=7970 DONE
  14. xXMADEXx

    Help SQL

    http://lmgtfy.com/?q=XAMPP+SQL+Setup
  15. Try reading this viewtopic.php?f=148&t=74970
  16. Did you use local to define the function?
  17. You find the location, you can just use this: addCommandHandler ( "spos", function ( p ) setElementPosition ( p, 1140.9, 1319.69, 12.6 ) end To get positions you can use this: https://community.multitheftauto.com/index.php?p= ... ls&id=6274
  18. xXMADEXx

    getPlayerIP

    It means, somewhere when getPlayerCountry it's sending a value that isn't equal to a player element.
  19. To create a rotating image, all you have to do is set a rotation variable and update it every render. local r = 0 addEventHandler ( "onClientRender", root, function ( ) dxDrawImage ( 0, 0, 100, 100 "myImgxD.png", r ); r = r + 1 if ( r >= 359 ) then r = 0 end end )
  20. This topic is like 9 months old.. You could have been like a Lua master by now if you really wanted to.
  21. Stop the admin resource, and then use addCommandHandler. You'll probably need these: getPlayerFromName killPed setElementHealth -- the super man resource on the community setElementFrozen isElementFrozen setPlayerMuted
  22. It'd be really amazing if MTA had multi-language support for scripting, although I highly doubt it would happen. And I do agree with you, C# would be a nice choice.
  23. It should take like 5 days most to script this, not 2 months.
×
×
  • Create New...