Jump to content

Search the Community

Showing results for tags 'scripting'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

  1. ..this is not the full code from my nametag: when i press 'T', the chaticon appear on everybody.. how to fix this? i want, when a player, or me press 'T', the ballon show just on the player, or on me, not on everyplayers... sorry for my terrible english .. :c
  2. Necesito ayuda por favor! Hola gente, soy algo nuevo en esto de crear scripts, y estoy intentando crear un script de zombies, mediante slothbot, y a esos "zombies" o bots, quiero cambiarles las animaciones al caminar. A ver si me explico mejor, estoy intentando crear bots mediante slothbot, los cuales deben estar destinados a seguir a los jugadores. Hasta ahí todo bien, no es algo tan complejo. Mi problema es el siguiente: ¿Cómo puedo hacer para cambiar la forma en la que caminan dichos bots? ¿Hay alguna forma de cambiar su animación al atacar/caminar? Gracias por su tiempo gente, un saludo grande!
  3. Hello I have a nametag script. And i have a chat-icon script too. But i want add the chat-icon thing to nametag script, above the player nametag. And do not appear for me, just another players. This is possible? If yes, how? Sorry for my bad english..
  4. This is the code: function onPlayerQuit ( thePlayer) local playeraccount = getPlayerAccount ( thePlayer ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local nametagszin = getPlayerNametagColor ( thePlayer ) setAccountData ( playeraccount, "ntszin", nametagszin ) end end end function onPlayerLogin (_, playeraccount ) local playeraccount = getPlayerAccount ( thePlayer ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then if ( playeraccount ) then local nametagszin = getAccountData ( playeraccount, "ntszin" ) if ( nametagszin ) then setPlayerNametagColor ( thePlayer, r, g, b ) end end end end addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) addEventHandler ( "onPlayerLogin", getRootElement ( ), onPlayerLogin ) No error(s)/warning(s) in debugscript 3.. What wrong?
  5. howdy, as the title says, you need to know how to modify a gamemode and some mapping so I mention that you do not need a gamemode from 0, as far as I know scripting on mta san andreas is "easy" but I do not have time to learn so I call someone who knows, you contact me through pm and we talk more, I need some proof that you know how to do something on the mta P.S I want a modified gamemode roleplay, that is new jobs added, factions and a few things on the map, no big thing sorry for my bad english, i m writing from my phone..
  6. Where can i download overdose effects with script for mta sa?
  7. i created a HUD with rectangles (bg rectangle, hp, armor...etc), and i want this make movable, so that move at the same time, but i don't know how to make this possible anyone can help? sorry for my bad english :c
  8. i want change the needle color if speed >= 240, but does not working how to fix this? what wrong? no error(s)/warning(s)
  9. i created a dx panel, and i created some onClientClick event for this panel. but when i hide the panel, the onClientClick events are working.. how to fix this?
  10. I want convert Vice City map to my server, it is possible somehow?
  11. Hello! I have small script that replaces texture with image using shader and scrolls it from left to right. But i would like that there would be more images scrolling, example: coca cola ad, mcdonalds ad, etc... Would it be possible? I'm quite bad with shaders.. Shader: // // Example shader - uv_scroll.fx // /////////////////////////////////////////////////////////////////////////////// //Global variables /////////////////////////////////////////////////////////////////////////////// float gTime : TIME; /////////////////////////////////////////////////////////////////////////////// // Functions /////////////////////////////////////////////////////////////////////////////// //------------------------------------------- // Returns UV anim transform //------------------------------------------- float3x3 getTextureTransform () { float posU = -fmod( gTime/8 ,1 ); // Scroll Right float posV = 0; return float3x3( 1, 0, 0, 0, 1, 0, posU, posV, 1 ); } /////////////////////////////////////////////////////////////////////////////// // Techniques /////////////////////////////////////////////////////////////////////////////// texture Tex0; technique simple { pass P0 { Texture[0] = Tex0; // Set the UV thingy TextureTransform[0] = getTextureTransform (); // Enable UV thingy TextureTransformFlags[0] = Count2; } } Client-sided script: shader = dxCreateShader("shader.fx") coce = dxCreateTexture("bobo_3.png") dxSetShaderValue(shader, "Tex0", coce) engineApplyShaderToWorldTexture( shader, "buymorejeans")
  12. Hello. I want create a dx timer which when the player disconnect, and connect again to the server then not reset the timer. Sorry for my bad english :c
  13. I want to force the player to run and aim at the same time with machine guns. (M4, AK47)
  14. function ccv (thePlayer) local accountname = getAccountName (getPlayerAccount(thePlayer)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then setTimer(function() ve1 = createVehicle ( 535, -2220.98706, -129.69173, 35.32031 ) ma1 = createMarker ( -2221.09668, -129.61031, 33.88103, "cylinder", 7.5, 255, 255, 0, 5 ) end, 1000, 1) end end addCommandHandler("ccvp", ccv) function marker1() destroyElement(ve1) destroyElement(ma1) end addEventHandler( "onMarkerHit", ma1, marker1) when i walk into the marker, nothing happens
  15. Hello! I'm creating a character selector using MySQL and I have some troubles. I use this to get the account players: local accData = singleQuery("SELECT * FROM players WHERE account=? LIMIT 3",string.lower(account)) for i=3,1,-1 do if(accData.username) then outputChatBox(accData.username,source,255,0,0, true) -- used to check results end end I'm using simple MySQL functions, these is the singleQuery function: function singleQuery(str,...) if (connection) then local query = dbQuery(connection,str,...) local result = dbPoll(query,-1) if (type(result == "table")) then return result[1] else return result end else return false end end It's normal that these function returns only one result. What I want is to list all of the results. If I have 4, i want to do a for loop with the 4 results. Anyone knows how I can modify this function to make another one called, for example, multipleQuery(str,..)? I don't know if it's possible to do something like "accData[1]" for character 1, "accData[2]" for character 2, etc.. Thanks!
  16. I have seen that some servers have video in download screen. How to do that? Some tips? something do start with?
  17. I downloaded this script ( https://community.multitheftauto.com/index.php?p=resources&s=details&id=12899 ) from the community. But i want make this only available for admins. How to make this? (Sorry for my very bad english:/)
  18. Working on a First Person Shooter gamemode, and i found a bug. The event onClientPreRender causes some delay at attachElements. Can somebody reproduce attachElements maths for me?
  19. i have this played time script: and i want add to this a command, which the admins can add more hours for anyone, how to make this command??
  20. Me ayudan con este pequeño problema?, es un error que me tira estas lineas cuando me acerco a una tent (tienda de campaña) if getElementData(source,"vehicle") then if not getElementData(source,"deadVehicle") then showClientMenuItem("Vehicle",(getVehicleName(getElementData(source,"parent")) or "Tienda de Campaña"),getElementData(source,"parent")) -- ERROR AQUI setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",true) setElementData(getLocalPlayer(),"lootname","Gear ("..(getVehicleName(getElementData(source,"parent")) or "Tienda de Campaña")..")") -- ERROR AQUI setNewbieInfo(true,"Equipo","Presiona J para acceder al inventario!",source) return end end Los errores son: Bad argument @ getvehiclename....
  21. code: addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() exports [ "scoreboard" ]:addScoreboardColumn ( "Jármű:", 3 ) end ) setTimer ( function ( ) local players = getElementsByType "player" for k, v in ipairs ( players ) do if ( isPedInVehicle(v) ) then local vehicle = getPedOccupiedVehicle(v) local carname = getVehicleName(vehicle) setElementData ( v, "Jármű:", tostring(carname) ) else setElementData ( v, "Jármű:", "Nincs") end end end, 2500, 0 ) and i get this error: ERROR: Loading script failed: xy/xy.lua:1: unexpected symbol near '?' how to fix this?
  22. Hi, the problem in race gamemode is when i have money, and start a new map, the money will reset to 0. How to fix this irritating problem?
  23. Hello! sorry for the inconvenience again, could anyone guide me or give me a code to be able to "project" or "show" the local player model in a GUI? I try to get an inventory like PUBG, but I still can not figure out how to link a specific weapon number. I also have the problem that when the ammunition of a weapon is just automatically reloaded, and when the ammunition reserve is finished it also "erases" the player's weapon.
  24. Alguién me ayuda a solucionar el NETWORK TROUBLE?... =( Siempre que refrescan los items me da un lagaso... local h1,h2,h3 = debug.gethook() debug.sethook() timetorefresh = math.random(2700000,3600000) local itemTable = { farm = { { "Madera", 1463, 0.4, 0, 13 }, { "Vendaje", 1578, 0.5, 0, 4 }, { "Cantimplora de Agua LLena", 2683, 1, 0, 6 }, { "Lata de Pasta", 2770, 1, 0, 6 }, { "Lata de Judías", 2601, 1, 0, 6 }, { "Hamburguesa", 2768, 1, 0, 6 }, { "Latas Vacías", 2673, 0.5, 0, 12 }, { "Basura", 2675, 0.5, 0, 12 }, { "British Assault Pack", 2406, 1, 0, 2.5 -- }, -- { -- "Patrol Pack", -- 2407, -- 1, -- 0, -- 3.5 }, { "Vest Pouch Pack", 2408, 1, 0, 2.2 }, { "Coca Cola", 2647, 1, 0, 9 }, { "Bidón de Gasolina Vacío", 1650, 1, 0, 10 }, { "Cuchillo", 335, 1, 90, 4 }, { "Caja de Cerillas", 328, 0.4, 90, 8 }, { "Revólver", 348, 1, 90, 0.2 }, { "Morfina", 1579, 1, 0, 4 }, { "Tienda de Campaña", 1279, 1, 0, 0.5 }, { "Makarov PM", 346, 1, 90, 4 }, { "Analgésico", 2709, 3, 0, 3.5 }, { "M14 AIM", 357, 1, 90, 0.3 }, { "Remington 870", 349, 1, 90, 0.3 }, { "Rueda", 1073, 1, 0, 2 }, { "Depósito", 1008, 1, 0.8, 2 -- }, -- { -- "Civilian Clothing", -- 1241, -- 2, -- 0, -- 2.5 -- }, -- { -- "Civilian[F] Clothing", -- 1241, -- 2, -- 0, -- 2.5 -- }, -- { -- "Survivor[F] Clothing", -- 1241, -- 2, -- 0, -- 2.5 }, { "Mapa", 1277, 0.8, 90, 6 }, { "GPS", 2976, 0.15, 0, 2 } }, residential = { { "Caja de Cerillas", 328, 0.4, 90, 5 }, { "Madera", 1463, 0.4, 0, 5 -- }, -- { -- "Civilian[F] Clothing", -- 1241, -- 2, -- 0, -- 2.5 -- }, -- { -- "Survivor[F] Clothing", -- 1241, -- 2, -- 0, -- 2.5 }, { "Makarov PM", 346, 1, 90, 1.5 }, { "British Assault Pack", 2406, 1, 0, 1.5 -- }, -- { -- "Patrol Pack", -- 2407, -- 1, -- 0, -- 1.5 }, { "Vest Pouch Pack", 2408, 1, 0, 1.2 }, { "M9 SD", 347, 1, 90, 1.9 }, { "Remington 870", 349, 1, 90, 0.1 }, { "PDW", 352, 1, 90, 1 }, { "Cuchillo", 335, 1, 90, 3 }, { "Hacha", 339, 1, 90, 1 }, { "Pizza", 1582, 1, 0, 7 }, { "Coca Cola", 2647, 1, 0, 7 }, { "Bidón de Gasolina Vacío", 1650, 1, 0, 9 }, { "Bengala", 324, 1, 90, 9 }, { "Leche", 2856, 1, 0, 7 }, { "Assault Pack (ACU)", 3026, 1, 0, 4 }, { "Analgésico", 2709, 3, 0, 7 }, { "Latas Vacías", 2673, 0.5, 0, 12 }, { "Basura", 2675, 0.5, 0, 12 }, { "Granada", 342, 1, 0, 0.01 }, { "Revólver", 348, 1, 90, 0.4 }, { "Escopeta Recortada", 350, 1, 90, 0.3 }, { "SPAZ-12 Combat Shotgun", 351, 1, 90, 0.4 }, { "MP5A5", 353, 1, 90, 0.4 }, { "Reloj", 2710, 1, 0, 3 }, { "Bolsa Térmica", 1576, 5, 0, 6 }, { "Alambrada", 933, 0.25, 0, 1 }, { "M14 AIM", 357, 1, 90, 0.3 }, { "Alice Pack", 1248, 1, 0, 1.5 }, { "Rueda", 1073, 1, 0, 1 }, { "Depósito", 1008, 0.8, 0, 1 }, { "Morfina", 1579, 1, 0, 2 -- }, -- { -- "Civilian Clothing", -- 1241, -- 2, -- 0, -- 9 }, { "Mapa", 1277, 0.8, 90, 10 }, { "GPS", 2976, 0.15, 0, 3 }, { "Lata de Pasta", 2770, 1, 0, 7 }, { "Lata de Judías", 2601, 1, 0, 7 }, { "Hamburguesa", 2768, 1, 0, 7 }, { "Palo de Golf", 333, 1, 90, 3 }, { "Bate", 336, 1, 90, 3 }, { "Pala", 337, 1, 90, 3 } }, military = { { "Caja de Cerillas", 328, 0.4, 90, 2 }, { "Makarov PM", 346, 1, 90, 5 }, { "M9 SD", 347, 1, 90, 4 }, { "Remington 870", 349, 1, 90, 3 }, { "PDW", 352, 1, 90, 4 }, { "Cuchillo", 335, 1, 90, 2.4 }, { "Hacha", 339, 1, 90, 2.1 }, { "Pizza", 1582, 1, 0, 2 }, { "Coca Cola", 2647, 1, 0, 2 }, { "Bidón de Gasolina Vacío", 1650, 1, 0, 4 }, { "Bengala", 324, 1, 90, 4 }, { "Leche", 2856, 1, 0, 1 }, { "Analgésico", 2709, 3, 0, 4 }, { "Latas Vacías", 2673, 0.5, 0, 12 }, { "Basura", 2675, 0.5, 0, 12 }, { "Granada", 342, 1, 0, 0.5 }, { "Escopeta Recortada", 350, 1, 90, 2.3 }, { "SPAZ-12 Combat Shotgun", 351, 1, 90, 2.3 }, { "MP5A5", 353, 1, 90, 2.8 }, { "Reloj", 2710, 1, 0, 4 }, { "Bolsa Térmica", 1576, 5, 0, 3 }, { "Alambrada", 933, 0.25, 0, 1 }, { "M14 AIM", 357, 1, 90, 3.5 }, { "Alice Pack", 1248, 1, 0, 4 }, { "Visión Nocturna", 368, 1, 90, 4 }, { "Prismáticos", 369, 1, 0, 4 }, { "Rueda", 1073, 1, 0, 2 }, { "Depósito", 1008, 0.8, 0, 2 }, { "Morfina", 1579, 1, 0, 4 -- }, -- { -- "Camouflage Clothing", -- 1247, -- 2, -- 0, -- 4.5 -- }, -- { -- "Civilian Clothing", -- 1241, -- 2, -- 0, -- 3 }, { "AKS-74 Kobra", 355, 1, 90, 3.8 }, { "GPS", 2976, 0.15, 0, 3 }, { "Mapa", 1277, 0.8, 90, 7 }, { "Caja de Herramientas", 2969, 0.5, 0, 1 }, { "Motor", 929, 0.3, 0, 2 }, { "Tienda de Campaña", 1279, 1, 0, 4.5 -- }, -- { -- "Ghillie Suit", -- 1213, -- 2, -- 0, -- 0.3 -- }, -- { -- "Ghillie[F] Suit", -- 1213, -- 2, -- 0, -- 0.4 }, { "M4A3 CCO", 356, 1, 90, 2.4 }, { "CZ 550", 358, 1, 90, 0.4 }, { "Visión Térmica", 369, 1, 90, 3 }, { "Assault Pack (ACU)", 3026, 1, 0, 5 }, { "Czech Backpack", 2472, 1, 0, 2 }, { "Dispositivo de Radio", 330, 1, 0, 6 }, { "Coyote Backpack", 1575, 1, 0, 0.9 }, { "CMRA Backpack", 2405, -- ID DO OBJETO QUE IRÁ FICAR NAS COSTAS, E O QUE NÓS IREMOS SUBISTITUIR PELA BACKPACK 1, 0, 5 -- NIVEL DE RARIDADE DA BACKPACK }, { "Army Backpack", 2404, -- ID DO OBJETO QUE IRÁ FICAR NAS COSTAS, E O QUE NÓS IREMOS SUBISTITUIR PELA BACKPACK 1, 0, 5 -- NIVEL DE RARIDADE DA BACKPACK -- }, -- { -- "Civilian[F] Clothing", -- 1241, -- 2, -- 0, -- 2.5 -- }, -- { -- "Survivor[F] Clothing", -- 1241, -- 2, -- 0, -- 2.5 }, { "Pala", 337, 1, 90, 1 } }, industrial = { { "Alambrada", 933, 0.25, 0, 7 }, { "Caja de Herramientas", 2969, 0.5, 0, 3 }, { "Rueda", 1073, 1, 0, 4 }, { "Motor", 929, 0.3, 0, 3.5 }, { "Depósito", 1008, 1, 0.8, 4 }, { "Remington 870", 349, 1, 90, 3 }, { "Cantimplora de Agua LLena", 2683, 1, 0, 4 }, { "Lata de Pasta", 2770, 1, 0, 4 }, { "Lata de Judías", 2601, 1, 0, 4 }, { "Hamburguesa", 2768, 1, 0, 4 }, { "Latas Vacías", 2673, 0.5, 0, 12 }, { "Basura", 2675, 0.5, 0, 10 }, { "Coca Cola", 2647, 1, 0, 4 }, { "Bidón de Gasolina Vacío", 1650, 1, 0, 6 }, { "Bidón de Gasolina LLeno", 1650, 1, 0, 1.5 }, { "Mapa", 1277, 0.8, 90, 3 }, { "Reloj", 2710, 1, 0, 2 }, { "Caja de Cerillas", 328, 0.4, 90, 5 }, { "Madera", 1463, 0.4, 0, 2 }, { "Makarov PM", 346, 1, 90, 1.5 }, { "PDW", 352, 1, 90, 2 }, { "Cuchillo", 335, 1, 90, 2 }, { "British Assault Pack", 2406, 1, 0, 2.5 -- }, -- { -- "Patrol Pack", -- 2407, -- 1, -- 0, -- 3.5 }, { "Vest Pouch Pack", 2408, 1, 0, 5.2 }, { "Hacha", 339, 1, 90, 1.5 }, { "Pizza", 1582, 1, 0, 4 }, { "Bengala", 324, 1, 90, 5 }, { "Leche", 2856, 1, 0, 4 }, { "Assault Pack (ACU)", 3026, 1, 0, 6 }, { "Coyote Backpack", 1575, 1, 0, 0.5 }, { "Dispositivo de Radio", 330, 1, 0, 6 }, { "Palo de Golf", 333, 1, 90, 1.5 }, { "Bate", 336, 1, 90, 1.5 }, { "Pala", 337, 1, 90, 1.5 -- }, -- { -- "Civilian[F] Clothing", -- 1241, -- 2, -- 0, -- 2.5 -- }, -- { -- "Survivor[F] Clothing", -- 1241, -- 2, -- 0, -- 2.5 }, { "Visión Nocturna", 368, 1, 90, 1.5 } }, supermarket = { { "Carne Cruda", 2804, 0.5, 90, 8 }, { "Caja de Cerillas", 328, 0.4, 90, 5 }, { "Madera", 1463, 0.4, 0, 5 }, { "Makarov PM", 346, 1, 90, 3.5 }, { "PDW", 352, 1, 90, 2 }, { "Cuchillo", 335, 1, 90, 3 }, { "Hacha", 339, 1, 90, 2.1 }, { "Pizza", 1582, 1, 0, 7 }, { "Coca Cola", 2647, 1, 0, 7 }, { "Bidón de Gasolina Vacío", 1650, 1, 0, 5 }, { "Bengala", 324, 1, 90, 6 }, { "Leche", 2856, 1, 0, 7 }, { "Assault Pack (ACU)", 3026, 1, 0, 6 }, { "Lata de Pasta", 2770, 1, 0, 7 }, { "Lata de Judías", 2601, 1, 0, 7 }, { "Hamburguesa", 2768, 1, 0, 7 }, { "Analgésico", 2709, 3, 0, 7 }, { "Latas Vacías", 2673, 0.5, 0, 12 }, { "Basura", 2675, 0.5, 0, 12 }, { "MP5A5", 353, 1, 90, 0.5 }, { "Reloj", 2710, 1, 0, 3 }, { "Bolsa Térmica", 1576, 5, 0, 6 }, { "Alambrada", 933, 0.25, 0, 1 }, { "M14 AIM", 357, 1, 90, 0.2 }, { "Alice Pack", 1248, 1, 0, 0.5 }, { "Rueda", 1073, 1, 0, 1 }, { "Depósito", 1008, 1, 0.8, 2 }, { "Morfina", 1579, 1, 0, 2 -- }, -- { -- "Civilian Clothing", -- 1241, -- 2, -- 0, -- 3.5 }, { "Mapa", 1277, 0.8, 90, 4 }, { "GPS", 2976, 0.15, 0, 1 }, { "Dispositivo de Radio", 330, 1, 0, 6 }, { "Palo de Golf", 333, 1, 90, 1.9 }, { "Bate", 336, 1, 90, 1.4 -- }, -- { -- "Civilian[F] Clothing", -- 1241, -- 2, -- 0, -- 2.5 -- }, -- { -- "Survivor[F] Clothing", -- 1241, -- 2, -- 0, -- 2.5 }, { "Pala", 337, 1, 90, 0.3 } }, other = { { "Carne Cruda", 2804, 0.5, 90 }, { "Carne Cocinada", 2806, 0.5, 90 }, { "Bidón de Gasolina LLeno", 1650, 1, 0 }, { "Cantimplora de Agua Vacía", 2683, 1, 0 -- }, -- { -- "Survivor Clothing", -- 1577, -- 2, -- 0 }, { "Visión Nocturna", 368, 1, 90 }, { "Visión Térmica", 369, 1, 90 }, { "Remington 870 Cartuchos", 2358, 2, 0 }, { "Esc. Recortada Cartuchos", 2358, 2, 0 }, { "SPAZ-12 Pellet", 2358, 2, 0 }, { "MP5A5 Mag", 2358, 2, 0 }, { "30Rnd. AK", 1271, 2, 0 }, { "30Rnd. STANAG", 1271, 2, 0 }, { "Makarov Mun.", 3013, 2, 0 }, { "M9SD Mun.", 3013, 2, 0 }, { ".45 ACP", 3013, 2, 0 }, { "CZ 550 Mag", 2358, 2, 0 }, { "DMR Mun.", 2358, 2, 0 }, { "PDW Mag", 2041, 2, 0 }, { "MP5A5 Mag", 2041, 2, 0 }, { "Caja de Cerillas", 328, 0.4, 90, 5 }, { "Madera", 1463, 0.4, 0, 5 }, { "Makarov PM", 346, 1, 90, 3.5 }, { "PDW", 352, 1, 90, 2 }, { "Cuchillo", 335, 1, 90, 2.5 }, { "Hacha", 339, 1, 90, 1.8 }, { "Pizza", 1582, 1, 0, 7 }, { "Coca Cola", 2647, 1, 0, 7 }, { "Bidón de Gasolina Vacío", 1650, 1, 0, 5 }, { "Bengala", 324, 1, 90, 6 }, { "Leche", 2856, 1, 0, 5 }, { "Assault Pack (ACU)", 3026, 1, 0, 6 }, { "Analgésico", 2709, 3, 0, 7 }, { "Latas Vacías", 2673, 0.5, 0, 12 }, { "Basura", 2675, 0.5, 0, 12 }, { "MP5A5", 353, 1, 90, 1.5 }, { "Reloj", 2710, 1, 0, 3 }, { "Bolsa Térmica", 1576, 5, 0, 6 }, { "Alambrada", 933, 0.25, 0, 1 }, { "M14 AIM", 357, 1, 90, 1.5 }, { "Alice Pack", 1248, 1, 0, 1.5 }, { "Coyote Backpack", 1575, 1, 0, 0.7 }, { "Rueda", 1073, 1, 0, 1 }, { "Depósito", 1008, 1, 0.8, 4 }, { "Morfina", 1579, 1, 0, 2 -- }, -- { -- "Civilian Clothing", -- 1241, -- 2, -- 0, -- 3.5 }, { "Mapa", 1277, 0.8, 90, 4 }, { "Caja de Herramientas", 2969, 0.5, 0, 3 }, { "Motor", 929, 0.3, 0, 3.5 }, { "Remington 870", 349, 1, 90, 2 }, { "Cantimplora de Agua LLena", 2683, 1, 0, 4 }, { "M9 SD", 347, 1, 90, 5 }, { "Granada", 342, 1, 0, 0.5 }, { "Escopeta Recortada", 350, 1, 90, 2 }, { "SPAZ-12 Combat Shotgun", 351, 1, 90, 1.9 }, { "Prismáticos", 369, 1, 0, 4 -- }, -- { -- "Camouflage Clothing", -- 1247, -- 2, -- 0, -- 4.5 }, { "AKS-74 Kobra", 355, 1, 90, 0.9 }, { "M136 Rocket Launcher", 359, 1, 90, 0 -- }, -- { -- "Ghillie Suit", -- 1213, -- 2, -- 0, -- 0.01 }, { "M4A3 CCO", 356, 1, 90, 0.9 }, { "CZ 550", 358, 1, 90, 0.3 }, { "Heat-Seeking RPG", 360, 1, 90, 0 }, { "Vendaje", 1578, 0.5, 0, 4 }, { "Lata de Pasta", 2770, 1, 0, 5 }, { "Lata de Judías", 2601, 1, 0, 6 }, { "Hamburguesa", 2768, 1, 0, 2 }, { "Tienda de Campaña", 1279, 1, 0, 0.5 }, { "Makarov PM", 346, 1, 90, 3 }, { "Revólver", 348, 1, 90, 3 }, { "GPS", 2976, 0.15, 0, 1 }, { "Kit Médico", 2891, 2.2, 0 }, { "Bolsa de Sangre", 1580, 1, 0 }, { "Dispositivo de Radio", 2966, 0.5, 0, 5 }, { "Palo de Golf", 333, 1, 90, 1.9 }, { "Bate", 336, 1, 90, 1.4 }, { "British Assault Pack", 2406, 1, 0, 2.5 -- }, -- { -- "Patrol Pack", -- 2407, -- 1, -- 0, -- 3.5 }, { "Vest Pouch Pack", 2408, 1, 0, 5.2 -- }, -- { -- "Civilian[F] Clothing", -- 1241, -- 2, -- 0, -- 3.5 -- }, -- { -- "Ghillie[F] Suit", -- 1241, -- 2, -- 0, -- 2.5 -- }, -- { -- "Survivor[F] Clothing", -- 1241, -- 2, -- 0, -- 3.5 }, { "Pala", 337, 1, 90, 1.5 } } } weaponAmmoTable = { ["Makarov Mun."] = { {"Makarov PM", 22} }, ["M9SD Mun."] = { {"M9 SD", 23} }, [".45 ACP"] = { { "Revólver", 24 } }, ["PDW Mag"] = { {"PDW", 28} }, ["MP5A5 Mag"] = { {"MP5A5", 29} }, ["30Rnd. AK"] = { {"AKS-74 Kobra", 30} }, ["30Rnd. STANAG"] = { {"M4A3 CCO", 31} }, ["Remington 870 Cartuchos"] = { { "Remington 870", 25 } }, ["Esc. Recortada Cartuchos"] = { { "Escopeta Recortada", 26 } }, ["SPAZ-12 Pellet"] = { { "SPAZ-12 Combat Shotgun", 27 } }, ["CZ 550 Mag"] = { {"CZ 550", 34} }, ["DMR Mun."] = { { "M14 AIM", 33 } }, ["M136 Rocket"] = { { "Heat-Seeking RPG", 36 }, { "M136 Rocket Launcher", 35 } }, ["others"] = { {"Paracaídas", 46}, {"Satchel", 39}, {"Bomba de Humo", 17}, {"Granada", 16}, { "Cuchillo", 4 }, {"Hacha", 8}, {"Prismáticos", 43}, { "Bate", 5 }, {"Palo de Golf", 2}, {"Pala", 6}, { "Dispositivo de Radio", 1 } } } function getWeaponAmmoType(weaponName, notOthers) if not notOthers then for i, weaponData in ipairs(weaponAmmoTable.others) do if weaponName == weaponData[1] then return weaponData[1], weaponData[2] end end end for i, weaponData in ipairs(weaponAmmoTable["Makarov Mun."]) do if weaponName == weaponData[1] then return "Makarov Mun.", weaponData[2] end end for i, weaponData in ipairs(weaponAmmoTable["M9SD Mun."]) do if weaponName == weaponData[1] then return "M9SD Mun.", weaponData[2] end end for i, weaponData in ipairs(weaponAmmoTable[".45 ACP"]) do if weaponName == weaponData[1] then return ".45 ACP", weaponData[2] end end for i, weaponData in ipairs(weaponAmmoTable["PDW Mag"]) do if weaponName == weaponData[1] then return "PDW Mag", weaponData[2] end end for i, weaponData in ipairs(weaponAmmoTable["MP5A5 Mag"]) do if weaponName == weaponData[1] then return "MP5A5 Mag", weaponData[2] end end for i, weaponData in ipairs(weaponAmmoTable["30Rnd. AK"]) do if weaponName == weaponData[1] then return "30Rnd. AK", weaponData[2] end end for i, weaponData in ipairs(weaponAmmoTable["30Rnd. STANAG"]) do if weaponName == weaponData[1] then return "30Rnd. STANAG", weaponData[2] end end for i, weaponData in ipairs(weaponAmmoTable["Remington 870 Cartuchos"]) do if weaponName == weaponData[1] then return "Remington 870 Cartuchos", weaponData[2] end end for i, weaponData in ipairs(weaponAmmoTable["Esc. Recortada Cartuchos"]) do if weaponName == weaponData[1] then return "Esc. Recortada Cartuchos", weaponData[2] end end for i, weaponData in ipairs(weaponAmmoTable["SPAZ-12 Pellet"]) do if weaponName == weaponData[1] then return "SPAZ-12 Pellet", weaponData[2] end end for i, weaponData in ipairs(weaponAmmoTable["CZ 550 Mag"]) do if weaponName == weaponData[1] then return "CZ 550 Mag", weaponData[2] end end for i, weaponData in ipairs(weaponAmmoTable["DMR Mun."]) do if weaponName == weaponData[1] then return "DMR Mun.", weaponData[2] end end for i, weaponData in ipairs(weaponAmmoTable["M136 Rocket"]) do if weaponName == weaponData[1] then return "M136 Rocket", weaponData[2] end end return false end function createItemPickup(item, x, y, z, tableStringName) if item and x and y and z then do local object = createObject(itemTable[tostring(tableStringName)][item][2], x, y, z - 0.875, itemTable[tostring(tableStringName)][item][4], 0, math.random(0, 360)) setObjectScale(object, itemTable[tostring(tableStringName)][item][3]) setElementCollisionsEnabled(object, false) setElementFrozen(object, true) local col = createColSphere(x, y, z, 0.75) setElementData(col, "item", itemTable[tostring(tableStringName)][item][1]) setElementData(col, "parent", object) setTimer(function() if isElement(col) then destroyElement(col) destroyElement(object) end end, 900000, 1) return object end end end function table.size(tab) local length = 0 for _ in pairs(tab) do length = length + 1 end return length end function math.percentChance(percent, repeatTime) local hits = 0 for i = 1, repeatTime do local number = math.random(0, 200) / 2 if percent >= number then hits = hits + 1 end end return hits end function createItemLoot(lootPlace, x, y, z, id) col = createColSphere(x, y, z, 1.25) setElementData(col, "itemloot", true) setElementData(col, "parent", lootPlace) setElementData(col, "MAX_Slots", 12) for i, item in ipairs(itemTable[lootPlace]) do local value = math.percentChance(item[5], math.random(1, 2)) setElementData(col, item[1], value) local ammoData, weapID = getWeaponAmmoType(item[1], true) if ammoData and value > 0 then setElementData(col, ammoData, math.random(1, 2)) end end refre:~emLoot(col, lootPlace) return col end function refre:~emLoot(col, place) local objects = getElementData(col, "objectsINloot") if objects then if objects[1] ~= nil then destroyElement(objects[1]) end if objects[2] ~= nil then destroyElement(objects[2]) end if objects[3] ~= nil then destroyElement(objects[3]) end end local counter = 0 local obejctItem = {} for i, item in ipairs(itemTable.other) do if getElementData(col, item[1]) and getElementData(col, item[1]) > 0 then if counter == 3 then break end counter = counter + 1 local x, y, z = getElementPosition(col) obejctItem[counter] = createObject(item[2], x + math.random(-1, 1), y + math.random(-1, 1), z - 0.875, item[4]) setObjectScale(obejctItem[counter], item[3]) setElementCollisionsEnabled(obejctItem[counter], false) setElementFrozen(obejctItem[counter], true) end end if obejctItem[1] == nil then local x, y, z = getElementPosition(col) obejctItem[1] = createObject(1463, x + math.random(-1, 1), y + math.random(-1, 1), z - 0.875, 0) setObjectScale(obejctItem[1], 0) setElementCollisionsEnabled(obejctItem[1], false) setElementFrozen(obejctItem[1], true) end if obejctItem[2] == nil then local x, y, z = getElementPosition(col) obejctItem[2] = createObject(1463, x + math.random(-1, 1), y + math.random(-1, 1), z - 0.875, 0) setObjectScale(obejctItem[2], 0) setElementCollisionsEnabled(obejctItem[2], false) setElementFrozen(obejctItem[2], true) end if obejctItem[3] == nil then local x, y, z = getElementPosition(col) obejctItem[3] = createObject(1463, x + math.random(-1, 1), y + math.random(-1, 1), z - 0.875, 0) setObjectScale(obejctItem[3], 0) setElementCollisionsEnabled(obejctItem[3], false) setElementFrozen(obejctItem[3], true) end setElementData(col, "objectsINloot", { obejctItem[1], obejctItem[2], obejctItem[3] }) end addEvent("refre:~emLoot", true) addEventHandler("refre:~emLoot", getRootElement(), refre:~emLoot) function createPickupsOnServerStart() iPickup = 0 for i, pos in ipairs(pickupPositions.residential) do iPickup = iPickup + 1 createItemLoot("residential", pos[1], pos[2], pos[3], iPickup) end setTimer(createPickupsOnServerStart2, 5000, 1) end function createPickupsOnServerStart2() for i, pos in ipairs(pickupPositions.industrial) do iPickup = iPickup + 1 createItemLoot("industrial", pos[1], pos[2], pos[3], iPickup) end setTimer(createPickupsOnServerStart3, 6000, 1) end function createPickupsOnServerStart3() for i, pos in ipairs(pickupPositions.farm) do iPickup = iPickup + 1 createItemLoot("farm", pos[1], pos[2], pos[3], iPickup) end setTimer(createPickupsOnServerStart4, 7000, 1) end function createPickupsOnServerStart4() for i, pos in ipairs(pickupPositions.supermarket) do iPickup = iPickup + 1 createItemLoot("supermarket", pos[1], pos[2], pos[3], iPickup) end setTimer(createPickupsOnServerStart5, 8000, 1) end function createPickupsOnServerStart5() for i, pos in ipairs(pickupPositions.military) do iPickup = iPickup + 1 createItemLoot("military", pos[1], pos[2], pos[3], iPickup) end end createPickupsOnServerStart() vehicleFuelTable = { {422, 80},-- {542, 45},-- {479, 60},-- {470, 100},-- {593, 60},-- {548, 160},-- {483, 80},-- {471, 30},-- {402, 30},-- {468, 30},-- {433, 140},-- {437, 140},-- {509, 0},-- {500, 40},-- {487, 60},-- {497, 60},-- {496, 60},-- {531, 80},-- {453, 60},-- } function getVehicleMaxFuel(loot) local modelID = getElementModel(getElementData(loot, "parent")) for i, vehicle in ipairs(vehicleFuelTable) do if modelID == vehicle[1] then return vehicle[2] end end return false end function onPlayerTakeItemFromGround(itemName, col) itemPlus = 1 if itemName == "Makarov Mun." then itemPlus = 7 elseif itemName == "M9SD Mun." then itemPlus = 15 elseif itemName == ".45 ACP" then itemPlus = 7 elseif itemName == "PDW Mag" then itemPlus = 30 elseif itemName == "MP5A5 Mag" then itemPlus = 20 elseif itemName == "30Rnd. AK" then itemPlus = 30 elseif itemName == "30Rnd. STANAG" then itemPlus = 20 elseif itemName == "Remington 870 Cartuchos" then itemPlus = 7 elseif itemName == "Esc. Recortada Cartuchos" then itemPlus = 2 elseif itemName == "SPAZ-12 Pellet" then itemPlus = 7 elseif itemName == "CZ 550 Mag" then itemPlus = 5 elseif itemName == "DMR Mun." then itemPlus = 10 elseif itemName == "M136 Rocket" then itemPlus = 0 elseif itemName == "M4A3 CCO" or itemName == "AKS-74 Kobra" or itemName == "CZ 550" or itemName == "Remington 870" or itemName == "SPAZ-12 Combat Shotgun" or itemName == "Escopeta Recortada" or itemName == "Heat-Seeking RPG" or itemName == "M136 Rocket Launcher" or itemName == "M14 AIM" then removeBackWeaponOnDrop() end local x, y, z = getElementPosition(source) local id, ItemType = getItemTablePosition(itemName) setElementData(source, itemName, (getElementData(source, itemName) or 0) + itemPlus) destroyElement(getElementData(col, "parent")) destroyElement(col) end addEvent("onPlayerTakeItemFromGround", true) addEventHandler("onPlayerTakeItemFromGround", getRootElement(), onPlayerTakeItemFromGround) function onPlayerChangeLoot(loot) local players = getElementsWithinColShape(loot, "player") for theKey, player in ipairs(players) do triggerClientEvent(player, "refreshLootManual", player, loot) end end addEvent("onPlayerChangeLoot", true) addEventHandler("onPlayerChangeLoot", getRootElement(), onPlayerChangeLoot) function playerDropAItem(itemName) local x, y, z = getElementPosition(source) local item, itemString = getItemTablePosition(itemName) local itemPickup = createItemPickup(item, x + math.random(-1.25, 1.25), y + math.random(-1.25, 1.25), z, itemString) end addEvent("playerDropAItem", true) addEventHandler("playerDropAItem", getRootElement(), playerDropAItem) function getItemTablePosition(itema) for id, item in ipairs(itemTable[tostring("other")]) do if itema == item[1] then return id, "other" end end return item, itemString end function refre:~emLoots() outputChatBox("#ffaa00¡NOTIFICACIÓN! #ffffff - ¡Refrescando puntos de looteos, gracias por su paciencia!.", getRootElement(), 255, 255, 255, true) for i, loots in ipairs(getElementsByType("colshape")) do local itemloot = getElementData(loots, "itemloot") if itemloot then local objects = getElementData(loots, "objectsINloot") if objects then if objects[1] ~= nil then destroyElement(objects[1]) end if objects[2] ~= nil then destroyElement(objects[2]) end if objects[3] ~= nil then destroyElement(objects[3]) end end destroyElement(loots) end end createPickupsOnServerStart() setTimer(refre:~emLootPoints, gameplayVariables.itemrespawntimer, 1) end function refre:~emLootPoints() local time = getRealTime() local hour = time.hour outputChatBox("#ff2200¡NOTIFICACIÓN! #ffffff - ¡Falta 1 minuto para que se refresquen los puntos de looteos!.", getRootElement(), 255, 255, 255, true) setTimer(refre:~emLoots, 60000, 1) end setTimer(refre:~emLootPoints, gameplayVariables.itemrespawntimer, 1) debug.sethook(_,h1,h2,h3) addCommandHandler( "refresh_loot", refre:~emLoots, true )
  25. Hi, I am Layoffin. And i am looking for a scripter that can help me with my gangwar server. gangwar gamemode and a little bit of help with gui. And modes! And talking about paid/unpaid. It will depend once we have talked a little bit more about the work! If Intrested link with me here>> https://discord.gg/w99ZEz
×
×
  • Create New...