-
Posts
3,875 -
Joined
-
Days Won
67
Everything posted by DNL291
-
I tested this code and it worked for me (on the chatbox). --SwatCars = {416, 427, 490, 528, 523, 470, 598, 596, 597, 599, 601, 428, 541, 579, 560, 451, 495, 426, 551} local SwatCars = {} function swatcars() for v = 400, 611 do if ( getVehicleNameFromModel ( v ) ~= "" ) then table.insert( SwatCars, { model = v, name = getVehicleNameFromModel ( v ) } ) end end table.sort( SwatCars, function(a, b) return a.name < b.name end ) for index, swatcar in ipairs(SwatCars) do local row = guiGridListAddRow (CarGridswat) guiGridListSetItemText ( carGridswat, row, nameColswat, swatcar.name, false, false ) end end addEventHandler("onClientResourceStart", resourceRoot, swatcars)
-
Add each colshape for a table. local R = 255 --------------------------------- local G = 0 --This sets Radar Areas Color-- local B = 0 --------------------------------- local A = 125 -- Alpha local allAreas = {} local allColshapes = {} local turfs = { areas = { {918.95215, 1650.05286,65.546630859375,168.57604980469, R,G, B, A}; {1877.18555, 642.92706, 100, 125, R,G, B, A}; {1997.5, 683.15210, 140, 65, R,G, B, A}; {2155, 643.28558, 122.5, 65, R,G, B, A}; {2290, 640, 120, 70, R,G, B, A}; {2515, 702, 160, 70, R,G, B, A}; {1575, 660, 175, 125, R,G, B, A}; {2775, 835,120,189.79992675781, R,G, B, A}; {1017.66577, 1383.37659,159.2412109375,319.53955078125, R,G, B, A}; {1295.58142, 2099.19238,135,123, R,G, B, A}; {1577.30359, 2282.80029,179.78796386719,61.214599609375, R,G, B, A}; {1628.58630, 2023.49329,68.798461914063,139.65148925781, R,255, B, A}; {1837.53394, 2184.07544,78.707885742188,77.761474609375, R,G, B, A}; {1993.63599, 2122.64014,113.74291992188,73.606201171875, R,G, B, A}; }, colshapes = { {1877.18555, 642.92706, 9.8, 100.05969238281, 120.13433837891, 13}; {1997.5, 683.15210, 9.8, 140, 60, 13}; {2157.44653, 643.28558, 9.8, 119.50463867188, 60.064758300781, 13}; {2303.51489, 642.98639, 9.8, 113.763671875, 59.806884765625, 13}; {2517.10059, 702.93488, 9.8, 160.19873046875, 60.3056640625, 13}; {1577.50818, 663.07349, 9.8, 180.07995605469, 119.92926025391, 13}; {2776.77539, 833.34174, 9.89844, 118.11865234375, 189.79992675781, 15}; {1017.66577, 1383.37659, 5, 159.2412109375, 319.53955078125, 15}; {918.95215, 1650.05286, 7.64844, 65.546630859375, 168.57604980469, 15}; {1295.58142, 2099.19238, 9, 135, 123, 20}; {1577.30359, 2282.80029, 9.75, 179.78796386719, 61.214599609375, 17}; {1397.97644, 2323.18579, 10, 159.28210449219, 59.93896484375, 17}; {1577.84595, 2182.70288, 10, 139.12902832031, 80.190185546875, 17}; {1628.58630, 2023.49329, 9, 68.798461914063, 139.65148925781, 17}; } }; local aIndex = 0 local colIndex = 0 for key, value in ipairs( turfs.areas ) do aIndex = aIndex+1 allAreas[aIndex] = createRadarArea( unpack( value ) ); end for key, value in ipairs( turfs.colshapes ) do colIndex = colIndex+1 allColshapes[colIndex] = createColCuboid( unpack( value ) ); setElementData(allColshapes[colIndex],"Owner","N/A") end -------- Turf 1 -------- local pCubo = colshape local pRadar = area addEventHandler("onColShapeHit", root, function( player ) for i=1, #allColshapes do if (source == allColshapes[i]) then outputChatBox ("TEST") break end end end )
-
Try this: for index, swatcar in ipairs(SwatCars) do local row = guiGridListAddRow (CarGridswat) guiGridListSetItemText ( carGridswat, row, nameColswat, swatcar.name, false, false ) end
-
function WeaponLevels (killer, weapon) if killer then local Nothing = getPedStat(killer, 69) if Nothing <= 100 and weapon == 22 then guiSetText (GUIEditor.label[3], "Level: 1") elseif Nothing <= 200 and Nothing > 100 and weapon == 22 then guiSetText (GUIEditor.label[3], "Level: 2") elseif Nothing <= 300 and Nothing > 200 and weapon == 22 then guiSetText (GUIEditor.label[3], "Level: 3") elseif Nothing <= 400 and Nothing > 300 and weapon == 22 then guiSetText (GUIEditor.label[3], "Level: 4") elseif Nothing <= 500 and Nothing > 400 and weapon == 22 then guiSetText (GUIEditor.label[3], "Level: 5") elseif Nothing <= 600 and Nothing > 500 and weapon == 22 then guiSetText (GUIEditor.label[3], "Level: 6") elseif Nothing <= 700 and Nothing > 600 and weapon == 22 then guiSetText (GUIEditor.label[3], "Level: 7") elseif Nothing <= 800 and Nothing > 700 and weapon == 22 then guiSetText (GUIEditor.label[3], "Level: 8") elseif Nothing <= 900 and Nothing > 800 and weapon == 22 then guiSetText (GUIEditor.label[3], "Level: 9") elseif Nothing <= 1000 and Nothing > 900 and weapon == 22 then guiSetText (GUIEditor.label[3], "Level: 10") end else outputChatBox("'killer' does not exist.") end end addEventHandler( "onClientRender",getRootElement(), WeaponLevels) Try it.
-
Make sure the killer is a player element and not a nil/false value.
-
Try removing: addEvent( "onZombieWasted", true );
-
Show us where is GUIEditor.label[3] defined.
-
I did not put 'if Nothing = 100 ...' in my code. Make sure you updated that resource on the server.
-
I fixed an error, try it again.
-
Try the code I edited above.
-
Try this: function WeaponLevels (killer, weapon, bodypart) local Nothing = tonumber(getPedStat(killer, 69)) if Nothing <= 100 and weapon == 22 then guiSetText (GUIEditor.label[3], "Level: 1",Nothing) elseif Nothing <= 200 and Nothing > 100 and weapon == 22 then guiSetText (GUIEditor.label[3], "Level: 2",Nothing) elseif Nothing <= 300 and Nothing > 200 and weapon == 22 then guiSetText (GUIEditor.label[3], "Level: 3",Nothing) elseif Nothing <= 400 and Nothing > 300 and weapon == 22 then guiSetText (GUIEditor.label[3], "Level: 4",Nothing) elseif Nothing <= 500 and Nothing > 400 and weapon == 22 then guiSetText (GUIEditor.label[3], "Level: 5",Nothing) elseif Nothing <= 600 and Nothing > 500 and weapon == 22 then guiSetText (GUIEditor.label[3], "Level: 6",Nothing) elseif Nothing <= 700 and Nothing > 600 and weapon == 22 then guiSetText (GUIEditor.label[3], "Level: 7",Nothing) elseif Nothing <= 800 and Nothing > 700 and weapon == 22 then guiSetText (GUIEditor.label[3], "Level: 8",Nothing) elseif Nothing <= 900 and Nothing > 800 and weapon == 22 then guiSetText (GUIEditor.label[3], "Level: 9",Nothing) elseif Nothing <= 1000 and Nothing > 900 and weapon == 22 then guiSetText (GUIEditor.label[3], "Level: 10",Nothing) end end addEventHandler( "onClientRender",getRootElement(), WeaponLevels)
-
Use dxDrawText instead of guiSetText.
-
You did not understand what i said. You need not use addEvent because onZombieWasted is a custom event of the zombie resource.
-
Okay gonna try it and what ~= mean? ==: Equality ~=: Difference You did not triggered the onZombieWasted event and not sending the parameters: killer, weapon, bodypart. You must use the onZombieWasted event of your zombie resource/gamemode.
-
engineLoadTXD engineImportTXD engineLoadDFF engineReplaceModel https://wiki.multitheftauto.com/wiki/Slothman/Slothbot
-
Try this: Server addEvent( "onZombieWasted", true ); addEventHandler( "onZombieWasted", root, function ( killer, weapon, bodypart ) if killer and killer ~= source then if bodypart == 9 and weapon == 22 then setPedStat( killer, 69, getPedStat( killer, 69 ) + 1 ); elseif bodypart ~= 9 and weapon == 22 then setPedStat( killer, 69, getPedStat( killer, 69 ) + 0.5 ); end end end );
-
https://community.multitheftauto.com/in ... ls&id=5299
-
The source of the onMarkerHit event is the marker that got hit by the element. Also, check if hS is a player element with getElementType.
-
You're welcome.
-
'thePlayer' isn't defined, use source instead.
-
Tem como deixar o relógio mostrando a hora real?
DNL291 replied to Blouc's topic in Programação em Lua
showPlayerHudComponent() -- Ou setPlayerHudComponentVisible() getRealTime()["hour"] getRealTime()["minute"] getRealTime()["second"] -
Use setWorldSoundEnabled para desativar o som que você deseja. E use funções do teclado do jogador para verificar a tecla usada que corresponde a uma ação do veículo (isso com o jogador dentro de um veículo apenas). E toque o som que deseja substituir.
-
Try this: function onClick () local x, y = guiGetScreenSize () edit_Login = guiCreateEdit(x*0.023, y*0.360, x*0.219, y*0.049, "", false ) guiSetFont(edit_Login,"default-bold-small") edit_password = guiCreateEdit(x*0.023, y*0.460, x*0.219, y*0.049, "", false ) guiSetFont(edit_password,"default-bold-small") guiEditSetMaxLength ( edit_Login,25) guiEditSetMaxLength ( edit_password,25) guiEditSetMasked ( edit_password, true ) end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()), onClick ) function Win() local x, y = guiGetScreenSize () dxDrawRectangle ( x*0.016, y*0.278, x*0.234, y*0.035, tocolor ( 0, 255, 0, 255 ) ) dxDrawRectangle ( x*0.016, y*0.278, x*0.234, y*0.486, tocolor ( 0, 0, 0, 155 ) ) dxDrawText("Nick", x*0.024, y*0.324, x*0.235, y*0.353, tocolor ( 255, 255, 255, 255 ), 1.5, "default-bold") dxDrawText("Password", x*0.024, y*0.424, x*0.235, x*0.453, tocolor ( 255, 255, 255, 255 ), 1.5, "default-bold") end addEventHandler ("onClientRender", getRootElement(), Win )
-
[Informações] Podem me dar um empurrão?
DNL291 replied to Ichigo_Kurosaki's topic in Programação em Lua
addEventHandler "onClientPlayerJoin" isTransferBoxActive setCameraMatrix setElementFrozen E use setTimer para verificar se ainda está baixando, quando terminar o download, defina a cemera para o jogador, descongela ele, etc. -
Eu testei ele no meu server e baixou o client. Não recebi nenhum erro.