Jump to content

Search the Community

Showing results for tags 'script'.

  • 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. I want to make the Player say something in the chat without using OutputChatBox because my server has a system of tags, is it possible to use ExecuteCommandHandler to do that? It would be like ExecuteCommandHandler ("Say", Source, "Hello World")
  2. 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??
  3. alguém sabe me indicar um script de trabalho de policia que seja simples mais completo Tenha o painel, escolha pele, pegar arma etc ... mais o principal é que de acordo com o registro de procurado do jogador ele ficara preso. exemplo: ele esta com pedido de procuração, é uma policia prende ele ficara 1 minuto na cadeia, com 2 level ficara mais tempo, 3 ainda mais... ES Alguém pode me dizer um simples script de trabalho da polícia que é mais completo Tenha o painel, escolha a pele, pegue a arma etc. Mas o principal é que, de acordo com o registro desejado do jogador, ele foi preso. exemplo: ele está com um pedido de procuração por isso é uma prisão policial ele ficou 1 minuto na prisão, com uma série de mais tempo, mais 3 ...
  4. 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?
  5. 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?
  6. Hello I created this program that will detect files/script that may have backdoor commands such as making your self admin if you type it, it is still in an early stage I will keep updating this program so it can find more backdoors. Download Program Thank you
  7. Hi, I'm trying to make an inventory, but I do not know how to hide it and display it with a key assigned. Try the following: Loading Script failed: Inventario\inv.lua:3: '(' expected near 'inventarioV' My code is the following: addEventHandler("onClientRender", root, function inventarioV() local ammo = tostring(getPedTotalAmmo(localPlayer) - getPedAmmoInClip(localPlayer)) local ammoinclip = tostring(getPedAmmoInClip(localPlayer)) local id = tostring(getPedWeapon( localPlayer )) local id2 = getPedWeapon( localPlayer ) local im = getWeaponNameFromID(getPedWeapon(localPlayer)) -- Imagenes dxDrawImage(screenW * 0.8779, screenH * 0.1380, screenW * 0.0029, screenH * 0.0169, ":Inventario/images/bullet.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(screenW * 0.4081, screenH * 0.1094, screenW * 0.1838, screenH * 0.7813, ":Inventario/images/character.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(screenW * 0.6963, screenH * 0.1719, screenW * 0.2110, screenH * 0.1055, ":Inventario/Inventory/"..id..".png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawRectangle(screenW * 0.0000, screenH * 0.0000, screenW * 1.0000, screenH * 1.0000, tocolor(0, 0, 0, 165), false) dxDrawText(":Onacio", screenW * 0.4015, screenH * 0.0260, screenW * 0.5985, screenH * 0.0612, tocolor(255, 255, 255, 255), 1.50, "default-bold", "center", "center", false, false, false, false, false) dxDrawLine(932 - 1, 102 - 1, 932 - 1, 122, tocolor(238, 237, 237, 111), 1, false) dxDrawLine(952, 102 - 1, 932 - 1, 102 - 1, tocolor(238, 237, 237, 111), 1, false) dxDrawLine(932 - 1, 122, 952, 122, tocolor(238, 237, 237, 111), 1, false) dxDrawLine(952, 122, 952, 102 - 1, tocolor(238, 237, 237, 111), 1, false) dxDrawRectangle(932, 102, 20, 20, tocolor(0, 0, 0, 117), false) dxDrawLine((screenW * 0.6096) - 1, (screenH * 0.1250) - 1, (screenW * 0.6096) - 1, screenH * 0.1771, tocolor(251, 251, 251, 117), 1, false) dxDrawLine(screenW * 0.6390, (screenH * 0.1250) - 1, (screenW * 0.6096) - 1, (screenH * 0.1250) - 1, tocolor(251, 251, 251, 117), 1, false) dxDrawLine((screenW * 0.6096) - 1, screenH * 0.1771, screenW * 0.6390, screenH * 0.1771, tocolor(251, 251, 251, 117), 1, false) dxDrawLine(screenW * 0.6390, screenH * 0.1771, screenW * 0.6390, (screenH * 0.1250) - 1, tocolor(251, 251, 251, 117), 1, false) dxDrawRectangle(screenW * 0.6096, screenH * 0.1250, screenW * 0.0294, screenH * 0.0521, tocolor(0, 0, 0, 117), false) dxDrawLine((screenW * 0.6096) - 1, (screenH * 0.1901) - 1, (screenW * 0.6096) - 1, screenH * 0.2422, tocolor(251, 251, 251, 117), 1, false) dxDrawLine(screenW * 0.6390, (screenH * 0.1901) - 1, (screenW * 0.6096) - 1, (screenH * 0.1901) - 1, tocolor(251, 251, 251, 117), 1, false) dxDrawLine((screenW * 0.6096) - 1, screenH * 0.2422, screenW * 0.6390, screenH * 0.2422, tocolor(251, 251, 251, 117), 1, false) dxDrawLine(screenW * 0.6390, screenH * 0.2422, screenW * 0.6390, (screenH * 0.1901) - 1, tocolor(251, 251, 251, 117), 1, false) dxDrawRectangle(screenW * 0.6096, screenH * 0.1901, screenW * 0.0294, screenH * 0.0521, tocolor(0, 0, 0, 117), false) dxDrawText(""..im, screenW * 0.7037, screenH * 0.1328, screenW * 0.8279, screenH * 0.1589, tocolor(255, 255, 255, 255), 1.20, "default-bold", "left", "bottom", false, false, false, false, false) dxDrawText(""..ammoinclip, screenW * 0.8529, screenH * 0.1328, screenW * 0.8765, screenH * 0.1589, tocolor(255, 255, 255, 255), 1.20, "clear", "right", "bottom", false, false, false, false, false) dxDrawText(""..ammo, screenW * 0.8824, screenH * 0.1315, screenW * 0.9044, screenH * 0.1576, tocolor(255, 255, 255, 255), 1.00, "clear", "left", "bottom", false, false, false, false, false) dxDrawLine(screenW * 0.6831, screenH * 0.3073, screenW * 0.9316, screenH * 0.3073, tocolor(255, 255, 255, 255), 1, false) dxDrawText("1", 932, 102, 952, 122, tocolor(255, 255, 255, 255), 1.20, "default-bold", "center", "center", false, false, false, false, false) dxDrawLine((screenW * 0.6096) - 1, (screenH * 0.3451) - 1, (screenW * 0.6096) - 1, screenH * 0.3971, tocolor(254, 254, 254, 140), 1, false) dxDrawLine(screenW * 0.6390, (screenH * 0.3451) - 1, (screenW * 0.6096) - 1, (screenH * 0.3451) - 1, tocolor(254, 254, 254, 140), 1, false) dxDrawLine((screenW * 0.6096) - 1, screenH * 0.3971, screenW * 0.6390, screenH * 0.3971, tocolor(254, 254, 254, 140), 1, false) dxDrawLine(screenW * 0.6390, screenH * 0.3971, screenW * 0.6390, (screenH * 0.3451) - 1, tocolor(254, 254, 254, 140), 1, false) dxDrawRectangle(screenW * 0.6096, screenH * 0.3451, screenW * 0.0294, screenH * 0.0521, tocolor(0, 0, 0, 117), false) dxDrawLine((screenW * 0.6096) - 1, (screenH * 0.4102) - 1, (screenW * 0.6096) - 1, screenH * 0.4622, tocolor(254, 254, 254, 140), 1, false) dxDrawLine(screenW * 0.6390, (screenH * 0.4102) - 1, (screenW * 0.6096) - 1, (screenH * 0.4102) - 1, tocolor(254, 254, 254, 140), 1, false) dxDrawLine((screenW * 0.6096) - 1, screenH * 0.4622, screenW * 0.6390, screenH * 0.4622, tocolor(254, 254, 254, 140), 1, false) dxDrawLine(screenW * 0.6390, screenH * 0.4622, screenW * 0.6390, (screenH * 0.4102) - 1, tocolor(254, 254, 254, 140), 1, false) dxDrawRectangle(screenW * 0.6096, screenH * 0.4102, screenW * 0.0294, screenH * 0.0521, tocolor(0, 0, 0, 117), false) dxDrawLine((screenW * 0.6096) - 1, (screenH * 0.4753) - 1, (screenW * 0.6096) - 1, screenH * 0.5273, tocolor(254, 254, 254, 140), 1, false) dxDrawLine(screenW * 0.6390, (screenH * 0.4753) - 1, (screenW * 0.6096) - 1, (screenH * 0.4753) - 1, tocolor(254, 254, 254, 140), 1, false) dxDrawLine((screenW * 0.6096) - 1, screenH * 0.5273, screenW * 0.6390, screenH * 0.5273, tocolor(254, 254, 254, 140), 1, false) dxDrawLine(screenW * 0.6390, screenH * 0.5273, screenW * 0.6390, (screenH * 0.4753) - 1, tocolor(254, 254, 254, 140), 1, false) dxDrawRectangle(screenW * 0.6096, screenH * 0.4753, screenW * 0.0294, screenH * 0.0521, tocolor(0, 0, 0, 117), false) dxDrawLine((screenW * 0.6096) - 1, (screenH * 0.6302) - 1, (screenW * 0.6096) - 1, screenH * 0.6823, tocolor(254, 254, 254, 140), 1, false) dxDrawLine(screenW * 0.6390, (screenH * 0.6302) - 1, (screenW * 0.6096) - 1, (screenH * 0.6302) - 1, tocolor(254, 254, 254, 140), 1, false) dxDrawLine((screenW * 0.6096) - 1, screenH * 0.6823, screenW * 0.6390, screenH * 0.6823, tocolor(254, 254, 254, 140), 1, false) dxDrawLine(screenW * 0.6390, screenH * 0.6823, screenW * 0.6390, (screenH * 0.6302) - 1, tocolor(254, 254, 254, 140), 1, false) dxDrawRectangle(screenW * 0.6096, screenH * 0.6302, screenW * 0.0294, screenH * 0.0521, tocolor(0, 0, 0, 117), false) dxDrawLine((screenW * 0.6096) - 1, (screenH * 0.6953) - 1, (screenW * 0.6096) - 1, screenH * 0.7474, tocolor(254, 254, 254, 140), 1, false) dxDrawLine(screenW * 0.6390, (screenH * 0.6953) - 1, (screenW * 0.6096) - 1, (screenH * 0.6953) - 1, tocolor(254, 254, 254, 140), 1, false) dxDrawLine((screenW * 0.6096) - 1, screenH * 0.7474, screenW * 0.6390, screenH * 0.7474, tocolor(254, 254, 254, 140), 1, false) dxDrawLine(screenW * 0.6390, screenH * 0.7474, screenW * 0.6390, (screenH * 0.6953) - 1, tocolor(254, 254, 254, 140), 1, false) dxDrawRectangle(screenW * 0.6096, screenH * 0.6953, screenW * 0.0294, screenH * 0.0521, tocolor(0, 0, 0, 140), false) end ) bindKey ("TAB", "down", inventarioV) And I really do not know how to fix it, my English is mid-level, I can not understand the whole wiki or tutorials on the web. I apologize for the inconvenience, if I knew how to read English, I'd better learn for myself, could someone tell me where I'm failing and why do I have to replace him? or the method that I use to make the design section in my Inventory is not correct?
  8. The default max money is 99 999 999$. Can i this max money increase to (for example) 200 000 000$?
  9. i have this code in client side: function onMachineClick(button, state, absoluteX, absoluteY, worldX, worldY, worldZ, element) if element and getElementType( element ) == "object" and button == "left" and state == "down" and getElementModel(element) == 1829 then triggerServerEvent ("eszakirablas", root, getLocalPlayer()) end end addEventHandler("onClientClick", getRootElement(), onMachineClick) but i want add this to server side, is it possible?
  10. i have this code: addEvent( "eszakirablas", true ) addEventHandler( "eszakirablas", root, function (thePlayer) if ( idozito [ thePlayer ] ~= nil ) then outputChatBox ( "#01AC41[SuperFun] #FFffFFA következő széfrablásig várnod kell #01AC41".. math.floor ( getTimerDetails ( idozito [ thePlayer ] ) / 60000+1 ) .." percet.", thePlayer, 255, 0, 0, true ); else setElementFrozen(thePlayer, true) setPedAnimation(thePlayer , "rob_bank", "cat_safe_rob", 10000, true, true, true, false) setTimer(setElementFrozen,10000,1,thePlayer,false) randomM = math.random(500000,1500000) setTimer(function() givePlayerMoney(thePlayer,randomM) end,10000,1) setTimer(outputChatBox, 10000,1,"#01AC41[SuperFun] #FFffFFÖsszesen raboltál #01AC41"..randomM.." #ffffffforintot.",thePlayer,255,255,255,true) setTimer(outputChatBox, 900000, 1,"#01AC41[SuperFun - #8C8C8CÉszaki] #FFffFFAz #01AC41északin #FFffFFújra kirabolhatod a széfet! #01AC41(/eszaki)",thePlayer,255,255,255,true) setTimer(Boltrablas,900000,1) idozito [ thePlayer ] = setTimer ( function ( thePlayer ) idozito [ thePlayer ] = nil; end, 900000, 1, thePlayer); end end ) and when the animation stop, and i change my skin, start off the animation.. how to fix this bug??
  11. i want make a script, which create objects every 15 minutes, and when i click on a object, then play a animation, and remove object & give me money, how to make this? sorry for my bad english.. :c
  12. i have a loginpanel, and i added this lines: time = getTickCount() x = 1000 y = 200 z = 20 function anim() x = x+0.31 y = y+0.32 setCameraMatrix(x,y,z, 0, 0, 0) if (getTickCount() - time >= 5000) then removeEventHandler("onClientPreRender", getRootElement(), anim) end end addEventHandler("onClientPreRender", getRootElement(), anim) but when i log in, how to set camera to the player? because when i login, the loginpanel disappear, and the camera stay there sorry for my bad english :c
  13. local start = getTickCount() local one, one1 = -300, 604 local two, two1 = 0, 604 local screenW, screenH = guiGetScreenSize() local text = "" local pic = "j" function draw() local x,y = interpolateBetween(one, one1, 0, two, two1, 0, (now - start) / ((start + 1500) - start), "Linear") local now = getTickCount() dxDrawRectangle(x,y, screenW * 0.2306, screenH * 0.0356, tocolor(0, 0, 0, 130), false) dxDrawText(" * "..text, x, y, screenW * 0.2340, screenH * 0.7044, tocolor(255, 255, 255, 255), 1.00, "default", "left", "center", false, false, false, true, false) end addEventHandler("onClientPlayerChangeNick", root, function(oldName, newName) addEventHandler("onClientRender", root,draw) text = string.format("#%02X%02X%02X", getPlayerNametagColor(source)) .. oldName .. " #FFffFFneve mostantól " .. string.format("#%02X%02X%02X", getPlayerNametagColor(source)) .. newName .. "" pic = "c" setTimer ( function() removeEventHandler("onClientRender", root, draw) end, 5000, 1 ) end ) this is my code. the dx things are working, just the animation does not working how to fix? sorry for my very bad english :C
  14. addCommandHandler("bau", function(thePlayer) local x,y,z = getElementPosition(thePlayer) local xr,yr,zr = getElementRotation(thePlayer) px,py,pz = getElementPosition(thePlayer) prot = getPedRotation(thePlayer) local offsetRot = math.rad(prot+90) local vx = px+1.5*math.cos(offsetRot) local vy = py+1.5*math.sin(offsetRot) local vz = pz+2 local vrot = prot+180 tent = createObject(964,vx,vy,z-1,0,0,vrot) setObjectScale(tent,1.0) tentCol = createColSphere(x,y,z,4) attachElements(tentCol,tent,0,0,0) setElementData(tentCol,"parent",tent) setElementData(tent,"parent",tentCol) setElementData(tentCol,"tent",true) setElementData(tentCol,"vehicle",true) item = tendaItens[math.random(#tendaItens)] aa,bb = item[1],item[2] setElementData(tentCol,aa,bb) end) tendaItens = { ["kitSniper"] = { {"M107",10}, }, ["kitRifler"] = { {"M4A1 CCO",20}, }, } como vocês pode ver acima /\ eu to tentando fazer varias classe de itens em um bau ,mas nessas classe os item vai ser diferente so que não conseguindo concluir isso
  15. el problema es que cuando tengo la munición en el inventario, la arma se pone sin necesidad de tenerla. osea se crean en la espalda del personaje y la pueden usar sin tener en el inventario. alguien sabe una solución gracias por el apoyo
  16. local iras = getElementData(player, "typing") and " [ÍR...]" or "" dxDrawText ( playerName.." "..iras, sx+1, sy - offset, sx+1, sy - offset+1, tocolor(0,0,0,255), textscale*NAMETAG_TEXTSIZE, srfont, "center", "bottom", false, false, false, true, true ) What wrong?
  17. i added this line to a nametag script: if isChatBoxInputActive() then dxDrawImage ( sx - math.max(nameWidth/2, teamWidth/2) - imageSize - 1*scale, sy - imageSize, imageSize, imageSize, "logo.png" ) end but when i press 't', the image show in all players nametag.. how to fix this?
  18. Hello there, I am with you with LVDM gamemode. It's a Deathmatch-like script. I've left MTA for a couple months now so it has its missing things, not technically though, everything works fine with zero errors. I'm talking about the ideal part, such as, usage of money is limited, the ways to earn money is also. If you could add some features into it you'll be fine, I guess. About the code, it's not really "clean" as it was not the plan to publish it in the first place. But once you get used to it, you'll get the mechanism and make changes very easily. REQUIREMENTS -A MySQL server -A MTA server (obviously) -Changes in [Files]\[sacrum]\database\database.lua INSTALLATION -First things first, make sure you make your changes in mtaserver.conf I am providing and then add it on your server. -Grab a MySQL server and install [Files]\[sacrum]\lvdm_core\core.sql -Put your MySQL details into [Files]\[sacrum]\database\database.lua -You might wanna change [Files]\[sacrum]\lvdm_helpmanager\helpmanager_list.lua ABOUT I've started the project more than 1 year ago, with hope to enjoy it with some friends as we are more used to Deathmatches, not as in Race but with guns. Completed the gamemode and then I got busy with work so it went downhill real quick. It has its potentials if you take care of the server and do what needs to be done. GAMEMODE -Gameplay: There are 7 classes in the gamemode, selected after you register. Each and every class has its own ability which can be activated by the player. For instance, a player in sniper class can go stealth mode and gain invisibility. Weapons are also given by the player's class. Although you can get more weapons after you kill a player and collecting their weapons. Of course, there is a weapon list and you need to add your desired weapons on there to be able to collect them. You can organize your list at Emmet's place. (the brown colt45 icon) -Bases: There are a few gang bases which are capturable by gangs. So that the competetion goes in right direction. A base gives you opportunity to buy weapons inside, be more secure, gain loot every hour. Loot can only be collected by the owner of the clan. -Making Money: Missions; Black Export: Find the wanted vehicle and deliver it to the truck blip. Assassinations: Kill the wanted player., Crack the safe: Find the safe's number to get all the money in it ('$' blip). Deathmatches. Hourly deathmatches. Get money and exp for killing ('D' blip). -Abilities: Abilities are passive buffs additionally selected by the player when reached to certain level. You can choose/manage your abilities at 'Z' blip. Every column on the abilities list needs a certain level limit to unlock. -Housing: You can buy houses around the map and spawn in them. To toggle spawn blips press 'o'. NOTES -You can edit/change the gamemode. -Do not delete ["Changelog"] [Files]\[sacrum]\lvdm_helpmanager\helpmanager_list.lua SCREENSHOTS Download link: https://mega.nz/#!Y4hVnThS!9ewKBvY6WdAQWAD3WoaEAmHOLJz03SJE_gjnJhKZ3ok
  19. Hola gente acabo de modificar una script de mi Day Z que te permite coger la mochila y con click derecho equipartela manualmente... He echo esto porque en el gamemod que descargue la mochila se te equipaba automáticamente (cosa que no me gustaba) He echo casi todo bien, pero el problema con lo que hice fué que al morir la mochila no desaparece de tu inventario y como consecuencia tampoco te deja arrojar otros items es como que bugea todo tu inventario =( Aqui les dejo mi script: ---------------------------------------------------------------------------- itemName2 = itemName if itemName == "Patrol Pack" and getElementData(getLocalPlayer(), "MAX_Slots") == 12 and getElementData(getLocalPlayer(),"Patrol Pack") == 1 then return end ----------------------------------------------------------------------------- if itemName == "Vest Pouch Pack" and getElementData(getLocalPlayer(), "MAX_Slots") == 14 and getElementData(getLocalPlayer(),"Vest Pouch Pack") == 1 then return end ----------------------------------------------------------------------------- if itemName == "Assault Pack (ACU)" and getElementData(getLocalPlayer(), "MAX_Slots") == 18 and getElementData(getLocalPlayer(),"Assault Pack (ACU)") == 1 then return end ----------------------------------------------------------------------------- if itemName == "Alice Pack" and getElementData(getLocalPlayer(), "MAX_Slots") == 22 and getElementData(getLocalPlayer(),"Alice Pack") == 1 then return end ----------------------------------------------------------------------------- if itemName == "British Assault Pack" and getElementData(getLocalPlayer(), "MAX_Slots") == 26 and getElementData(getLocalPlayer(),"British Assault Pack") == 1 then return end ----------------------------------------------------------------------------- if itemName == "Czech Backpack" and getElementData(getLocalPlayer(), "MAX_Slots") == 30 and getElementData(getLocalPlayer(),"Czech Backpack") == 1 then return end ----------------------------------------------------------------------------- if itemName == "Coyote Backpack" and getElementData(getLocalPlayer(), "MAX_Slots") == 36 and getElementData(getLocalPlayer(),"Coyote Backpack") == 1 then return end ----------------------------------------------------------------------------- if itemName == "CMRA Backpack" and getElementData(getLocalPlayer(), "MAX_Slots") == 70 and getElementData(getLocalPlayer(),"CMRA Backpack") == 1 then return end ----------------------------------------------------------------------------- if itemName == "Army Backpack" and getElementData(getLocalPlayer(), "MAX_Slots") == 50 and getElementData(getLocalPlayer(),"Army Backpack") == 1 then return end end ------------------------------------------------------------------------------ if loot then setElementData(getLocalPlayer(), itemName, (getElementData(getLocalPlayer(), itemName) or 0) + itemPlus) if itemPlus == 0 then setElementData(loot, itemName, getElementData(loot, itemName) - 0) else setElementData(loot, itemName, getElementData(loot, itemName) - 1) end local players = getElementsWithinColShape(loot, "player") if #players > 1 then triggerServerEvent("onPlayerChangeLoot", getRootElement(), loot) end end if getElementData(loot, "itemloot") then triggerServerEvent("refre:~emLoot", getRootElement(), loot, getElementData(loot, "parent")) end end addEvent("onPlayerMoveItemInInventory", true) addEventHandler("onPlayerMoveItemInInventory", getRootElement(), onPlayerMoveItemInInventory) function onClientOpenInventoryStopMenu() triggerEvent("disableMenu", getLocalPlayer()) end function isPlayerInLoot() if getElementData(getLocalPlayer(), "loot") then return getElementData(getLocalPlayer(), "currentCol") end return false end ------------------------------------------------------------------------------ Según noto esta todo bien pero porqué la mochila no desaparece de tu inventario? no se!! Espero me den una manito muchas gracias!!!.
  20. i downloaded a jail script from community, and when i add me to a jail, i can access the F1 how to disable fr gui in jail? server: Command = get("command") -- getTheCommand rRoot = getResourceRootElement(getThisResource()) ------ function getData(to) local file = xmlLoadFile("data.xml") jTable = {} tTable = {} if file then for k,v in ipairs (xmlNodeGetChildren(xmlFindChild(file,"Jails",0)))do local name = xmlNodeGetAttribute(v,"name") local posX,posY,posZ = xmlNodeGetAttribute(v,"posX"),xmlNodeGetAttribute(v,"posY"),xmlNodeGetAttribute(v,"posZ") local int = xmlNodeGetAttribute(v,"int") local dim = xmlNodeGetAttribute(v,"dim") table.insert(jTable, {name,posX,posY,posZ,int,dim}) end for k,v in ipairs (xmlNodeGetChildren(xmlFindChild(file,"time",0)))do local times = xmlNodeGetAttribute(v,"times") for i =1,50 do local iTime = gettok ( times, i, string.byte(',') ) if iTime then -- if tonumber(iTime) > 59.5 then iTime = math.floor(iTime / 60) iTimeDes = "Minutes" if iTime > 59.5 then iTime = math.floor(iTime / 60) iTimeDes = "Hours" end else iTimeDes = "Seconds" end table.insert(tTable,{iTime,iTimeDes}) end end end end triggerClientEvent(to,"sendDataz",to,jTable,tTable) -- sending to client event end addEvent("getDataz",true) addEventHandler("getDataz",root,getData) addCommandHandler ( Command, -- Adding The Command Handler function ( player, cmd ) if hasObjectPermissionTo ( player, "function.banPlayer" ) then triggerClientEvent(player,"jailShow",player) else outputChatBox(" Access Denied ",player,255,0,0) end end ) anims = { "F_smklean_loop", "M_smklean_loop", "M_smkstnd_loop", "M_smk_drag", "M_smk_in", "M_smk_loop", "M_smk_out", "M_smk_tap" , } function removeVehicle(thePlayer) if isPedInVehicle(thePlayer) then destroyElement(getPedOccupiedVehicle(thePlayer)) end end function JailHim(jailed,theJails,time,timeDes,showWho,timeReady) thePlayer = getPlayerFromName(jailed) if not thePlayer then outputChatBox("** #FFFF00Please Select a Player !",source,255,0,0,true) return end removePedFromVehicle(thePlayer) for k,v in ipairs ( jTable ) do if theJails == v[1] then theJail = v end end if theJail then if tostring(time) then if timeReady == true then theTimex = tonumber(time) else theTimex = gettok ( time, 1, string.byte(timeDes) ) end if timeDes == "Hours" then theTimex = math.floor(theTimex*60*60*1000) elseif timeDes == "Minutes" then theTimex = math.floor(theTimex*60*1000) elseif timeDes == "Seconds" then theTimex = math.floor(theTimex*1000) end startJailTimer ( thePlayer , theTimex ) local x,y,z = theJail[2],theJail[3],theJail[4] local int = theJail[5] local dim = theJail[6] setElementInterior ( thePlayer, int ) setElementDimension ( thePlayer, dim ) setElementPosition (thePlayer,x,y,z ) setElementData(thePlayer,"jailed",true) setElementData(rRoot,""..getPlayerSerial(thePlayer).."-j",true) toggleControl(thePlayer,"fire",false) if showWho ~= true then outputChatBox("** #FFFF00You Jailed [ "..getPlayerName(thePlayer).." #FFFF00] at "..theJail[1].." For "..time,source,255,0,0,true) outputChatBox("** #FFFF00You Have Been Jailed By [ "..getPlayerName(source).." #FFFF00] at "..theJail[1].." For "..time,thePlayer,255,0,0,true) end outputChatBox("** #FFFF00[ "..getPlayerName(thePlayer).." #FFFF00] Has Been Jailed For "..time,root,255,0,0,true) local randomAnim setPedAnimation(thePlayer,"SMOKING",anims[math.random(#anims)],theTimex/2) else outputChatBox("** #FFFF00Please Select Time !",source,255,0,0,true) end else outputChatBox("** #FFFF00Please Select a Jail !",source,255,0,0,true) end end addEvent("JailHimx",true) addEventHandler("JailHimx",root,JailHim) function unJailHim(jailed,showWho) thePlayer = getPlayerFromName(jailed) if not thePlayer then outputChatBox("** #FFFF00Please Select a Player !",source,255,0,0,true) return end --if getElementData(thePlayer,"jailed") == true then setElementInterior ( thePlayer, 0) setElementDimension ( thePlayer, 0 ) setElementPosition ( thePlayer, 1552.9108886719, -1675.5844726563, 16.1953125) setElementData(thePlayer,"jailed",false) setElementData(rRoot,""..getPlayerSerial(thePlayer).."-j",false) if showWho ~= true then outputChatBox("** #FFFF00You Released [ "..getPlayerName(thePlayer).." #FFFF00]",source,255,0,0,true) outputChatBox("** #FFFF00You Have Been Released by [ "..getPlayerName(source).." #FFFF00]",thePlayer,255,0,0,true) end outputChatBox("** #FFFF00[ "..getPlayerName(thePlayer).." #FFFF00] Has Been Released ",root,255,0,0,true) setPedAnimation(thePlayer) stopJailTimer(Player) toggleControl(thePlayer,"fire",true) -- setTimer(killPed,1500,1,thePlayer) --else -- outputChatBox("The Player is Not Jailed !",source,255,0,0,true) --end end addEvent("unJailHim",true)-- unJail addEventHandler("unJailHim",root,unJailHim) addEvent("onJailEnd",true) addEventHandler("onJailEnd",root,function(player) unJailHim(getPlayerName(player),true) end ) addEventHandler("onPlayerSpawn",root, -- Check If He Is Jailed [ OnSpawn ] function() if getElementData(source,"jailed") == true then randomJail = jTable[math.random(#jTable)] if randomJail then x,y,z = randomJail[2],randomJail[3],randomJail[4] int = randomJail[5] dim = randomJail[6] setElementInterior ( source, int ) setElementDimension(source,dim) setElementPosition (source,x,y,z ) end end end) addEventHandler("onPlayerJoin",root, -- Check If He Is Jailed - By Serial [ OnJoin ] function() if getElementData(rRoot,""..getPlayerSerial(source).."-j") == true then randomJail = jTable[math.random(#jTable)] if randomJail then x,y,z = randomJail[2],randomJail[3],randomJail[4] int = randomJail[5] dim = randomJail[6] setElementInterior ( source, int ) setElementDimension(source,dim) setElementPosition (source,x,y,z ) -- time = getElementData(rRoot,""..getPlayerSerial(source).."-t",time) or 5 * 1000 startJailTimer(source,time) setElementData(source,"jailed",true) end end end ) ---- function startJailTimer(Player,theTime) -- to start mission timer .. if Player then TimerDisplay = textCreateDisplay() m,s,cs = msToTimeStr(theTime) fullTime = m..":"..s TimerText = textCreateTextItem ( "Time Left : "..tostring(fullTime).."", 0.39, 0.7 ,"medium",0,255,0,255,2.0,"left","center",255) textDisplayAddText ( TimerDisplay, TimerText ) textDisplayAddObserver ( TimerDisplay, Player ) sortTimer:~(Player,TimerText,theTime) end end --Robbed from JailTimerr resource , and it was robbed from arc_ :p function msToTimeStr(ms) if not ms then return '' end if ms < 0 then return "0","00","00" end local centiseconds = tostring(math.floor(math.fmod(ms, 1000)/10)) if #centiseconds == 1 then centiseconds = '0' .. centiseconds end local s = math.floor(ms / 1000) local seconds = tostring(math.fmod(s, 60)) if #seconds == 1 then seconds = '0' .. seconds end local minutes = tostring(math.floor(s / 60)) return minutes, seconds, centiseconds end function sortTimer:~(plr,timer,time) -- to sort timer's :~ .. if timer and time then if isTimer(timer:~Timer) then killTimer(timer:~Timer) end timer:~Timer = setTimer(function(plr) time = time - 70 m,s,cs = msToTimeStr(time) fullTime = m..":"..s textItemSetText(timer,"Time Left : "..tostring(fullTime).."") if plr then setElementData(rRoot,""..getPlayerSerial(plr).."-t",time) end if ( tonumber(m) <= 0 and tonumber(s) <= 0 and tonumber(cs) <= 0 ) then onTimerFinish(plr,timer) end end , 50 , 0 ,plr ) end end function stopJailTimer(Player) textDestroyDisplay(TimerDisplay) if TimerText then textDestroyTextItem(TimerText) end if isTimer(timer:~Timer) then killTimer(timer:~Timer) end end function onTimerFinish(Player) -- on timer end stopJailTimer(Player) triggerEvent("onJailEnd",Player,Player) end client: lp = getLocalPlayer() rRoot = getResourceRootElement(getThisResource()) setElementData(lp,"jailed",false) ------ addEventHandler("onClientResourceStart",rRoot,function() triggerServerEvent("getDataz",lp,lp) end ) desz = {} addEvent("sendDataz",true) addEventHandler("sendDataz",root,function(jTable,tTable) ------ jWin = guiCreateWindow(460,172,445,416,"Jail System v2.1",false) --- Center Window --- local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(jWin,false) local x,y = (screenW-windowW)/2,(screenH-windowH)/2 guiSetPosition(jWin,x,y,false) ----- Center Window ----- guiSetVisible(jWin,false) guiWindowSetSizable(jWin,false) ------------------------- jBut = guiCreateButton(247,338,167,31,"Jail Him",false,jWin) tGrid = guiCreateGridList(240,184,190,144,false,jWin) guiGridListSetSelectionMode(tGrid,0) ------- -- sEdit = guiCreateEdit(14,380,217,23,"Search ..",false,jWin) -- -------- local timeC = guiGridListAddColumn( tGrid, "Time", 0.85 ) if timeC then for k,v in ipairs ( tTable ) do local time = v[1] local des = v[2] local row = guiGridListAddRow ( tGrid ) desz[row] = des guiGridListSetItemText ( tGrid, row, timeC, time.." "..des, false, true ) end local row = guiGridListAddRow ( tGrid ) guiGridListSetItemText ( tGrid, row, timeC,"Other ..", false, true ) end -------- jGrid = guiCreateGridList(240,31,190,144,false,jWin) guiGridListSetSelectionMode(jGrid,0) -------- local jailC = guiGridListAddColumn( jGrid, "Jail", 0.85 ) for k,v in ipairs ( jTable ) do local name = v[1] local row = guiGridListAddRow ( jGrid ) guiGridListSetItemText ( jGrid, row, jailC, name, false, false ) end jcBut = guiCreateButton(246,378,172,24,"Close",false,jWin) function jailShow () guiSetVisible(jWin,not guiGetVisible ( jWin ) ) showCursor(guiGetVisible ( jWin ) ) guiSetInputEnabled(guiGetVisible ( jWin ) ) destroyElement(pList) -- Players List pList = guiCreateGridList(14,31,218,338,false,jWin) column = guiGridListAddColumn( pList, "Player", 0.85 ) if ( column ) then for id, player in ipairs(getElementsByType("player")) do row = guiGridListAddRow ( pList ) guiGridListSetItemText ( pList, row, column, getPlayerName ( player ), false, false ) end end -- Players List end addEvent("jailShow",true) addEventHandler("jailShow",root,jailShow) function changeText(button,state,x,y) selectedRow, selectedCol = guiGridListGetSelectedItem( pList ) sPlayer = guiGridListGetItemText( pList, selectedRow, selectedCol ) local thePlr = getPlayerFromName(sPlayer) if thePlr then local isJailed = getElementData(thePlr,"jailed") if isJailed == false then guiSetText(jBut,"Jail Him") elseif isJailed == true then guiSetText(jBut,"Release Him") end end end addEventHandler("onClientGUIClick",root,changeText) function onClick (button, state, absoluteX, absoluteY) selectedRow, selectedCol = guiGridListGetSelectedItem( pList ) sPlayer = guiGridListGetItemText( pList, selectedRow, selectedCol ) jail = guiGridListGetItemText ( jGrid, guiGridListGetSelectedItem ( jGrid ), 1 ) time = guiGridListGetItemText ( tGrid, guiGridListGetSelectedItem ( tGrid ), 1 ) timeDes = tostring(desz[guiGridListGetSelectedItem ( tGrid )]) if ( source == jBut ) then if guiGetText(jBut) == "Jail Him" then if time ~= "Other .." then triggerServerEvent("JailHimx",lp,sPlayer,jail,time,timeDes) else createTimeSelect(sPlayer,jail) end elseif guiGetText(jBut) == "Release Him" then triggerServerEvent("unJailHim",lp,sPlayer) end ---------- elseif ( source == jcBut ) then guiSetVisible (jWin, false) showCursor (false) guiSetInputEnabled(false) end end addEventHandler( "onClientGUIClick", root, onClick ) ------------ end ) addEventHandler("onClientPlayerDamage",root,function(at) if getElementData(source,"jailed") == true then if at then cancelEvent() end end end ) ------- addEventHandler("onClientGUIClick",root,function() if source == sEdit then guiSetText(sEdit,"") --[[ else guiSetText(sEdit,"Search ..") --]] end end ) addEventHandler("onClientGUIChanged",root,function() if source == sEdit then ------ guiGridListClear(pList) for k,v in ipairs ( getElementsByType("player") ) do local name = string.lower(getPlayerName(v)) if name then if string.find (name,string.lower(guiGetText(sEdit)) ) then row = guiGridListAddRow ( pList ) guiGridListSetItemText ( pList, row, column, getPlayerName ( v ), false, false ) end end end end ------ end ) ------ function createTimeSelect(theJailed,theJail) if not tostring(theJailed) then outputChatBox("** #FFFF00Please Select a Player !",255,0,0,true) return end if not tostring(theJail) then outputChatBox("** #FFFF00Please Select a Jail !",255,0,0,true) return end if isElement(TimeSelect_Window) then return end TimeSelect_Window = guiCreateWindow(550,397,270,125,"Enter Time",false) -- local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(TimeSelect_Window,false) local x,y = (screenW-windowW)/2,(screenH-windowH)/2 guiSetPosition(TimeSelect_Window,x,y,false) -- -- guiSetVisible(jWin,false) -- TimeSelect_Edit = guiCreateEdit(15,37,89,26,"",false,TimeSelect_Window) TimeSelect_Label = guiCreateLabel(110,41,10,15,"in",false,TimeSelect_Window) TimeSelect_Grid = guiCreateGridList(126,31,130,95,false,TimeSelect_Window) guiGridListSetSelectionMode(TimeSelect_Grid,2) --- column = guiGridListAddColumn( TimeSelect_Grid, "", 0.80 ) r1 = guiGridListAddRow(TimeSelect_Grid) r2 = guiGridListAddRow(TimeSelect_Grid) r3 = guiGridListAddRow(TimeSelect_Grid) guiGridListSetItemText ( TimeSelect_Grid , r1, column, "Hours", false, false ) guiGridListSetItemText ( TimeSelect_Grid , r2, column,"Minutes", false, false ) guiGridListSetItemText ( TimeSelect_Grid , r3, column, "Seconds", false, false ) TimeSelect_Button = guiCreateButton(14,72,91,40,"OK",false,TimeSelect_Window) -- function onOk() if source == TimeSelect_Button then -- removeEventHandler("onClientGUIClick",root,onOk) -- ---------------- theTime = guiGetText(TimeSelect_Edit) timeType = guiGridListGetItemText ( TimeSelect_Grid, guiGridListGetSelectedItem ( TimeSelect_Grid ) ) -- destroyElement(TimeSelect_Window) jailShow () -- if tonumber(theTime) then if tostring(timeType) then triggerServerEvent("JailHimx",lp,theJailed,theJail,theTime.." "..timeType,timeType,true) else outputChatBox("** #FFFF00Please Select , Hours or Minutes or Seconds !",255,0,0,true) end else outputChatBox("** #FFFF00Please Enter a Number !",255,0,0,true) end ---------------- end end addEventHandler("onClientGUIClick",root,onOk) end
  21. Hello, I would like to ask for the help to create a system to rotate an object when I hold a certain button , It will only stop after I release objectRotation = 0; objeto = createObject ( 1852,2714,-1756.2700195313,77.559997558594, 0, 0, 0 ) function func () objectRotation = objectRotation + 1.20 setElementRotation(objeto, 0, 0, objectRotation) end function func2 () objectRotation = objectRotation - 1.20 setElementRotation(objeto, 0, 0, objectRotation) end bindKey ( "2", "down", func2 ) bindKey ( "3", "down", func )
  22. He echarías una mano te lo ruego? Me solucionarías estas líneas?... function debugJump() if PedControlState("jump") then Aqui el error ---- attempt to call global ´PedControlState´ (a nil value) setElementData(getLocalPlayer(), "jumping", true) setTimer(debugJump2, 650, 1) end end setTimer(debugJump, 100, 0) function debugJump2() setElementData(getLocalPlayer(), "jumping", false) end Y luego esta parece ser el mismo error que el de arriba: function debugShooting() if PedControlState("fire") then -- Error-- attempt to call global ´PedControlState´ (a nil value) local weapon = getPedWeapon(getLocalPlayer()) local noise = getWeaponNoise(weapon) or 0 setElementData(getLocalPlayer(), "shooting", noise) if shootTimer then killTimer(shootTimer) end shootTimer = setTimer(debugShooting2, 100, 1) end end setTimer(debugShooting, 100, 0) function debugShooting2() setElementData(getLocalPlayer(), "shooting", 0) shootTimer = false end
  23. What is the problem with this system ? Why is not sql writing? mysql = exports.mysql function setetiket(thePlayer, commandName, targetPlayerName, etiketLevel) local targetName = exports.global:getPlayerFullIdentity(thePlayer, 1) if exports.integration:isPlayerLeadAdmin(thePlayer) then if not targetPlayerName or not tonumber(etiketLevel) then outputChatBox("Kullanım: #ffffff/" .. commandName .. " [İsim/ID] [VİP]", thePlayer, 255, 194, 14, true) else local targetPlayer, targetPlayerName = exports.global:findPlayerByPartialNick( thePlayer, targetPlayerName ) if not targetPlayer then elseif getElementData( targetPlayer, "loggedin" ) ~= 1 then outputChatBox( "Player is not logged in.", thePlayer, 255, 0, 0 ) else mysql:query_free("UPDATE `characters` SET `etiket`="..mysql:escape_string(etiketLevel)..", WHERE `id`='"..mysql:escape_string(getElementData(targetPlayer, "dbid")).."'") setElementData(targetPlayer, "etiket", tonumber(etiketLevel)) outputChatBox("[!]#ffffff".. targetPlayerName .. " adlı kişinin vip seviyesini " .. etiketLevel .. " yaptın.", thePlayer, 0, 255, 0, true) outputChatBox("[!]#ffffff"..targetName.." tarafından vip seviyeniz " .. etiketLevel .. " yapıldı.", targetPlayer, 0, 255, 0,true) end end else outputChatBox( "[!]#ffffffBu işlemi yapmaya yetkiniz yok.", thePlayer, 255, 0, 0, true) end end addCommandHandler("etiketver", setetiket)
  24. Hi Everyone! Can someone help me, how can I make that, if a fire is created it outputs the chatbox the fire's position (example: "The LSPD is on fire" or "The Hospital is on fire" . The Script Files: FireC.lua local fireElement = {} addEvent("FireServer.rootFireCreate",true) addEventHandler("FireServer.rootFireCreate",getRootElement(),function(rand) local fire = createFire(FirePositions[rand][1], FirePositions[rand][2], FirePositions[rand][3], FirePositions[rand][4], FirePositions[rand][5], FirePositions[rand][6]) fireElement[#fireElement + 1] = fire end) addEventHandler ("onClientResourceStart", getRootElement(), function (res) if res ~= getThisResource() then return end triggerServerEvent("FireServer.loadMe", localPlayer, localPlayer) end) function draw() for k,v in ipairs(getElementsByType("object")) do if getElementData(v, "Fire->object") then local x, y ,z = getElementPosition(v) local wx, wy, wz = getScreenFromWorldPosition(x , y, z+1) if wx and wy then local playerx, playery, playerz = getElementPosition(getLocalPlayer()) if getDistanceBetweenPoints3D(playerx, playery, playerz, wx, wy, wz) <= 5 then dxDrawRectangle(wx-200/2,wy,200,30,tocolor(0,0,0,255/2)) dxDrawRectangle(wx-200/2+5,wy+5,190,20,tocolor(124, 197, 118,255/2)) end end end end end addEventHandler("onClientRender", root, draw) FireG.lua FirePositions = { -- X, Y, Z, Range(FireSize) [1] = {2114.1240234375, -1756.2508544922, 13.3984375, 800}, } FireS.lua local loadedPlayers = {} local fireBar = {} FireServer = {} function FireServer.start(player) loadedPlayers[#loadedPlayers + 1] = player end addEvent("FireServer.loadMe", true) addEventHandler("FireServer.loadMe", root, FireServer.start) function FireServer.FireCreate() if math.random(1, 3) == 2 then local rand = math.random(#FirePositions) if fireBar[rand] then return end for k,v in pairs(loadedPlayers) do triggerClientEvent(v, "FireServer.rootFireCreate", v, rand) fireBar[rand] = createObject(1337, FirePositions[rand][1], FirePositions[rand][2], FirePositions[rand][3] - 1) setElementAlpha(fireBar[rand], 0) setElementCollisionsEnabled(fireBar[rand], false) setElementData(fireBar[rand], "Fire->object", true) end end end setTimer(FireServer.FireCreate, 1000, 0)
  25. To fazendo um painel para trocar senha e grupo da base porem toda vez que troco pelo painel de grupo não tenho mas acesso a base só se eu dar restart na resource, tentei usar setTimer, mas começa a da lagger por causa da verificação todo momento -- Server side function GroupMTA() for index, Cord in ipairs(Bases_Colisions) do local ColBase = createColCuboid(Cord[1],Cord[2],Cord[3],Cord[4],Cord[5],Cord[6]) -- x,y,z,rx,ry,rz addEventHandler( "onColShapeHit",ColBase,EnterInBase) addEventHandler( "onColShapeLeave",ColBase,ExitInBase) setElementData(ColBase,"GangCol",NameGroup) --Nome do clã/grupo end end addEventHandler("onResourceStart",getResourceRootElement(getThisResource()),GroupMTA) to a procura de uma forma que não fique lagger no alarme e que automaticamente quando o player troca o nome do clã/grupo ele tenha acesso a base sem reiniciar a resource
×
×
  • Create New...