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. Não sei quase nada de scripts Eu quero fazer que quando um jogar matar o outro recebera 6 nives de procurado function client_kill_ped(ped, killer, body_part) if not ped or not isElement(ped) or isPedDead(ped) or getPedOccupiedVehicle(ped) then return end if not killer or not getElementType( attacker ) == "player" ) then end local px,py,pz = getElementPosition(ped) local kx,ky,kz = getElementPosition(killer) if getDistanceBetweenPoints3D(px,py,pz, kx,ky,kz) > 10 then return end killPed(ped, killer, 255, body_part, false) setWl(killer, 6.0, 60, "Você cometeu o crime de assassinato") US: I know almost nothing about scripts I want to do that when one player kills the other he receives 6 levels of wanted
  2. Então estou tendo problema com a renderização dos objetos em um dos mapa que eu fiz, e tava querendo uma ajuda com esse problema, já usei a função engineGetModelLODDistance e não funcionou, pelo que eu entendi do bug deve ser pela quantidade de objeto que o mapa tem e está fazendo carregar a onde o jogador estivar... https://imgur.com/a/eigAb
  3. Hello everyone. I made duty script for mta dayz. I have looking around lot of times and i haven't seen one that works fine. Then i thought i can do it. And today i release this. It's fully editable. But you have to give a credit in meta! Features: UP COMMING: Before download i want do say Please give me +rep for making this script for free. Thats all!! Download: Github, google,mtasacommunity
  4. addCommandHandler("mask",function(player,cmd,maskName) for c,mask in pairs(maskTable)do if string.lower(mask[1]) == maskName then setElementData(player,mask[3],true) triggerClientEvent("onRollMessageStart",player,"| MASK |#FFFFFF /mask "..mask[1].." "..mask[2].."!",50,255,50) return end end triggerClientEvent("onRollMessageStart",player,"#f84300| ERRO | Digite: /mask [1 á 6]",248,67,0) end) maskTable = { {'1','Mask Stylo 1','MaskStylo1'}, {'2','Mask Stylo 2','MaskStylo2'}, {'3','Mask Stylo 3','MaskStylo3'}, {'4','Mask Stylo 4','MaskStylo4'}, {'5','Mask Stylo 5','MaskStylo5'}, {'6','Mask Stylo 6','MaskStylo6'}, } Boa noite, tava querendo uma ajuda com o sistema de mascara, quando o jogador digitar /mask 1 a mascara que ele estiver usando... Exemplo: dei /mask 1 e quero ir vendo as mascaras ai digito /mask 2 ai a mascara 1 tem que sumir e aparecer a mascara 2 alguem pode me da uma ideia de como posso ta fazendo isso ?
  5. 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:/)
  6. 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")
  7. I'm really new at scripting, i may wanted to know how to create a vip system like: check time remaining, command to add vip to a player by his name and to remove
  8. 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??
  9. 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 ...
  10. 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?
  11. 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?
  12. 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?
  13. 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!!!.
  14. The default max money is 99 999 999$. Can i this max money increase to (for example) 200 000 000$?
  15. 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?
  16. 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??
  17. 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
  18. 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
  19. 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
  20. 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
  21. 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
  22. 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?
  23. 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?
  24. 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
  25. 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)
×
×
  • Create New...