-
Posts
3,875 -
Joined
-
Days Won
67
Everything posted by DNL291
-
Server: function ung() local team = getTeamFromName ("Unemployed") if (team) then setPlayerTeam ( source, team ) outputChatBox("Freeroam toiminnot kytketty pois käytöstä!", source, 0,255,0) end end addEvent( "un", true ) addEventHandler( "un", root, ung)
-
You're welcome.
-
local availible_cars = { [403]=true, [413]=true, [414]=true, [433]=true, [440]=true, [455]=true, [456]=true, [459]=true, [498]=true, [499]=true, [514]=true, [515]=true, [578]=true, [609]=true } if availible_cars[getElementModel(veh)] then outputChatBox("true") else outputChatBox("false") end
-
Here's the shader list: https://wiki.multitheftauto.com/wiki/Shader_examples
-
@StevyDK: Will only work with the pistol because it will check if weapon ID is 22, if you want to it for all weapons then remove it.
-
Use resourceRoot instead of getRootElement(), unless you want to create the ped when any resource is started. Try: setPedAnimation(John, "ped", "FF_Sit_Eat1", -1, true, false) Edit: You have set the block argument wrong. Try this: function MGPED () local John = createPed (ID, 359.14141, 173.59044, 1008.37262, -90 ) setElementInterior (John, 3 ) setTimer(setPedAnimation, 90, 1, John, "FOOD", "FF_Sit_Eat1", -1, true, false) end addEventHandler ("onResourceStart", resourceRoot, MGPED ) Set the model ID.
-
Remove addEvent( "onPlayerWasted", true ); local bodyparts = { [9] = 2, [8] = 1, [7] = 1, [6] = 1, [5] = 1, [4] = 1, [3] = 1 } addEventHandler( "onPlayerWasted", root, function (ammo, killer, weapon, bodypart ) if killer and killer ~= source then if weapon == 22 then setPedStat( killer, 69, getPedStat( killer, 69 ) + bodyparts[bodypart] ); end end end );
-
@StevyDK: Try this: exports.scoreboard:addScoreboardColumn('Rank') addEventHandler("onPlayerLogin", root, function(_, account) local kills = getAccountData(account, "kills") if kills then if (kills >= 0) and (kills <= 4) then setElementData(source,"Rank","ranks/1.png") elseif (kills >= 5) and (kills <= 99) then setElementData(source,"Rank","ranks/2.png") elseif (kills >= 100) and (kills <= 249) then setElementData(source,"Rank","ranks/3.png") elseif (kills >= 250) and (kills <= 499) then setElementData(source,"Rank","ranks/4.png") elseif (kills >= 500) and (kills <= 999) then setElementData(source,"Rank","ranks/5.png") elseif (kills >= 1000) and (kills <= 1499) then setElementData(source,"Rank","ranks/6.png") elseif (kills >= 1500) and (kills <= 1999) then setElementData(source,"Rank","ranks/7.png") elseif (kills >= 2000) and (kills <= 2999) then setElementData(source,"Rank","ranks/8.png") elseif (kills >= 3000) and (kills <= 3999) then setElementData(source,"Rank","ranks/9.png") end end end)
-
I did not mean it. Both will do the same thing and it's not the problem.
-
call(getResourceFromName("scoreboard"), "addScoreboardColumn", "Rank") And exports.scoreboard:addScoreboardColumn('Rank') Will not make any difference.
-
Try this: function design () playSound ("http://www.181.fm/winamp.pls?station=181-power&style=&description=Power%20181%20(Top%2040)&file=181-power.pls") showCursor ( true ) -- Panels -- local panels = { ["bg"] = guiCreateStaticImage(0.00, 0.00, 1.00, 1.00, "img/bg.png", true), ["acc"] = guiCreateStaticImage(0.29, 0.24, 0.14, 0.22, "img/acc.png", true), ["boxid"] = guiCreateStaticImage(0.43, 0.30, 0.23, 0.06, "img/box.png", true), ["boxpass"] = guiCreateStaticImage(0.43, 0.36, 0.23, 0.06, "img/box.png", true), } -- Panels -- -- guiSetEnabled -- guiSetEnabled ( panels["bg"], false ) guiSetEnabled ( panels["acc"], false ) guiSetEnabled ( panels["boxid"], false ) guiSetEnabled ( panels["boxpass"], false ) -- guiSetEnabled -- -- Labels -- name = guiCreateLabel(0.45, 0.24, 0.21, 0.03,getPlayerName( localPlayer ):gsub("#%x%x%x%x%x%x", "") .."", true, bg) state = guiCreateLabel(0.45, 0.27, 0.23, 0.03, "Unlogged", true, bg) -- Labels -- -- Settings -- local font = guiCreateFont( "lithos.ttf", 13 ) local font2 = guiCreateFont( "lithos.ttf", 18 ) guiSetFont( name, font2 ) guiSetFont( state, font ) -- Settings -- -- Buttons -- local buttons = { ["btn"] = guiCreateStaticImage(0.628, 0.37, 0.02, 0.032, "img/log.png", true, bg ) } -- Buttons -- -- Alpha -- guiSetAlpha ( buttons["btn"], 0.75 ) -- Alpha -- -- Handlers -- addEventHandler( "onClientMouseEnter", guiRoot, function() if source == buttons["btn"] then guiSetAlpha ( source, 1 ) end end ) addEventHandler("onClientMouseLeave", guiRoot, function() if source == buttons["btn"] then guiSetAlpha ( source, 0.75 ) end end ) -- Handlers -- end addEventHandler( "onClientResourceStart", resourceRoot, design )
-
And what do you changed in that code? You just removed the onClientMouseEnter event of the design function. Also, it will not work because the table buttons was created locally.
-
The 1st argument of the guiSetAlpha function is the gui element not the player element. @papam77 Try this: function design () playSound ("http://www.181.fm/winamp.pls?station=181-power&style=&description=Power%20181%20(Top%2040)&file=181-power.pls") showCursor ( true ) -- Panels -- local panels = { ["bg"] = guiCreateStaticImage(0.00, 0.00, 1.00, 1.00, "img/bg.png", true), ["acc"] = guiCreateStaticImage(0.29, 0.24, 0.14, 0.22, "img/acc.png", true), ["boxid"] = guiCreateStaticImage(0.43, 0.30, 0.23, 0.06, "img/box.png", true), ["boxpass"] = guiCreateStaticImage(0.43, 0.36, 0.23, 0.06, "img/box.png", true), } -- Panels -- -- guiSetEnabled -- guiSetEnabled ( panels["bg"], false ) guiSetEnabled ( panels["acc"], false ) guiSetEnabled ( panels["boxid"], false ) guiSetEnabled ( panels["boxpass"], false ) -- guiSetEnabled -- -- Labels -- name = guiCreateLabel(0.45, 0.24, 0.21, 0.03,getPlayerName( localPlayer ):gsub("#%x%x%x%x%x%x", "") .."", true, bg) state = guiCreateLabel(0.45, 0.27, 0.23, 0.03, "Unlogged", true, bg) -- Labels -- -- Settings -- local font = guiCreateFont( "lithos.ttf", 13 ) local font2 = guiCreateFont( "lithos.ttf", 18 ) guiSetFont( name, font2 ) guiSetFont( state, font ) -- Settings -- -- Buttons -- local buttons = { ["btn"] = guiCreateStaticImage(0.628, 0.37, 0.02, 0.032, "img/log.png", true, bg ) } -- Buttons -- -- Alpha -- guiSetAlpha ( buttons["btn"], 0.75 ) -- Alpha -- -- Handlers -- addEventHandler( "onClientMouseEnter", guiRoot, function(aX, aY) for key,gui in pairs (buttons) do if source == gui then guiSetAlpha ( source, 1 ) end end end ) -- Handlers -- end addEventHandler( "onClientResourceStart", resourceRoot, design )
-
Mta Erro network trouble
DNL291 replied to douglasf's topic in Ajudas relacionadas ao MTA:SA (Cliente/Servidor)
É um problema com a nova versão do MTA (Parece que o download do meu mapa ficou um pouco mais lento também. Mas não chega nem a 1 MB). Baixe a última atualização do MTA e veja se o problema continua. Se continuar, tente usar a versão 1.3.2 até que esse problema seja resolvido. -
Try this: local gate1 = createObject ( 16773, 2506.5, -2110.5, 16.5, 0, 0, 0) local gate2 = createObject ( 16773, 2521.1000976563, -2110.5, 16.5, 0, 0, 0) function MoveObject (thePlayer) local team = getPlayerTeam(thePlayer) local x, y, z = getElementPosition(thePlayer) local distance = getDistanceBetweenPoints3D(2513.6999511719, -2110.6000976563, 13.5, x, y, z) if (distance <= 10) then if (team==getTeamFromName("ZombieTeam")) then moveObject (gate1, 5000, 2494.5, -2110.3000488281, 16.5) moveObject (gate2, 5000, 2532.6000976563, -2110.1000976563, 16.5) setTimer (moveBack, 6500, 1) outputChatBox ("Welcome", thePlayer, 0, 255, 0) end end end addCommandHandler ("gate", MoveObject) function moveBack () moveObject (gate1, 5000, 2506.5, -2110.5, 16.5) moveObject (gate2, 5000, 2521.1000976563, -2110.5, 16.5) end
-
[Sistema ANTI-BUG] Ajuda para criar - MTA DayZ
DNL291 replied to ZueiraPlays's topic in Programação em Lua
Qual é o problema? O jogador não é banido ou você quer corrigir essa parte que causa o "Bug"? É estranho banir o jogador por 2 dias por ele fazer isso, ele pode fazer sem querer (mesmo que seja 3 alertas). Isso pode ser evitado pelo próprio script, e qualquer bug que for encontrado, só corrigi-lo editando o script. -
https://community.multitheftauto.com/in ... ls&id=2372 Antes de abrir um tópico pedindo algum recurso, pesquise pela community.multitheftauto.com. E também, responda no outros tópicos que você abriu e não precisa enviar mensagem privada.
-
Problema no meu MTA alguem me ajuda?
DNL291 replied to Zero.o's topic in Ajudas relacionadas ao MTA:SA (Cliente/Servidor)
Tem certeza que está na guia Internet? -
I did not understand why you added some vehicle IDs in SwatCars table and you used for-loop to add all vehicle IDs in SwatCars table.