Jump to content

Search the Community

Showing results for tags 'lua'.

  • 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. No errors / warnings in debugscript 3... then what wrong in this script? Client: requestBrowserDomains({"www.convertmp3.io"}) local browser = createBrowser( 1, 1, false ) local currentSound = {} addEvent( 'Play' , true ) addEventHandler( 'Play' , root , function( link ) local vehicle = getPedOccupiedVehicle ( source ) local x, y, z = getElementPosition(vehicle) currentSound[source] = playSound3D( link, x, y, z ) attachElements(currentSound[source],vehicle) setSoundMaxDistance(currentSound[source],30) setSoundVolume(currentSound[source],50) end ) function fetch(_,url) if url and url ~= "" then fetchRemote("http://www.convertmp3.io/fetch/?format=JSON&video="..url, callback) end end addCommandHandler("p",fetch) function callback(data, error) if (error ~= 0) then return outputChatBox(error) end if (data == "ERROR") then return outputChatBox("data error") end local data = fromJSON("["..data.."]") if (data) then outputChatBox("Title: "..data.title) outputChatBox("Length: "..data.length) outputChatBox("Link: "..data.link) loadBrowserURL( browser, data.link ) end end addEventHandler( "onClientBrowserNavigate", browser, function( link ) if not link:find("www.convertmp3.io") then triggerServerEvent( 'play' , localPlayer , link ) -- trigger the event when the script actially gets the playable link! end end ) server: addEvent( 'play' , true ) addEventHandler( 'play' , root , function( link ) triggerClientEvent( root , 'Play' , client , link ) end )
  2. local table = { {"1", "2", "3", "4"}, } function asdasdsdasdd() table.insert(table,"5","6","7","8") end What wrong? No errors and warnings in debugscript 3...
  3. Olá, Recentemente tive a ideia de adicionar no meu servidor um script de SAMU, mas esse script que eu coloquei, na linha 2 ele possui uma variável que faz para você coloca o tempo, só que ela não funciona, desde então eu estava caçando codigo de tempo na internet e achei um feito pelo @DNL291 que é este: local time addEvent( "onServerCallAddSetTimer", true ) addEventHandler( "onServerCallAddSetTimer", root, function () time = setTimer(function() time = nil removeEventHandler( "onClientRender", root, renderTime ) end, 180000, 1) addEventHandler( "onClientRender", root, renderTime ) end ) function renderTime() local gDetails = getTimerDetails(time) if not gDetails then return end local remainingTime = secondsToTimeDesc( gDetails / 1000 ) dxDrawText( "Tempo de vida restante: "..tostring(remainingTime), left, top, right, bottom ) end function secondsToTimeDesc( seconds ) if seconds then local results = {} local sec = ( seconds %60 ) local min = math.floor ( ( seconds % 3600 ) /60 ) local hou = math.floor ( ( seconds % 86400 ) /3600 ) local day = math.floor ( seconds /86400 ) if day > 0 then table.insert( results, day .. ( day == 1 and " day" or " days" ) ) end if hou > 0 then table.insert( results, hou .. ( hou == 1 and " hour" or " hours" ) ) end if min > 0 then table.insert( results, min .. ( min == 1 and " minute" or " minutes" ) ) end if sec > 0 then table.insert( results, sec .. ( sec == 1 and " second" or " seconds" ) ) end return string.reverse ( table.concat ( results, ", " ):reverse():gsub(" ,", " dna ", 1 ) ) end return "" end Mas ai começou os problemas, eu não sei um jeito de colocar este tempo criado por ele conectado com o da samu que é este: hpMin = 15 Tempo = {} ColMedic = {} function getPlayerID(id) v = false for i, player in ipairs (getElementsByType("player")) do if getElementData(player, "ID") == id then v = player break end end return v end --==== function ChecarVida() for i, player in pairs (getElementsByType("player")) do if not getElementData(player, "PlayerCaido") then local conta = getAccountName(getPlayerAccount(player)) if getElementHealth(player) >= 1 then if getElementHealth(player) <= hpMin then removePedFromVehicle(player) setElementData(player, "PlayerCaido", true) setElementFrozen(player, true) setPedAnimation(player, "CRACK", "crckdeth3", 1, false, true, false) setTimer(function() if getElementData(player, "PlayerCaido") then killPed(player) end end, 240000, 1) end end else setPedAnimation(player, "CRACK", "crckdeth3", 1, false, true, false) end end end setTimer(ChecarVida, 200, 0) function ChecarVidaA() for i, player in pairs (getElementsByType("player")) do if getElementData(player, "PlayerCaido") then local conta = getAccountName(getPlayerAccount(player)) if getElementHealth(player) >= 31 then setElementData(player, "PlayerCaido", false) setPedAnimation(player, false) setElementFrozen(player, false ) end end end end setTimer(ChecarVidaA, 200, 0) function SetarCaidoComHS() player = source if not getElementData(player, "PlayerCaido") then removePedFromVehicle(player) setElementHealth(player, 20) setElementData(player, "PlayerCaido", true) setPedAnimation(player, "CRACK", "crckdeth3", 1, false, true, false) setTimer(function() if getElementData(player, "PlayerCaido") then killPed(player) end end, 240000, 1) end end addEvent("OnHS", true) addEventHandler("OnHS", getRootElement(), SetarCaidoComHS) function curar_jogador ( thePlayer, comando, id ) if id then id = tonumber ( id ) if id then local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Bombeiros") ) then local player_a_ser_curado = getPlayerID(id) if not player_a_ser_curado then return outputChatBox("#bebebeJogador não encontrado!",thePlayer,255,255,255,true) end local samux, samuy, samuz = getElementPosition ( thePlayer ) local curadox, curadoy, curadoz = getElementPosition ( player_a_ser_curado ) local dist = getDistanceBetweenPoints3D ( samux, samuy, samuz, curadox, curadoy, curadoz ) if player_a_ser_curado == thePlayer then outputChatBox("#bebebeVocê não pode se curar!",thePlayer,255,255,255,true) return end if ( dist > 3 ) then outputChatBox("#bebebeChegue mais perto do jogador!", thePlayer, 255, 255, 255, true) elseif ( dist < 3 )then setPedAnimation( thePlayer, "MEDIC", "CPR", 4500, true, false, false, false) setTimer ( function() if not isElement(player_a_ser_curado) then return end setElementHealth ( player_a_ser_curado, 100 ) setPedAnimation(player_a_ser_curado, false) setElementFrozen( player_a_ser_curado, false ) setElementData(player_a_ser_curado,"PlayerCaido",false) end, 4500, 1 ) end end else outputChatBox("#bebebe["..comando.."]: id inválido", thePlayer, 255, 255, 255, true) end else outputChatBox("#bebebeSintaxe: /"..comando.." [id]", thePlayer, 255, 255, 255, true) end end addCommandHandler ( "curar", curar_jogador ) Se alguém pode me ajudar fico agradecido, e obrigado se viu este POST
  4. Estou fazendo um sistema pra quando o policial bater no player ele segue o mesmo e quando o policial entrar na viatura ele ir pro porta mala, só que o player ta girando de acordo com o movimento da vtr, alguem sabe como deixar ele freezado lá dentro? function Teleport_Cap_Vei ( state, player , vehicle , seat ) if state == true then if seat and isElement ( vehicle ) then vrx, vry, vrz = getElementRotation(vehicle) setElementRotation(player, vrx, vry, vrz+83) attachElements (player, vehicle, 0.2, -1.5, 0, 0,0,90) setPedAnimation (player, 'ped','CAR_dead_LHS') setElementData ( player, "Policia:Captura", false ) setElementData(player, "Mrx_Preso", true)
  5. Preciso de ajuda para setar uma animação pra um npc quando um comando for dado OBS: Preciso de ajuda no setPedAnimation, Pois o resto esta funcionando certinho Medico = createPed (70, 1187.1165771484,-1323.5570068359,13.559015274048) function curar(player) setElementHealth(player, 100) outputChatBox("Voce foi curado com sucesso!", player, 0, 255, 255) takePlayerMoney(player, 500) setPedAnimation(Medico, "ped", "coptraf_stop") end
  6. Estou com uma dúvida um tanto quanto pertinente. Quando faço um teleporte por maker por exemplo para um interior, quando o player é teleportado a câmera ao invés de ficar nas costas dele fica ao lado. Como faço para resolver ? PS: Já tentei o "setCameraTarget". Segue print abaixo para maiores detalhes: https://i.imgur.com/ClGFMrq.png
  7. Server-Side possui 2 arquivos. 1: factor = 0.03 function createVehicles(player) for i,v in ipairs(getElementsByType("vehicle")) do fuel = math.random(70,80) setElementData(v, "fuel", fuel) end end function processFuel(player) for i,v in ipairs(getElementsByType("vehicle")) do local fuel = getElementData(v, "fuel") or math.random(70,80) if (getVehicleEngineState(v) and fuel > 0 ) then fuel = fuel - factor end if (fuel <= 0.99) then fuel = 0 setVehicleEngineState(v, false) end setElementData(v, "fuel", fuel) end end createVehicles() setTimer(processFuel, 1000, 0) 2: local addingFuel = {} addEvent("onVehicleRefulling", true) function vehicleRefulling(v) if (getPlayerMoney(source) < 5) then outputChatBox("#000000[ #FF0000GASOLINA #000000] #ffffffVocê não tem dinheiro $10", source, 255, 255, 255, true) else setElementData(v, "fuel", getElementData(v, "fuel") + 1) takePlayerMoney(source, 5) end end addEventHandler("onVehicleRefulling", root, vehicleRefulling) addEvent("onVehicleRefullingFull", true) function vehicleRefullingf(v) gabas = 100 - getElementData(v, "fuel") if (getPlayerMoney(source) < tonumber(gabas*5)) then outputChatBox("#000000[ #FF0000GASOLINA #000000] #ffffffVocê não tem dinheiro $"..convertNumber (gabas*5).."", source, 255, 255, 255, true) else setElementData(v, "fuel", getElementData(v, "fuel")+gabas+1) takePlayerMoney(source, tonumber(gabas*5)) end end addEventHandler("onVehicleRefullingFull", root, vehicleRefullingf) function convertNumber ( number ) local formatted = number while true do formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2') if ( k==0 ) then break end end return formatted end Client-Side: local sx,sy = guiGetScreenSize() local px,py = 1366,768 local x,y = (sx/px), (sy/py) function gas() local vehicle = getPedOccupiedVehicle( getLocalPlayer() ) local gasosa = math.floor(getElementData(vehicle,"fuel") or 11) if ( vehicle ) then dxDrawRectangle(x*1125 - 2, y*718 - 2, x*100 + 4, y*27 + 4, tocolor(0, 0, 0, 140), false) dxDrawRectangle(x*1125, y*718, x*100, y*27, tocolor(0, 0, 0, 30), false) if gasosa <= 100 then dxDrawRectangle(x*1125, y*718, x*100/100*gasosa, y*27, tocolor(243, 0, 0, 255), false) else dxDrawRectangle(x*1125, y*718, x*100, y*27, tocolor(243, 0, 0, 255), false) end end end addEventHandler("onClientRender", root, gas) Como posso fazer para que veículos que não possuam motor, como por exemplo a bike não apareça o indicador de Gasolina ? PS: O lado do server-side não foi eu quem fiz.
  8. This is in 1440x900 (in my resolution): This is in 1920x1080: I calculate the dx elements position with this: local sx_, sy_ = guiGetScreenSize() local sx, sy = sx_/1440, sy_/900 And i draw dx elements like this: dxDrawRectangle(sx / 2 + 290, sy / 2 +240,850,65,tocolor(0,0,0,200)) What wrong??? How can i fix this problem??
  9. Toda vez que spawno um carro ele vem com placa aleatória,queria saber se tem como com um mod de loja,comprar um carro e deixar a placa fixa,toda vez que eu spawnar aquele carro na minha conta.E se é possível ter um mod onde da /placa (codigo da placa) e aparecer informações do carro?
  10. estou fazendo um script de trabalho mas o valor desta função esta dando nil, fiquei horas revisando o script e n achei o erro. function fecharpainel (_,state) if painel == true then if state == "down" then if ( isCursorOnElement (947, 191, 22, 24)) then removeEventHandler("onClientRender", root, paineldx) showCursor (false) painel = false end end end end addEventHandler ("onClientClick", root, fecharpainel) no debug está aparecendo isso " attempt to call global 'isCursoOnElement' (a nil value) se alguém poder me ajudar agradeço.
  11. local sx,sy = guiGetScreenSize() function speed(thePlayer, seat, jacke) local veh = getPedOccupiedVehicle(localPlayer) local fuel = math.floor(getElementData(veh,"fuel") or 100) local hpcar = math.floor(getElementHealth(veh) /10) local getspeed = math.floor(getElementSpeed(veh,"km/h")) if not veh then return end dxDrawImage(sx-310,sy-193,307,177,"files/fon_speed.png") dxDrawImage(sx-235,sy-90,26,26,"files/light_r_off.png") dxDrawImage(sx-300,sy-90,26,26,"files/light_l_off.png") if(getElementData(veh,"rightflash")) then if (getTickCount() % 1400 >= 600) then dxDrawImage(sx-235,sy-90,26,26,"files/light_r_on.png") end end if(getElementData(veh,"leftflash")) then if (getTickCount() % 1400 >= 600) then dxDrawImage(sx-300,sy-90,26,26,"files/light_l_on.png") end end if(getElementData(veh, "allflash")) then if(getTickCount() % 1400 >= 600) then dxDrawImage(sx-235,sy-90,26,26,"files/light_r_on.png") dxDrawImage(sx-300,sy-90,26,26,"files/light_l_on.png") end end if(getVehicleEngineState(veh) == true) then dxDrawImage(sx-125,sy-49,26,26,"files/engine_on.png") elseif(getVehicleEngineState(veh) == false) then dxDrawImage(sx-125,sy-49,26,26,"files/engine_off.png") end if(getVehicleOverrideLights(veh) == 2) then dxDrawImage(sx-180,sy-49,26,26,"files/lights_on.png") else dxDrawImage(sx-180,sy-49,26,26,"files/lights_off.png") end if(isVehicleLocked(veh) == true) then dxDrawImage(sx-70,sy-49,26,26,"files/door_close.png") elseif(isVehicleLocked(veh) == false) then dxDrawImage(sx-70,sy-49,26,26,"files/door_open.png") end if(getspeed >= 100) then dxDrawText(string.format("%s",getspeed),sx-283,sy-145,sx-315,70,tocolor(255,255,255,255),2.5,"default-bold") elseif(getspeed >= 10) then dxDrawText(string.format("%s",getspeed),sx-273,sy-145,sx-315,70,tocolor(255,255,255,255),2.5,"default-bold") elseif(getspeed <= 9) then dxDrawText(string.format("%s",getspeed),sx-265,sy-145,sx-315,70,tocolor(255,255,255,255),2.5,"default-bold") end if(fuel >= 100) then dxDrawRectangle(sx-167,sy-146,fuel*1.4,3,tocolor(225, 150, 48, 255)) dxDrawText(string.format("%s",fuel),sx-75,sy-173,15,15,tocolor(255,255,255,255),1.8) elseif(fuel <= 15) then dxDrawRectangle(sx-167,sy-146,fuel*1.4,3,tocolor(213, 38, 38, 255)) dxDrawText(string.format("%s",fuel),sx-60,sy-173,15,15,tocolor(255,255,255,255),1.8) elseif(fuel <= 25) then dxDrawRectangle(sx-167,sy-146,fuel*1.4,3,tocolor(218,207, 96, 255)) dxDrawText(string.format("%s",fuel),sx-60,sy-173,15,15,tocolor(255,255,255,255),1.8) elseif(fuel <= 9) then dxDrawRectangle(sx-167,sy-146,fuel*1.4,3,tocolor(213, 38, 38, 255)) dxDrawText(string.format("%s",fuel),sx-50,sy-173,15,15,tocolor(255,255,255,255),1.8) elseif(fuel >= 10) then dxDrawRectangle(sx-167,sy-146,fuel*1.4,3,tocolor(225, 150, 48, 255)) dxDrawText(string.format("%s",fuel),sx-60,sy-173,15,15,tocolor(255,255,255,255),1.8) end if(hpcar >= 100) then dxDrawRectangle(sx-167,sy-87,hpcar*1.4,3,tocolor(210, 255, 0, 255)) dxDrawText(string.format("%s",hpcar),sx-80,sy-114,15,15,tocolor(255,255,255,255),1.8) elseif(hpcar <= 50) then dxDrawRectangle(sx-167,sy-87,hpcar*1.4,3,tocolor(213, 38, 38, 255)) dxDrawText(string.format("%s",hpcar),sx-70,sy-114,15,15,tocolor(255,255,255,255),1.8) elseif(hpcar <= 65) then dxDrawRectangle(sx-167,sy-87,hpcar*1.4,3,tocolor(218,207, 96, 255)) dxDrawText(string.format("%s",hpcar),sx-70,sy-114,15,15,tocolor(255,255,255,255),1.8) elseif(hpcar <= 9) then dxDrawRectangle(sx-167,sy-87,hpcar*1.4,3,tocolor(213, 38, 38, 255)) dxDrawText(string.format("%s",hpcar),sx-60,sy-114,15,15,tocolor(255,255,255,255),1.8) elseif(hpcar >= 10) then dxDrawRectangle(sx-167,sy-87,hpcar*1.4,3,tocolor(210, 255, 0, 255)) dxDrawText(string.format("%s",hpcar),sx-70,sy-114,15,15,tocolor(255,255,255,255),1.8) end end addEventHandler ( "onVehicleEnter", getRootElement(), speed ) é um velocímetro, quando o player entrar no carro é para a função funcionar mais ela n está ligando
  12. tem como fazer com que só consiga entrar em um carro se tiver com uma certa skin?
  13. This is the code: local normalScoreGorget = 0 local maxMegjelenit = 1 -------------------- for i, row in pairs(scoreboard_rows) do if (i > normalScoreGorget and elem < maxMegjelenit) then elem = elem + 1 if getElementType(row) == "player" then ---DX things here........ elseif getElementType(row) == "team" then ---DX things here........ end end end end bindKey("mouse_wheel_down", "down", function() if normalScoreGorget < #scoreboard_rows - maxMegjelenit then normalScoreGorget = normalScoreGorget + 1 end end ) bindKey("mouse_wheel_up", "down", function() if normalScoreGorget > 0 then normalScoreGorget = normalScoreGorget - 1 end end ) This is the bug: how can i fix this?.. :s
  14. Hi, I've started writing scripts connected to the database, and I struggle why the current script that I am working on doesn't work. Info: - Name of the table: accounts - Columns: username, skin, money - No errors Here is my script: function showStats(player) local playerName = getPlayerName(player) local qh = dbQuery(db, "SELECT skin, money FROM accounts WHERE username=?", playerName) local result = dbPoll(qh, -1) if result then for _, row in ipairs(result) do outputChatBox("Skin: " ..row["skin"].. "Money: "..row["money"] .. "") end end end addCommandHandler("stats", showStats)
  15. eu tinha feito com bind no "k", mas quero passar o painel para o marker. Marker glock = createMarker(297.947, -80.809, 1000.600, "cylinder", 1, 255, 0, 0, 40) setElementInterior(glock, 4) Server function showPanellr(thePlayer) accountname = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup("user." .. accountname, aclGetGroup("Porte")) then triggerClientEvent(thePlayer, "painelglock", getRootElement()) end end function onResStartlr() for index, player in ipairs(getElementsByType("player")) do bindKey(player, "k", "down", showPanellr) end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), onResStartlr) function onPlayerJoinlr() bindKey(source, "k", "down", showPanellr) end addEventHandler("onPlayerJoin", getRootElement(), onPlayerJoinlr) function cleanAlllr(player) for index, player in ipairs(getElementsByType("player")) do unbindKey(player, "k", "down", showPanellr) end end addEventHandler("onResourceStop", getResourceRootElement(getThisResource()), cleanAlllr) function arma () giveWeapon( source, 22, 300, true ) outputChatBox ('( #ff0000INFO#ffffff ) #ffff00Você comprou #00ff00Glock-18 !',source,255,255,255,true) end addEvent("glock",true) addEventHandler ( "glock", getRootElement(), arma ) Client local screenW,screenH = guiGetScreenSize() local resW, resH = 1365,767 local x, y = (screenW/resW), (screenH/resH) function Pdx () dxDrawLine(333 - 1, 194 - 1, 333 - 1, 574, tocolor(38, 237, 11, 254), 1, false) dxDrawLine(691, 194 - 1, 333 - 1, 194 - 1, tocolor(38, 237, 11, 254), 1, false) dxDrawLine(333 - 1, 574, 691, 574, tocolor(38, 237, 11, 254), 1, false) dxDrawLine(691, 574, 691, 194 - 1, tocolor(38, 237, 11, 254), 1, false) dxDrawRectangle((screenW - 358) / 2, (screenH - 380) / 2, 358, 380, tocolor(0, 0, 0, 138), false) dxDrawImage(333, 194, 358, 380, ":GUI/images/examples/new_city_sfundo.png", 0, 0, 0, tocolor(254, 254, 254, 50), false) dxDrawImage(417, 257, 202, 160, ":GUI/images/examples/G-18.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawRectangle(333, 194, 358, 53, tocolor(21, 133, 6, 111), false) dxDrawRectangle(359, 468, 310, 80, tocolor(21, 133, 6, 111), false) dxDrawText("R$15.000", 346, 417, 681, 463, tocolor(255, 255, 255, 255), 2.00, "pricedown", "center", "center", false, false, false, false, false) dxDrawText("Glock-18", 338, 203, 681, 237, tocolor(255, 255, 255, 255), 2.00, "pricedown", "center", "center", false, false, false, false, false) dxDrawText("comprar", 372, 481, 659, 538, tocolor(255, 255, 255, 255), 2.00, "pricedown", "center", "center", false, false, false, false, false) end function abrir (_,state) if painel == false then showCursor(true) addEventHandler("onClientRender", root, Pdx) painel = true else showCursor(false) removeEventHandler("onClientRender", root, Pdx) painel = false end end addEvent("painelglock", true) addEventHandler("painelglock", root , abrir) function togglePanel() if getElementData(localPlayer,nomeDaACL_Comandante) then if not isEventHandlerAdded("onClientRender",root,onClientRender) then guiGridListClear(playerList) for id, player in ipairs(getElementsByType("player")) do guiGridListSetItemText(playerList, guiGridListAddRow(playerList), 1, getPlayerName(player):gsub('#%x%x%x%x%x%x', ''), false, false) end guiSetVisible(playerList,true) guiSetVisible(edit,true) aVisible = true rVisible = true addEventHandler("onClientRender",root,onClientRender) showCursor(true) else guiSetVisible(playerList,false) guiSetVisible(edit,false) removeEventHandler("onClientRender",root,onClientRender) showCursor(false) end end end function isCursorOnElement(x,y,w,h) local mx,my = getCursorPosition () local fullx,fully = guiGetScreenSize() cursorx,cursory = mx*fullx,my*fully if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then return true else return false end end function arma (_,state) if painel == true then if state == "down" then if isCursorOnElement(372, 481, 659, 538) then triggerServerEvent ("glock", localPlayer) end end end end addEventHandler ("onClientClick", root, arma) preciso só da introdução do comando o resto deixa cmg (faz tempo que não mexo com isso, ja esqueci de muitas coisas) quero por o painel de comprar a glock no marker indicado....
  16. I created a scoreboard system, but when i make a team, the team does not show in scoreboard.. how can i add this after playerlist?
  17. Why not see another players my messages? And how to add built-in, and addCommandHandler commands to this chat system? Client: Server: Thanks the help!
  18. I created some handling with handling editor script, and i want set some cars default handling to these handlings with a script, when a player spawn this car, the handling in the car automatic set to the edited hand.. But how can i do this?
  19. client: local Admins = {} addEvent("updateAdmins",true) addEventHandler("updateAdmins",root, function(t) Admins = t end) function isPlayerAdmin(player) if(Admins[player]) then return true end return false end function asdi() for k,v in ipairs(Admins) do outputChatBox(k) end end addCommandHandler("asd",asdi) server: local Admins = {} function isPlayerAdmin(player) if(Admins[player]) then return true end return false end addEventHandler("onPlayerLogin",root, function() if isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "Admin" ))then if not(Admins[source])then Admins[source]= source triggerClientEvent("updateAdmins",source,Admins) end end end) addEventHandler("onPlayerQuit",root, function() if(Admins[source])then Admins[source]= nil triggerClientEvent("updateAdmins",source,Admins) end end) No errors, no warnings... What wrong?
  20. This is my code: local sp2 = getVehicleNitroLevel(car)*180 if sp2 ~= false and sp2 ~= nil and sp2 > 1 then dxDrawImage(x-w/1+36, y-h/1+260, 256, 256, "images/fuelindicator.png", sp2,0,0, 0xFFFFFFFF,true) dxDrawBorderedImage(x-180, y+45,245, 245, "images/fuelnum.png", 0,0,0, tocolor(colorR2, colorG2, colorB2,255)) dxDrawImage(x-105, y+110, 95, 95, "images/line.png", 0,0,0, tocolor(0,0,0,255)) dxDrawImage(x-105, y+110, 95, 95, "images/shadow.png", 0,0,0, tocolor(0,0,0,255)) end Working fine, but in debugscript flooding this error: the line 108 is the local sp2 = getVehicleNitroLevel(car)*180 how to fix this error?
  21. Atualmente estou fazendo um script de trabalho ilegal de metanfetamina, gostaria de uma explicação ou um exemplo de como posso fazer o player carregar um objeto na mão quando ele passar por um marker. E quando ele passar em um outro marker o objeto vai sumir da mão dele. Obrigado!
  22. for index, info in ipairs(blips) do dxSetRenderTarget(MiniMap["RenderTarget"], true) local bx = info.x local by = info.y local actualDist = getDistanceBetweenPoints2D(playerX, playerY, bx, by) local dist = actualDist/(worldMaxSize/((worldWidth+worldHeight)/2)) local rot = findRotation(bx, by, playerX, playerY)-camZ local blipX, blipY = getPointFromDistanceRotation( (MiniMap_x+MiniMap["width"]+MiniMap_x)/2, (MiniMap_y+MiniMap_y+MiniMap["height"])/2, math.min(dist, math.sqrt((MiniMap_y+MiniMap_y+MiniMap["height"])/2-MiniMap_y^2 + MiniMap_x+MiniMap["width"]-(MiniMap_x+MiniMap["width"]+MiniMap_x)/2^2)), rot ) local blipX = math.max(MiniMap_x, math.min(MiniMap_x+MiniMap["width"], blipX)) local blipY = math.max(MiniMap_y, math.min(MiniMap_y+MiniMap["height"], blipY)) local color = 255 dxDrawImage(blipX - blipSize/2, blipY - blipSize/2, blipSize, blipSize, "blips/".. info.blipID ..".png",0,0,0,tocolor(255,2555,255,255)) dxSetRenderTarget() end Why not working? No errors/warnings..
  23. I enabled in config file the voice chat, and started the script, but some players does not hear the voice chat. How to fix this?
  24. Aqua22

    [HELP PLEASE]

    Hi! I wanted to create a broadcast script and i've got this error: attempt to concatenate local 'msg' (a userdata value) server.lua : function ad (msg) outputChatBox ( "#fbe0ff[Hiradó]: " .. msg .. getRootElement(), 255, 255, 255, true ) end addCommandHandler ("hirado", ad) and i don't know what the problem is. Sorry the link for scripting subforum is doesn't works for me.
  25. I want draw a dxdrawtext to a object, but how can i do it this?
×
×
  • Create New...