Jump to content

Banex

Members
  • Posts

    230
  • Joined

  • Last visited

Everything posted by Banex

  1. Eu testei o código que eu postei aqui, e funcionou perfeitamente.
  2. tente isso: function addPlayerSkin (skin) local current = getElementData(source,"skin") local name = getSkinNameFromID(current) setElementData(source,name,(getElementData(source,name) or 0)+1) setElementData(source,skin,(getElementData(source,skin) or 0)-1) local id = getSkinIDFromName(skin) setElementData(source,"skin",id) setElementModel(source,id) triggerClientEvent(source,"refreshInventoryManual",source) end addEvent("onPlayerChangeSkin",true) addEventHandler("onPlayerChangeSkin",getRootElement(),addPlayerSkin)
  3. Alem das soluções apresentadas acima, você pode diminuir o tamanho de arquivos .txd, veja na pagina da wiki. E sempre evite colocar mods pesados, porque isso pode causar lag em quem não tem um computador muito bom.
  4. No MTA 1.4 é necessário usar uma API. No MTA 1.5 foi implantado um framework chamado CEF. Graças a ele, será possível carregar paginas da web no MTA.
  5. serials = { ["0116586626DD995B46B8B69F1A1B1BE3"] = true, } function onPlayerLogin() if serials[getPlayerSerial(source)] then setElementData(source, "MAX_Slots",-1) --outputDebugString(getElementData(source,"MAX_Slots")) end end addEventHandler("onPlayerLogin",root,onPlayerLogin)
  6. Para construir uma tabela é necessário somente usar a expressão {} . Exemplo: tabela = {} -- constrói uma tabela vazia e atribui a variável tabela O loop for não vai retornar todos os valores de uma só vez. Ele vai repetir retornando o indicie e o valor de cada campo da tabela. Exemplo: tabela = {"a","b","c"} for indice, valor in pairs(tabela) do outputChatBox("índice: "..indice..". Valor: "..valor) --[[ resultado: índice: 1. Valor: a índice: 2. Valor: b índice: 3. Valor: c --]] end Você também pode mudar o valor do índice. Exemplo: tabela = {["i"] = "v"} -- índice = i, valor = v Caso você queria obter todos os valores da tabela de uma só vez. você pode usar a função table.contact . Exemplo: tabela = {"a","b","c"} outputChatBox(table.concat(tabela,", ")) -- resultado: a, b, c
  7. Você precisa somente remover o loop-for spawns = { {-2142.9504394531,-2356.3515625,37.765151977539}, {-2142.9504394531,-2356.3515625,50.765151977539}, } function scriptdetest () local points2 = spawns [ math.random( #spawns) ] local x,y,z = points2[1],points2[2],points2[3] --createVehicle(548,x,y,z,nil,nil,nil) outputChatBox(points2[3]) outputChatBox( "OK SUCESSO" ) end addCommandHandler( "eventoon", scriptdetest )
  8. tente isso e veja oque getElementInterior esta retornando no debugscript. function onPlayerPitchATent(itemName) setElementData(source,itemName,getElementData(source,itemName)-1) setPedAnimation (source,"BOMBER","BOM_Plant",-1, false, false, false, false) setTimer(function(player) if isElement(player) then local x,y,z = getElementPosition(player) local xr,yr,zr = getElementRotation(player) px, py, pz = getElementPosition(player) prot = getPedRotation(player) local offsetRot = math.rad(prot+90) local vx = px + 5 * math.cos(offsetRot) local vy = py + 5 * math.sin(offsetRot) local vz = pz + 2 local vrot = prot+180 tent = createObject(3243,vx,vy,z-1,0,0,vrot) outputDebugString(getElementInterior(player)) setElementInterior(tent,getElementInterior(player)) setObjectScale(tent,1.3) 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) setElementData(tentCol,"MAX_Slots",100) triggerClientEvent(player,"refreshInventoryManual",player) end end,1500,1,source) end addEvent("onPlayerPitchATent",true) addEventHandler("onPlayerPitchATent",getRootElement(),onPlayerPitchATent)
  9. Aqui está mostrando que as portas estão fechadas.
  10. Inicie os resources resourcebrowser, resourceManager, webadmin e webmap. Em seu navegador, acesse o link http://serverip:httpport/ (substitua serverip e httpport pelos valores dos mesmos) e faça login usando uma conta de administrador no servidor. Em seguida, vá na guia Performance stats
  11. O uso do CPU pode sim interferir no ping. Você tambem pode usar o resourcebrowser para saber a porcentagem que cada resource está usando do CPU. E sobre sua outra pergunta, eu uso a OVH.
  12. Você pode ver todos os comandos do MTA aqui.
  13. Este é um comando nativo do MTA, e não há como remove-lo. Se você quiser bloqueá-lo, você pode usar este codigo: function onCommand(command) if command = "msg" then cancelEvent() end end addEventHandler("onPlayerCommand", root,onCommand)
  14. Não precisa fazer flood, ninguém é cego aqui.
  15. Banex

    Position name

    http://lmgtfy.com/?q=area+names+of+gta+sa#
  16. RooTs, você não pode ficar fazendo isso para seu tópico permanecer no topo. Isso é considerado como spam...
  17. Porque você disse que foi você quem criou este tópico, mas na verdade quem criou foi o SpoC^.
  18. Sem querer sair fora do assunto do tópico, mas, você é o SpoC^ ?
  19. bindKey("mouse2","up",function() guiSetVisible(mirasd, true) end) bindKey("mouse2","down",function() guiSetVisible(mirasd, false) end)
  20. Eu acho que o #RooTs esqueceu de dizer isso. MrBugsFive, mude 1280, 720 pela resolução que você usa no MTA.
  21. no arquivo fr_client.lua, substitua a função toggleFRWindow por esta: local forbiddenDimensions = {1,2,3} -- dimensões proibidas function toggleFRWindow() if isWindowOpen(wndMain) then showCursor(false) hideAllWindows() colorPicker.closeSelect() else for k, v in ipairs(forbiddenDimensions) do if v == getElementDimension(localPlayer) then return end end showCursor(true) showAllWindows() end end
×
×
  • Create New...