Jump to content

Search the Community

Showing results for tags 'ajuda'.

  • 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. Galera to fazendo um sistema de painel q vc digita no painel tipo 255, 0, 0 dentro de um carro e seta a cor vermelha no carro q e do rgb 255, 0, 0 e etc. mas da forma que achei que era possivel ao abrir o painel e digitar a cor em rgb eu fiz uma função que na teoria era pra pegar oq foi digitado na editbox e setar oq foi digitado na editbox como cor do carro usando setVehicleColor so q n aparece nada e n seta cor no carro mais se o carro ta vermelho e coloca tipo 255, 0, 0 na editbox e da ok a cor sempre muda pra preto espero q de para entender function SetarCor (playerSource, getMsg) --local mensagem = tonumber(getMsg) local uVehicle = getPedOccupiedVehicle( playerSource ) if isPedInVehicle( playerSource ) then if uVehicle then -- if mensagem == "Vermelho" then setVehicleColor( uVehicle, tonumber(getMsg)) end end --end end addEvent("SetarCor", true) addEventHandler("SetarCor", getRootElement(), SetarCor) PARTE DO CLIENT function rgbtrigger (button, state) if painel == true then if button == "left" and state == "down" then if isCursorOnElement(screenW * 0.6384, screenH * 0.5885, screenW * 0.7379, screenH * 0.6185) then local getMsg = tostring(getElementData(msgstaff, "CMT_Txt")) removeEventHandler("onClientRender", root, dx) triggerServerEvent("SetarCor", getLocalPlayer(), localPlayer, getMsg) painel = false showCursor(false) end end end end addEventHandler("onClientClick", root, rgbtrigger)
  2. eu queria fazer com que quando o player saia do carro de sedex ele tenha 10 segundos para voltar senao o carro despawnaria entao poderia me ajudar com isso
  3. Olá pessoal estou com outro problema diferente agora, basicamente tou com um mod de trancar veiculos aqui porem ele veio com o som de trancar veiculo muito feio, consegui trocar o som quando o player tranca o veiculo sem estar nele porem tou tendo dificuldades para conseguir colocar um som diferente se o player estiver dentro do veiculo server side function doToggleLights ( source, beep ) local theVehicle if ( getElementType(source) == "vehicle" ) then theVehicle = source end if ( getElementType(source) == "player" ) then theVehicle = getElementData ( source, "cl_ownedvehicle" ) end if ( theVehicle ) then if (getElementType(source) == "player") then if not (getPedOccupiedVehicle(source)) then if ( getVehicleOverrideLights ( theVehicle ) ~= 2 ) then -- if the current state isn't 'force on' setVehicleOverrideLights ( theVehicle, 2 ) -- force the lights on -- play sound close to element if ( beep == true ) then local theElement = theVehicle triggerClientEvent ( getRootElement(), "playSoundLockOut", getRootElement(), theElement, 5) end else setVehicleOverrideLights ( theVehicle, 1 ) -- otherwise, force the lights off end else if ( beep == true ) then local theElement = theVehicle triggerClientEvent ( getRootElement(), "playSoundLockIn", getRootElement(), theElement, 5) end end end else end end Obrigado a quem puder ajudar Principalmente ao @Lord Henryque tem me ajudado bastante aqui!
  4. Olá preciso de ajuda com esse codigo basicamente quero que se o player estiver dentro do carro nao abra as portas esse é um codigo de portao por acl que é feito atraves de um marker porem ja tentei muita coisa para nao funcionar se o player estiver dentro de um veiculo tentei ispedinvehicle nao foi , nao sei se alguem poder ajudar agradecia so tem server side Gate10 = createObject ( 1569, 954.40002441406, -1721.9000244141, 12.60000038147, 0, 0, 270 ) Gate11 = createObject ( 1569, 954.40002441406, -1724.9000244141, 12.60000038147, 0, 0, 90 ) local markerlojacarros = createMarker(954.40002441406, -1723.6000244141, 12.60000038147, "cylinder", 3, 0, 0, 0, 0) function PortaoDoor1Loja(thePlayer) moveObject (Gate10, 200, 954.40002441406, -1720.6999511719, 12.60000038147 ) moveObject (Gate11, 200, 954.40002441406, -1726.0999755859, 12.60000038147 ) end addCommandHandler("open",PortaoDoor1Loja) addEventHandler("onMarkerHit", markerlojacarros, PortaoDoor1Loja) function PortaoDoor2Loja() moveObject (Gate10, 200, 954.40002441406, -1721.9000244141, 12.60000038147 ) moveObject (Gate11, 200, 954.40002441406, -1724.9000244141, 12.60000038147 ) end addCommandHandler("close",PortaoDoor2Loja) addEventHandler("onMarkerLeave", markerlojacarros, PortaoDoor2Loja)
  5. Olá estou aqui com uns mods de empregos que permitem ganhar exp sempre que conclui o trabalho porem estava a funcionar perfeitamente mas depois de colocar o servidor na host começou a aparecer este erro : "ERROR:[Agencia]/ir-lixeiro/Danilin_S.lua:147:attempt to perform arithmetic on a boolean value" e ja nao esta ganhando EXP Alguem sabe resolver? Apenas tem Server-Side local Marker_Emprego = createMarker ( 2182.86792, -1982.49438 +6, 13.55141 -1, "cylinder", 1.5, 16, 111, 231, 50) local Blip_Emprego = createBlipAttachedTo( Marker_Emprego, 11 ) local Veiculo = createVehicle( 408, 2178.33301, -1982.59888 +6, 13.55138 +0.5, 0, 0, 90 ) setBlipVisibleDistance(Blip_Emprego, 150) setElementFrozen( Veiculo, true ) setVehicleDamageProof( Veiculo, true ) setVehicleLocked(Veiculo, true) Marker_Aleatorios = { {2182.49585, -1996.44495, 13.54688}, {2190.50732, -2002.93738, 13.54688}, {2165.94678, -1986.73853, 13.55469}, {2193.5373535156, -2009.6970214844, 13.55469}, -- AS MESMA POS DA DE CIMA (PRA NÃO SAIR O MESMO TODA HORA) {2190.50732, -2002.93738, 13.54688}, {2182.49585, -1996.44495, 13.54688}, {2193.5373535156, -2009.6970214844, 13.55469}, {2165.94678, -1986.73853, 13.55469}, } --[[ ><><><><><><><><><><><><><><><><><><><>< >< Infos Trab >< ><><><><><><><><><><><><><><><><><><><>< --]] local Blip_Marcar = createBlipAttachedTo( Marker_Emprego, 0 ) setElementVisibleTo ( Blip_Marcar, root, false ) function Infos_Emprego ( source ) local Emprego = getElementData ( source, "Emprego" ) if Emprego == "Lixeiro" then if isElementVisibleTo ( Blip_Marcar, source ) then setElementVisibleTo ( Blip_Marcar, source, false ) outputChatBoxInfo ( "Seu Local de Trabalho foi Desmarcado do Mapa!", source, 255, 165, 0, true ) else setElementVisibleTo ( Blip_Marcar, source, true ) outputChatBoxInfo ( "Seu Local de Trabalho foi Marcado no Mapa!", source, 255, 165, 0, true ) end end end addCommandHandler ( "infos", Infos_Emprego ) --[[ ><><><><><><><><><><><><><><><><><><><>< >< Carregar Lixo >< ><><><><><><><><><><><><><><><><><><><>< --]] Object_Lixo = {} Marker_Entregar = {} function Pegar_Lixo (source) local Emprego = getElementData ( source, "Emprego" ) local Px, Py, Pz = getElementPosition( Marker_Emprego ) local Lixo = getElementData( source, "Lixo" ) local Random_Pos = math.random ( #Marker_Aleatorios ) if not isPedInVehicle ( source ) then if isElementWithinMarker(source, Marker_Emprego) then if Lixo == false then if Emprego == "Lixeiro" then setPedAnimation( source, "CARRY", "liftup", 1.0, false ) setTimer(function() if isElement( Object_Lixo[source] ) then destroyElement( Object_Lixo[source] ) end if isElement( Marker_Entregar[source] ) then destroyElement( Marker_Entregar[source] ) end setElementData(source, "Recompensa", 0) setPedAnimation( source, nil ) setElementData( source, "Lixo", true ) toggleControl( source, "jump", false ) toggleControl( source, "fire", false ) toggleControl(source, "aim_weapon", false) setPedAnimation( source, "CARRY", "crry_prtial", 4.1, true, true, true ) Object_Lixo[source] = createObject( 1264, Px, Py, Pz ) Marker_Entregar[source] = createMarker ( Marker_Aleatorios[Random_Pos][1], Marker_Aleatorios[Random_Pos][2], Marker_Aleatorios[Random_Pos][3] -2.2, "cylinder", 2.5, 16, 111, 231, 50) setElementVisibleTo ( Marker_Entregar[source], root, false ) setElementVisibleTo ( Marker_Entregar[source], source, true ) addEventHandler("onMarkerHit", Marker_Entregar[source], Fim_Emprego) exports.bone_attach:attachElementToBone(Object_Lixo[source], source, 4, 0, 0.4, - 0.6, -90, 0, 0 ) end, 1000, 1) else outputChatBoxError ( "Apenas lixeiros podem trabalhar aqui!", source, 255, 165, 0, true ) end end end end end addCommandHandler("lixo", Pegar_Lixo) function Mensagem_Aviso (source) local Emprego = getElementData ( source, "Emprego" ) if isPedInVehicle ( source ) then return end if Emprego == "Lixeiro" then if isElementWithinMarker(source, Marker_Emprego) then --outputChatBox ( "Digite /lixo para pegar no lixo!", source, 255, 165, 0, true ) end end end addEventHandler("onMarkerHit", Marker_Emprego, Mensagem_Aviso) --[[ ><><><><><><><><><><><><><><><><><><><>< >< Entregar Lixo >< ><><><><><><><><><><><><><><><><><><><>< --]] function Fim_Emprego (source) local Xp = tonumber(getElementData(source, "minutes")) or 0 local Lixo = getElementData( source, "Lixo" ) local Recompensa = math.random(25, 50) local Recompensaxp = math.random(25, 50) if not isPedInVehicle ( source ) then if isElementWithinMarker(source, Marker_Entregar[source]) then if Lixo == true then setPedAnimation( source, "CARRY", "putdwn", 1.0, false, false, false, true ) setTimer(function() if isElement( Object_Lixo[source] ) then destroyElement( Object_Lixo[source] ) end if isElement( Marker_Entregar[source] ) then destroyElement( Marker_Entregar[source] ) end setElementData( source, "Lixo", false ) toggleControl( source, "jump", true ) toggleControl( source, "fire", true ) toggleControl(source, "aim_weapon", true) setPedAnimation( source, "CARRY", "liftup", 0.0, false, false, false, false ) --if isObjectInACLGroup("user." ..getAccountName(getPlayerAccount(source)), aclGetGroup("Vip2")) then --setElementData(source, "Recompensa", Recompensa *2) --setElementData(source, "minutes", Xp + getElementData(source, "Recompensa")) --givePlayerMoney(source, getElementData(source, "Recompensa")) --triggerClientEvent(source, "addNotification", root, "#106FE7[ #ffffffVIP#106FE7 ] #ffffffVocê entregou o lixo e ganhou: "..getElementData(source, "Recompensa").."$", "sucesso") --elseif isObjectInACLGroup("user." ..getAccountName(getPlayerAccount(source)), aclGetGroup("Vip")) then --setElementData(source, "Recompensa", Recompensa *2) --setElementData(source, "minutes", Xp + getElementData(source, "Recompensa")) --givePlayerMoney(source, Recompensa) --triggerClientEvent(source, "addNotification", root, "#106FE7[ #ffffffVIP#106FE7 ] #ffffffVocê entregou o lixo e ganhou: "..getElementData(source, "Recompensa").."$", "sucesso") if isObjectInACLGroup("user." ..getAccountName(getPlayerAccount(source)), aclGetGroup("Everyone")) then setElementData(source, "Recompensa", Recompensa) givePlayerMoney(source, Recompensa) setElementData(source, "minutes", Xp + getElementData(source, "Recompensaxp")) if ( getElementData(source,"minutes") > 999 ) then setElementData(source,"minutes",0) setElementData(source,"Level",(getElementData(source,"Level") or 0) +1) end end end, 1200, 1) end end end end addEventHandler( "onPlayerQuit", root, function() if isElement( Object_Lixo[source] ) then destroyElement( Object_Lixo[source] ) end if isElement( Marker_Entregar[source] ) then destroyElement( Marker_Entregar[source] ) end end) addEventHandler( "onPlayerWasted", root, function() if isElement( Object_Lixo[source] ) then destroyElement( Object_Lixo[source] ) end if isElement( Marker_Entregar[source] ) then destroyElement( Marker_Entregar[source] ) end setElementData( source, "Lixo", false ) toggleControl( source, "jump", true ) toggleControl( source, "fire", true ) toggleControl(source, "aim_weapon", true) end) function outputChatBoxInfo(text, player, ...) triggerClientEvent(player, "N3xT.dxNotification", root, tostring(text), "info") end function outputChatBoxError(text, player, ...) triggerClientEvent(player, "N3xT.dxNotification", root, tostring(text), "error") end
  6. Bom meu painel GUI está deste modo: E queria deixa-lo deste: Alguém poderia me dizer qual a função ou se tem como alinhar as colunas de um modo em especifico?
  7. Olá pessoal tenho aqui um script de Trancar veiculo porem se eu sair do veiculo e deixar ele trancado e entrar noutro veiculo e trancar ficam os dois trancados e tenho acesso para destrancar os dois, mas todos os player tambem tenhem ou seja eles podem destrancar os veiculos que eu tranquei alguem pode ajudar? Client Side function processLockUnlock(vehicle) local locked = isVehicleLocked(vehicle) if isPedInVehicle(localPlayer) then if locked then playSounds("lockin") triggerServerEvent("vehicleLock", localPlayer,localPlayer, vehicle, false) else playSounds("lockin") triggerServerEvent("vehicleLock", localPlayer,localPlayer, vehicle, true) end else if locked then playSounds("lockout") triggerServerEvent("vehicleLock", localPlayer,localPlayer, vehicle, false) setVehicleOverrideLights ( vehicle, 2 ) setTimer ( setVehicleOverrideLights, 1000, 1, vehicle, 1 ) outputChatBox ( "\n#ff8c00✘ #ffffffINFO #ff8c00✘➺ #ffffffVeiculo Destrancado!\n", 255, 165, 0, true ) else playSounds("lockout") triggerServerEvent("vehicleLock", localPlayer,localPlayer, vehicle, true) setVehicleOverrideLights ( vehicle, 2 ) setTimer ( setVehicleOverrideLights, 1000, 1, vehicle, 1 ) setTimer ( setVehicleOverrideLights, 1500, 1, vehicle, 2 ) setTimer ( setVehicleOverrideLights, 2000, 1, vehicle, 1 ) outputChatBox ( "\n#ff8c00✘ #ffffffINFO #ff8c00✘➺ #ffffffVeiculo Trancado!\n", 255, 165, 0, true ) end end end local klikkTimer = false function setVehicleLockState() --Função trancar o carro if klikkTimer then return end if isTimer(klikkTimerRun) then return end klikkTimer = true klikkTimerRun = setTimer(function() klikkTimer = false end,500,1) local vehicle = getPedOccupiedVehicle ( localPlayer ) if vehicle then processLockUnlock(vehicle) else local int2 = getElementInterior(localPlayer) local dim2 = getElementDimension(localPlayer) local mx,my,mz = getElementPosition(localPlayer) for k,v in ipairs(getElementsByType("vehicle")) do local x,y,z = getElementPosition(v) local int = getElementInterior(v) local dim = getElementDimension(v) local dist = getDistanceBetweenPoints3D(x,y,z,mx,my,mz) if dist <= 10 and int2 == int and dim2 == dim then processLockUnlock(v) return end end end end bindKey("l", "down", setVehicleLockState)
  8. Olá pessoal enviei recentemente um servidor para a host porem, eu tinha um mod de custumizaçao de skins o SQH_characters mas infelizmente deixou de funcionar assim que enviei o servidor para a host não sei porque se alguem poder ajudar agradecia
  9. ALGUEM TEM SCRIPT DE AUMENTAR O NIVEL DE PROCURADO PARA MAIS DE 6 OU COMO POSSO FAZER UM SCRIPT DESSE PQ TO PRECISANDO MUITO PARA MTA
  10. Gostaria de aprender o .lua para fazer mods para o mta gostaria de fazer uns script mais comuns tipo inventario, celular e etc... e n sei como e tem varias pessoas vendendo curso de .lua para mta e n consigo confiar neles ent to aqui pra ver se alguem me ajuda me indica oq eu tenho q fazer oq tenho q estudar
  11. local show_radar = false; local function render( ) if ( not show_radar or not isPedInVehicle( localPlayer ) or not INTERFACE_UTILS.SHOW ) then return; end local position = { getElementPosition( localPlayer ) }; dxSetRenderTarget( INTERFACE.Radar.render_targer, true ); dxDrawRectangle( 0, 0, INTERFACE.Radar.w, INTERFACE.Radar.h, tocolor( 94, 101, 107 ) ); local map_size = INTERFACE.unit / ( 200 / 125 ); local cx, cy, _, tx, ty = getCameraMatrix( ); local north = findRotation( cx, cy, tx, ty ); local map_x, map_y = -( reMap( position[ 1 ] + INTERFACE.unit, 0, 6000, 0, map_size ) - INTERFACE.Radar.w / 2 ), -( reMap( -position[ 2 ] + INTERFACE.unit, 0, 6000, 0, map_size ) - INTERFACE.Radar.h / 2 ); dxDrawImage( map_x, map_y, map_size, map_size, map_texture, north, - map_size / 2 - map_x + INTERFACE.Radar.w / 2, - map_size / 2 - map_y + INTERFACE.Radar.h / 2, tocolor( 255, 255, 255 ) ); for index, value in ipairs( INTERFACE.gps_lines ) do local NODE_X, NODE_Y = value.x, value.y; local w, h = 25, 25; local line_x, line_y, line_w, line_h = ( INTERFACE.unit + ( NODE_X - w + 10 ) ) / 6000 * map_size, ( INTERFACE.unit - ( NODE_Y - h ) ) / 6000 * map_size, w / 6000 * map_size, -( h / 6000 * map_size ); line_x = line_x + map_x; line_y = line_y + map_y; dxSetBlendMode( "modulate_add" ); dxDrawImage( line_x, line_y, line_w, line_h, "assets/minimap/radar_area.png", north, -line_w / 2 - line_x + INTERFACE.Radar.w / 2, -line_h / 2 - line_y + INTERFACE.Radar.h / 2, tocolor( 131, 112, 245 ) ); dxSetBlendMode( "blend" ); end for index, value in ipairs( getElementsByType( "radararea" ) ) do local area_pos = { getElementPosition( value ) }; local w, h = getRadarAreaSize( value ); local r, g, b, a = 255, 255, 255, 255; local area_x, area_y, area_w, area_h = ( INTERFACE.unit + area_pos[ 1 ] ) / 6000 * map_size, ( INTERFACE.unit - area_pos[ 2 ] ) / 6000 * map_size, w / 6000 * map_size, -( h / 6000 * map_size ); area_x = area_x + map_x; area_y = area_y + map_y; r, g, b, a = getRadarAreaColor( value ); if ( isRadarAreaFlashing( value ) ) then a = a * math.abs( getTickCount( ) % 1000 - 500 ) / 500; end dxSetBlendMode( "modulate_add" ); dxDrawImage( area_x, area_y, area_w, area_h, "assets/minimap/radar_area.png", north, -area_w / 2 - area_x + INTERFACE.Radar.w / 2, -area_h / 2 - area_y + INTERFACE.Radar.h / 2, tocolor( r, g, b, a ) ); dxSetBlendMode( "blend" ); end for index, value in ipairs( getElementsByType( "blip" ) ) do local blip_pos = { getElementPosition( value ) }; local blip_icon = getBlipIcon( value ); local blip_x, blip_y = getRadarFromWorldPosition( blip_pos[ 1 ], blip_pos[ 2 ], -40, -40, INTERFACE.Radar.w + 80, INTERFACE.Radar.h + 80, map_size ); local blip_color = { 255, 255, 255 }; if ( blip_icon == 0 ) then blip_color = { getBlipColor( value ) }; end if ( getDistanceBetweenPoints2D( blip_pos[ 1 ], blip_pos[ 2 ], position[ 1 ], position[ 2 ] ) <= 450 ) then dxDrawImage( blip_x - INTERFACE.blip_size / 2, blip_y - INTERFACE.blip_size / 2, INTERFACE.blip_size, INTERFACE.blip_size, INTERFACE.blips[ blip_icon ], 0, 0, 0, tocolor( blip_color[ 1 ], blip_color[ 2 ], blip_color[ 3 ] ) ); end end local blip_x, blip_y = ( INTERFACE.unit + position[ 1 ] ) / 6000 * map_size, ( INTERFACE.unit - position[ 2 ] ) / 6000 * map_size; blip_x = blip_x + map_x; blip_y = blip_y + map_y; dxDrawImage( blip_x - INTERFACE.blip_size / 2, blip_y - INTERFACE.blip_size / 2, INTERFACE.blip_size, INTERFACE.blip_size, arrow_player, north - getPedRotation( localPlayer ), 0, 0, tocolor( 255, 255, 255 ) ); dxSetRenderTarget( ); dxDrawRectangle( INTERFACE.Radar.x - 2, INTERFACE.Radar.y - 2, INTERFACE.Radar.w + 4, INTERFACE.Radar.h + 4, tocolor( 33, 33, 33 ) ); dxDrawImage( INTERFACE.Radar.x, INTERFACE.Radar.y, INTERFACE.Radar.w, INTERFACE.Radar.h, INTERFACE.Radar.render_targer, 0, 0, 0, tocolor( 255, 255, 255 ) ); removePointMap( ); end function setRadarVisible( bool ) show_radar = not not bool; if ( show_radar ) then addEventHandler( "onClientRender", root, render ); else removeEventHandler( "onClientRender", root, render ); end end function getRadarVisible( ) return show_radar; end está aparecendo o seguinte aviso "Bad Argument @ 'dxDrawImage' [Expected material at argument 5, got nil] esse aviso está aparecendo na linha 86 que tem isso aqui dxDrawImage( blip_x - INTERFACE.blip_size / 2, blip_y - INTERFACE.blip_size / 2, INTERFACE.blip_size, INTERFACE.blip_size, INTERFACE.blips[ blip_icon ], 0, 0, 0, tocolor( blip_color[ 1 ], blip_color[ 2 ], blip_color[ 3 ] ) ); Sou novo como script e estou aprendendo e queria muito que alguém me ajudasse a resolver esse problema
  12. Olá, queria saber se existe alguma função que pegue o total de mbs do servidor. Tambem queria saber se tem como pegar o total de mbs que o player baixou.
  13. Olá pessoal tou a usar um painel policial que tem aquela opção de colocar o player na viatura, acontece que também deixa colocar na viatura o player que esta a executar o comando do painel ou seja o policial permitindo assim bugar a opção caso o player morra so usar essa opção e é teleportado para a vtr , então eu queria basicamente que o player que desse o comando (policial) não pudesse se colocar a si proprio na vtr Se alguém conseguir ajudar agradecia! Vou deixar o código dessa opção Mas acho que resolveria se não deixasse abrir o painel no proprio ID supondo que sou policial e sou id 1 se der /policial 1 aparecer uma msg erro a dizer que nao posso usar o painel em mim vou deixar o cdigo do comando em baixo também! [CODIGO DA OPÇÃO] addEventHandler("Player.onViatura", root, function() local receiver = getElementData(source, "ReceiverPM") local vtr = carros[source] if (receiver) and (vtr) then local vrx, vry, vrz = getElementRotation(vtr) local px, py, pz = getElementPosition(vtr) if not getElementData(receiver, "NaViatura") then if not isPedInVehicle(receiver) then setElementData(receiver, "NaViatura", true) message(source, "O jogador foi colocado na viatura.", "success") message(receiver, "Você foi colocado na viatura!", "info") attachElements(receiver, vtr, 0.2, -1.5, 0, 0,0,90) setPedAnimation(receiver, 'ped','CAR_dead_LHS') setElementRotation(receiver, vrx, vry, vrz + 83) end else setElementData(receiver, "NaViatura", nil) message(source, "O jogador foi retirado da viatura.", "success") message(receiver, "Você foi retirado da viatura!", "info") detachElements(receiver, getElementAttachedTo(receiver)) setElementPosition(receiver, px + 2, py + 2, pz) setPedAnimation(receiver) end else message(source, "Voce nao pode colocar-se a si mesmo na viatura!", "error") end end ) [CODIGO DO COMANDO] local comando = "p" addCommandHandler(comando, function (thePlayer, _, id) local id = tonumber(id) if id then local player = getPlayerByID(id) if player and isElement(player) then local accountname = getAccountName(getPlayerAccount(thePlayer)) if accountname and not isGuestAccount(accountname) then local acc = getAccountName(accountname) if isObjectInACLGroup("user."..accountname, aclGetGroup("Policial")) then triggerClientEvent(thePlayer, "Player.onPainelPolicial", resourceRoot, player) end end end end end) getPlayerByID = function (id) local pReturn = false for i, v in ipairs(getElementsByType("player")) do local idp = getElementData(v, "ID") or false if idp then if idp == tonumber(id) then pReturn = v end end end return pReturn end
  14. Pessoal, baixei o MTA hoje (05/08/2020) e tô na dúvida se tanto ele como o GTA SA contém vírus, pf me ajudem!
  15. Então Eu passei a madrugada toda tentando resolver um script aq onde que consiste em é um sistema de Garagem e concessionária... Porém eu adcionei um sistema de Detran em meu servidor e estava tentando modificar uma coisa nesse sistema ai de garagem que é... No painel tem " pegar veiculo ", Porém quando pega o veiculo ele spawna em você ( apos deslogar ou se o carro estiver destruido ) porém eu queria alterar isso para " spawnar veiculo " para Spawnar onde o carro foi deixado e colocar um teleport detran em meio a isso... ( caso algum player jogue o carro na água, etc... ) Tirando a função de "trancar/destrancar" alterando para " teleport Pátio " Porém mano, eu tentei a madrugada toda e está muito além de mim o script -------------------------------------------------------------------------------------------------------------------------------------------------------------------- function getFreeID() local result = dbPoll(dbQuery(db, "SELECT ID FROM VehicleList ORDER BY ID ASC"), -1) newID = false for i, id in pairs (result) do if id["ID"] ~= i then newID = i break end end if newID then return newID else return #result + 1 end end function getFreePlate(vehicle, NewID, source) local str = "ABCDEFGHIJKLMNPQRSTUVXWYZ" local plate = "" for index = 1, 3 do plate = plate .. string.char(str:byte(math.random(1, #str))) end plate = string.upper(plate) plate = plate .. "" for index = 1, 1 do plate = plate .. math.random(1, 9) end for index = 1, 1 do plate = plate .. string.char(str:byte(math.random(1, #str))) end for index = 1, 2 do plate = plate .. math.random(1, 9) end setVehiclePlateText(vehicle, plate) setElementData(vehicle,"Placa",plate) dbExec(db, "UPDATE VehicleList SET Placa=? WHERE Account=? AND ID=?", plate, getAccountName(getPlayerAccount(source)),tonumber(NewID)) end function getVehicleByID(id) v = false for i, veh in ipairs (getElementsByType("vehicle")) do if getElementData(veh, "ID") == id then v = veh break end end return v end function updateVehicleInfo(player) if isElement(player) then local result = dbPoll(dbQuery(db, "SELECT * FROM VehicleList WHERE Account = ?", getAccountName(getPlayerAccount(player))), -1) if type(result) == "table" then setElementData(player, "VehicleInfo", result) end end end local marcacao = {} local blip = {53} addEventHandler("onResourceStart", resourceRoot, function() if getThisResource() == resource then db = dbConnect("sqlite", "database.db") dbExec(db, "CREATE TABLE IF NOT EXISTS VehicleList (ID, Placa, Account, Model, X, Y, Z, RotZ, Colors, Upgrades, Paintjob, DETRAN, Cost, HP, new_hydr)") for i, player in ipairs(getElementsByType("player")) do updateVehicleInfo(player) end for _,marker in ipairs(pontosDeGaragem) do marcacao[marker] = createMarker(marker[1], marker[2], marker[3]-1, "cylinder", configPontos.tamanhoMarker, configPontos.corMarker[1], configPontos.corMarker[2], configPontos.corMarker[3], 170) setElementDimension(marcacao[marker], marker[5]) setElementInterior(marcacao[marker], marker[4]) blip[marker] = createBlipAttachedTo(marcacao[marker], configPontos.idBlip) setBlipSize(blip[marker], 5) end end end) addEventHandler("onMarkerHit", getRootElement(), function(executor) if executor and isElement(executor) and getElementType(executor) == "player" then for _,marker in ipairs(pontosDeGaragem) do if marcacao[marker] == source then if not isGuestAccount(getPlayerAccount(executor)) then triggerClientEvent(executor, "abrirPainelIndConce", executor) break end end end end end) addEventHandler("onMarkerLeave", getRootElement(), function(executor) if executor and isElement(executor) and getElementType(executor) == "player" then for _,marker in ipairs(pontosDeGaragem) do if marcacao[marker] == source then if not isGuestAccount(getPlayerAccount(executor)) then triggerClientEvent(executor, "fecharPainelIndConce", executor) break end end end end end) addEvent("onOpenGui", true) addEventHandler("onOpenGui", root, function() updateVehicleInfo(source) end) function destroyVehicle(theVehicle) if isElement(theVehicle) then local Owner = getElementData(theVehicle, "Owner") if Owner then local x, y, z = getElementPosition(theVehicle) local _, _, rz = getElementRotation(theVehicle) local r1, g1, b1, r2, g2, b2 = getVehicleColor(theVehicle, true) local color = r1..","..g1..","..b1..","..r2..","..g2..","..b2 upgrade = "" for _, upgradee in ipairs (getVehicleUpgrades(theVehicle)) do if upgrade == "" then upgrade = upgradee else upgrade = upgrade..","..upgradee end end local Paintjob = getVehiclePaintjob(theVehicle) or 3 local id = getElementData(theVehicle, "ID") local DETRAN = getElementData(theVehicle, "Travado") dbExec(db, "UPDATE VehicleList SET X = ?, Y = ?, Z = ?, RotZ = ?, HP = ?, Colors = ?, Upgrades = ?, Paintjob = ?, DETRAN = ? WHERE Account = ? AND ID = ?", x, y, z, rz, getElementHealth(theVehicle), color, upgrade, Paintjob, DETRAN or false, getAccountName(getPlayerAccount(Owner)), id) updateVehicleInfo(Owner) local attached = getAttachedElements(theVehicle) if (attached) then for k,element in ipairs(attached) do if getElementType(element) == "blip" then destroyElement(element) end end end end destroyElement(theVehicle) end end addEvent("onBuyNewVehicle", true) addEventHandler("onBuyNewVehicle", root, function(Model, cost, r1, g1, b1, r2, g2, b2) abc = false local data = dbPoll(dbQuery(db, "SELECT * FROM VehicleList WHERE Account = ?", getAccountName(getPlayerAccount(source))), -1) for i, data in ipairs (data) do if data["Model"] == Model then abc = true break end end if #data >= 10 then outputChatBox("#838B83[#FFFF00BiC#838B83]#FFFF00 Voce Pode Comprar Apenas 10 Veiculos.", source, 38, 122, 216, true) return end if abc == true then return end if getPlayerMoney(source) >= tonumber(cost) then takePlayerMoney ( source, cost ) local x, y, z = getElementPosition(source) local _, _, rz = getElementRotation(source) local shopID = getElementData ( source, "atVehShop") local color = r1..","..g1..","..b1..","..r2..","..g2..","..b2 if shopID and shopsVehSpawns[shopID] then vehicle = createVehicle(Model, shopsVehSpawns[shopID][1], shopsVehSpawns[shopID][2], shopsVehSpawns[shopID][3], shopsVehSpawns[shopID][4], shopsVehSpawns[shopID][5], shopsVehSpawns[shopID][6]) else vehicle = createVehicle(Model, x-5, y+5, z, 0, 0, rz) end setVehicleColor(vehicle, r1, g1, b1, r2, g2, b2) setElementData(vehicle, "Owner", source) local NewID = getFreeID() local Placa = getElementData(vehicle,"Placa") if Placa == nil or not Placa then local NewPlate = getFreePlate(vehicle,id, source) end local Placa = getElementData(vehicle,"Placa") setElementData(vehicle, "ID", NewID) dbExec(db, "INSERT INTO VehicleList VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", NewID, Placa, getAccountName(getPlayerAccount(source)), Model, x-5, y+5, z, rz, color, "", 3, false, cost, 1000, 0) updateVehicleInfo(source) setElementData(vehicle, "ownercar", getAccountName(getPlayerAccount(source))) warpPedIntoVehicle ( source, vehicle ) vv[vehicle] = setTimer(function(source) if not isElement(source) then killTimer(vv[source]) vv[source] = nil end if isElement(source) and getElementHealth(source) <= 255 then setElementHealth(source, 255.5) setVehicleDamageProof(source, true) setVehicleEngineState(source, false) end end, 150, 0, vehicle) addEventHandler("onVehicleDamage", vehicle, function(loss) local account = getAccountName(getPlayerAccount(getElementData(source, "Owner"))) setTimer(function(source) if isElement(source) then dbExec(db, "UPDATE VehicleList SET HP = ? WHERE Account = ? AND Model = ?", getElementHealth(source), account, getElementModel(source)) updateVehicleInfo(getElementData(source, "Owner")) end end, 100, 1, source) end) addEventHandler("onVehicleEnter", vehicle, function(player) if getElementHealth(source) <= 255.5 then setVehicleEngineState(source, false) else if isVehicleDamageProof(source) then setVehicleDamageProof(source, false) end end end) else outputChatBox("#c1c1c1Você não tem dinheiro o suficiente para comprar este veiculo.", source, 38, 122, 216, true) end end) vv = {} function SaveVehicleDataOnQuit() local conta = getAccountName(getPlayerAccount(source)) for i, veh in ipairs (getElementsByType("vehicle")) do if getElementData(veh, "ownercar") == conta then if not veh then return end destroyVehicle(veh) end end end addEventHandler("onPlayerQuit", root,SaveVehicleDataOnQuit) addEvent("SpawnMyVehicle", true) addEventHandler("SpawnMyVehicle", root, function(id) local data = dbPoll(dbQuery(db, "SELECT * FROM VehicleList WHERE Account = ? AND ID = ?", getAccountName(getPlayerAccount(source)), id), -1) if type(data) == "table" and #data ~= 0 then if getVehicleByID(id) then outputChatBox("#c1c1c1O seu veiculo #FF0000"..(customCarNames[data[1]["Model"]] or getVehicleNameFromModel(data[1]["Model"])).." #c1c1c1já está spawnado.", source, 38, 122, 216, true) else local color = split(data[1]["Colors"], ',') r1 = color[1] or 255 g1 = color[2] or 255 b1 = color[3] or 255 r2 = color[4] or 255 g2 = color[5] or 255 b2 = color[6] or 255 local playerX, playerY, playerZ = getElementPosition(source) if data[1]["DETRAN"] ~= 1 then --vehicle = createVehicle(data[1]["Model"], data[1]["X"], data[1]["Y"], data[1]["Z"], 0, 0, data[1]["RotZ"]) vehicle = createVehicle(data[1]["Model"], playerX, playerY, playerZ, 0, 0, data[1]["RotZ"]) warpPedIntoVehicle(source, vehicle) setElementData(vehicle, "ID", id) setElementData(vehicle, "Travado", false) outputChatBox("#c1c1c1O seu veiculo #FF0000"..(customCarNames[data[1]["Model"]] or getVehicleNameFromModel(data[1]["Model"])).." #c1c1c1foi spawnado.", source, 38, 122, 216, true) else outputChatBox("#c1c1c1O seu veiculo #FF0000"..(customCarNames[data[1]["Model"]] or getVehicleNameFromModel(data[1]["Model"])).." #c1c1c1foi spawnado no DETRAN, pois você deslogou com ele travado lá!.", source, 38, 122, 216, true) vehicle = createVehicle(data[1]["Model"], 1650.327, -1088.778, 23.906, 5, 5, data[1]["RotZ"]) setElementData(vehicle, "ID", id) setElementData(vehicle, "Travado", true) end local upd = split(tostring(data[1]["Upgrades"]), ',') for i, upgrade in ipairs(upd) do addVehicleUpgrade(vehicle, upgrade) end local Paintjob = data[1]["Paintjob"] or 3 setVehiclePaintjob(vehicle, Paintjob) setVehicleColor(vehicle, r1, g1, b1, r2, g2, b2) if tonumber(data[1]["HP"]) <= 255.5 then data[1]["HP"] = 255 end if data[1]["new_hydr"] and data[1]["new_hydr"] == 1 then setElementData(vehicle, "NewHydr", true) else setElementData(vehicle, "NewHydr", false) end Placa = data[1]["Placa"] setElementData(vehicle, "Placa",Placa) setElementData(vehicle, "ownercar", getAccountName(getPlayerAccount(source))) setElementHealth(vehicle, data[1]["HP"]) setElementData(vehicle, "Owner", source) local Placa = getElementData(vehicle,"Placa") if Placa == nil or not Placa then local NewPlate = getFreePlate(vehicle,id, source) end vv[vehicle] = setTimer(function(source) if not isElement(source) then killTimer(vv[source]) vv[source] = nil end if isElement(source) and getElementHealth(source) <= 255 then setElementHealth(source, 255.5) setVehicleDamageProof(source, true) setVehicleEngineState(source, false) end end, 50, 0, vehicle) addEventHandler("onVehicleDamage", vehicle, function(loss) local account = getAccountName(getPlayerAccount(getElementData(source, "Owner"))) setTimer(function(source) if isElement(source) then dbExec(db, "UPDATE VehicleList SET HP = ? WHERE Account = ? AND Model = ?", getElementHealth(source), account, getElementModel(source)) updateVehicleInfo(getElementData(source, "Owner")) end end, 100, 1, source) end) addEventHandler("onVehicleEnter", vehicle, function(player) if getElementHealth(source) <= 255.5 then setVehicleEngineState(source, false) else if isVehicleDamageProof(source) then setVehicleDamageProof(source, false) end end end) setElementData(vehicle, "Owner", source) end else outputChatBox("#c1c1c1Há um problema com o veiculo, notifique o administrador.", source, 38, 122, 216, true) end end) addEvent("DestroyMyVehicle", true) addEventHandler("DestroyMyVehicle", root, function(id) local vehicle = getVehicleByID(id) if isElement(vehicle) then local posVehX, posVehY, posVehZ = getElementPosition(vehicle) local posSouX, posSouY, posSouZ = getElementPosition(source) if (getDistanceBetweenPoints3D(posVehX, posVehY, posVehZ, posSouX, posSouY, posSouZ)) <= 10 then local data = dbPoll(dbQuery(db, "SELECT * FROM VehicleList WHERE Account = ? AND ID = ?", getAccountName(getPlayerAccount(source)), id), -1) local DETRAN = getElementData(vehicle, "Travado") local DETRAN = getElementData(vehicle, "Rebocando") if DETRAN ~= true and DETRAN2 ~= true then if type(data) == "table" and #data ~= 0 then destroyVehicle(vehicle) outputChatBox ("#c1c1c1O seu veiculo #FF0000"..(customCarNames[data[1]["Model"]] or getVehicleNameFromModel(data[1]["Model"])).." #c1c1c1foi guardado.", source, 38, 122, 216, true) else outputChatBox("#c1c1c1Selecione um veiculo.", source, 38, 122, 216, true) end else outputChatBox("#c1c1c1O seu veiculo não pode ser guardado, pois está preso no DETRAN!.", source, 38, 122, 216, true) end else outputChatBox("#c1c1c1O seu veiculo não está perto de você o suficiente.", source, 38, 122, 216, true) end else outputChatBox("#c1c1c1O seu veiculo não foi spawnado.", source, 38, 122, 216, true) end end) addEvent("LockMyVehicle", true) addEventHandler("LockMyVehicle", root, function(id) local vehicle = getVehicleByID(id) if isElement(vehicle) then local posVehX, posVehY, posVehZ = getElementPosition(vehicle) local posSouX, posSouY, posSouZ = getElementPosition(source) if (getDistanceBetweenPoints3D(posVehX, posVehY, posVehZ, posSouX, posSouY, posSouZ)) <= 15 then if not isVehicleLocked(vehicle) then setVehicleLocked(vehicle, true) setVehicleDoorsUndamageable(vehicle, true) setVehicleDoorState(vehicle, 0, 0) setVehicleDoorState(vehicle, 1, 0) setVehicleDoorState(vehicle, 2, 0) setVehicleDoorState(vehicle, 3, 0) outputChatBox("#c1c1c1O seu veiculo #FF0000"..(customCarNames[getElementModel(vehicle)] or getVehicleNameFromModel(getElementModel(vehicle))).." #c1c1c1foi #FF0000fechado.", source, 38, 122, 216, true) elseif isVehicleLocked(vehicle) then setVehicleLocked(vehicle, false) setVehicleDoorsUndamageable(vehicle, false) outputChatBox("#c1c1c1O seu veiculo #FF0000"..(customCarNames[getElementModel(vehicle)] or getVehicleNameFromModel(getElementModel(vehicle))).." #c1c1c1foi #FF0000aberto.", source, 38, 122, 216, true) end else outputChatBox("#c1c1c1O controle do alarme do seu veiculo está fora do alcance.", source, 38, 122, 216, true) end else outputChatBox("#c1c1c1O seu veiculo não foi spawnado.", source, 38, 122, 216, true) end end) addEvent("BlipMyVehicle", true) addEventHandler("BlipMyVehicle", root, function(id) local vehicle = getVehicleByID(id) if isElement(vehicle) then if not getElementData(vehicle, "ABlip") then setElementData(vehicle, "ABlip", true) createBlipAttachedTo(vehicle, 41, 2, 255, 255, 255, 255, 255, 65535, source) outputChatBox("#c1c1c1O localizador do seu veiculo foi ativado, pressione a tecla f11 para encontrá-lo.", source, 38, 122, 216, true) else local attached = getAttachedElements(vehicle) if (attached) then for k,element in ipairs(attached) do if getElementType(element) == "blip" then destroyElement(element) end end end setElementData(vehicle, "ABlip", false) outputChatBox("#c1c1c1O localizador do seu veiculo foi desativado.", source, 38, 122, 216, true) end else outputChatBox("#c1c1c1O seu veiculo não foi spawnado.", source, 38, 122, 216, true) end end) addEvent("SellMyVehicle", true) addEventHandler("SellMyVehicle", root, function(id) local vehicle = getVehicleByID(id) local data = dbPoll(dbQuery(db, "SELECT * FROM VehicleList WHERE Account = ? AND ID = ?", getAccountName(getPlayerAccount(source)), id), -1) if type(data) == "table" and #data ~= 0 then local Money = math.ceil((data[1]["Cost"]*.9)*math.floor(data[1]["HP"])/120/12) givePlayerMoney (source, Money) if isElement(vehicle) then destroyElement(vehicle) end dbExec(db, "DELETE FROM VehicleList WHERE Account = ? AND ID = ?", getAccountName(getPlayerAccount(source)), id) updateVehicleInfo(source) outputChatBox("#c1c1c1Você vendeu o seu veiculo por R$: "..Money, source, 38, 122, 216, true) end end) function getDataOnLogin(_, account) updateVehicleInfo(source) end addEventHandler("onPlayerLogin", root, getDataOnLogin) addEvent("inviteToBuyCarSended", true) addEventHandler("inviteToBuyCarSended", root, function(player, price, veh_name, veh_id) if player and price and veh_name and veh_id then local pl = getPlayerFromName ( player ) if pl then triggerClientEvent ( pl, "recieveInviteToBuyCar", pl, getPlayerName (source), getAccountName(getPlayerAccount(source)), price, veh_name, veh_id ) else outputChatBox("#c1c1c1O jogador não foi encontrado.", source, 38, 122, 216, true) triggerClientEvent ( source, "cleanCarInvitations", source ) end end end) addEvent("invitationBuyCarNotAccepted", true) addEventHandler("invitationBuyCarNotAccepted", root, function(player, acc, price, veh_name, veh_id) local pl = getPlayerFromName ( player ) if pl then triggerClientEvent ( pl, "cleanCarInvitations", pl ) outputChatBox("#c1c1c1O jogador recusou a sua oferta.", pl, 38, 122, 216, true) end end) addEvent("invitationBuyCarAccepted", true) addEventHandler("invitationBuyCarAccepted", root, function(player, acc, price, veh_name, veh_id) local pl = getPlayerFromName ( player ) local avail = false if pl and getAccountName ( getPlayerAccount (pl)) == acc then avail = true triggerClientEvent ( pl, "cleanCarInvitations", pl ) else for i, v in ipairs( getElementsByType ( 'player' ) ) do if getAccountName(getPlayerAccount ( v )) == acc then avail = true pl = v break end end end price = tonumber(price) or 0 if avail then if isGuestAccount ( getPlayerAccount ( source ) ) then triggerClientEvent ( pl, "cleanCarInvitations", pl ) outputChatBox("#c1c1c1O jogador não se encontra logado.", pl, 38, 122, 216, true) outputChatBox("#c1c1c1Você não está logado.", source, 38, 122, 216, true) return true end if getPlayerMoney ( source ) >= price then local vehicle = getVehicleByID(tonumber(veh_id)) local data = dbPoll(dbQuery(db, "SELECT * FROM VehicleList WHERE Account = ? AND ID = ?", getAccountName(getPlayerAccount(pl)), veh_id), -1) if type(data) == "table" and #data ~= 0 and isElement ( vehicle ) then givePlayerMoney ( pl, price ) takePlayerMoney ( source, price ) dbExec(db, "UPDATE VehicleList SET Account = ? WHERE Account = ? AND ID = ?", getAccountName(getPlayerAccount(source)), getAccountName(getPlayerAccount(pl)), veh_id) updateVehicleInfo(source) updateVehicleInfo(pl) setElementData(vehicle, "Owner", source) setElementData(vehicle, "ownercar", getAccountName(getPlayerAccount(source))) outputChatBox("#c1c1c1Você vendeu o seu veiculo por "..price.." reais.", pl, 38, 122, 216, true) outputChatBox("#c1c1c1Você comprou um veiculo por "..price.." reais.", source, 38, 122, 216, true) triggerClientEvent ( pl, "cleanCarInvitations", pl ) else outputChatBox("#c1c1c1O veiculo não se encontra spawnado.", source, 38, 122, 216, true) outputChatBox("#c1c1c1O veiculo não se encontra spawnado.", pl, 38, 122, 216, true) triggerClientEvent ( pl, "cleanCarInvitations", pl ) end else outputChatBox("#c1c1c1Você não possui dinheiro suficiente.", source, 38, 122, 216, true) end else outputChatBox("#c1c1c1O jogador não foi encontrado.", source, 38, 122, 216, true) end end) function consultarPlaca(source, Command, Placa) local accName = getAccountName(getPlayerAccount(source)) if not isObjectInACLGroup("user."..accName,aclGetGroup("Policial", "DETRAN")) then return outputMessage( "Você não tem permissão para este comando.", source,"info") end local data = dbPoll(dbQuery(db, "SELECT * FROM VehicleList WHERE Placa = ?", Placa), -1) if not getVehicleByPlate(Placa) then outputMessage( "Prenda o condutor Imediatamente.#FFFF00 Placa Fria", source,"info") return end if type(data) == "table" and #data ~= 0 then local dono = data[1]["Account"] local modelo = data[1]["Model"] local queixa = getElementData(getVehicleByPlate(Placa), "Roubado") or "Não" outputChatBox( "#FFFF00*________________________*", source, 255,255,255,true) outputChatBox( "#FFFF00*__Banco de Dados DETRAN__*", source, 255,255,255,true) outputChatBox( "Nome Do Veículo:#FFFF00"..customCarNames[data[1]["Model"]], source, 255,255,255,true) outputChatBox( "Conta Proprietário:#FFFF00"..dono, source, 255,255,255,true) outputChatBox( "Placa Consultada:#FFFF00"..Placa, source, 255,255,255,true) outputChatBox( "Queixa de roubo: #FFFF00"..queixa, source, 255,255,255,true) outputChatBox( "#FFFF00*________________________*", source, 255,255,255,true) else outputChatBox( "Veículo não spawnado ou inexistente", source,"info") end end addCommandHandler("consultar",consultarPlaca) 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 getVehicleByPlate(Placa) v = false for i, veh in ipairs (getElementsByType("vehicle")) do if getElementData(veh, "Placa") == Placa then v = veh break end end return v end local pedqueixa = createPed ( 281, 1580.2,-1634.6,13.6) local objporta1 = createObject (2959,1577.2,-1637.3,12.9,0,0,0) local objporta2 = createObject (2959,1577.2,-1637.3,12.6,0,0,0) local mkqueixa = createMarker(1580.01733, -1632.14722, 13.38281 -0.9, "cylinder", 1.3, 38, 122, 216) function msgqueixa(hitElement) if getElementType (hitElement) == "player" then outputMessage("Utilize o (/queixa [Placa Do Veiculo]) para prestar queixa de roubo", hitElement) end end addEventHandler("onMarkerHit", mkqueixa, msgqueixa) function prestqueixa(source, cmd, input) local veh = getVehicleByPlate(input) if not veh then outputMessage("Não existe um veículo com esta placa", source, "error") return end local data = dbPoll(dbQuery(db, "SELECT * FROM VehicleList WHERE Placa = ?", input), -1) if type(data) == "table" and #data ~= 0 then local dono = data[1]["Account"] if isElementWithinMarker ( source, mkqueixa ) then if getAccountName(getPlayerAccount(source)) == dono then setElementData(veh, "Roubado", "Sim") outputMessage("Queixa de roubo prestada para seu veiculo. ", source) else outputMessage("Este veículo, não pertence a você ", source) end else outputMessage("Vá ao marker no DP, para prestar queixa! ", source) end end end addCommandHandler("queixa", prestqueixa) function levarveic(source, cmd, input) local veh = getVehicleByPlate(input) local Conta = getAccountName ( getPlayerAccount ( source ) ) if not veh then outputMessage("Não existe um veículo com esta placa", source) return end local x, y, z = getElementPosition(source) local counter = 0 for seat, player in pairs(getVehicleOccupants(veh)) do counter = counter + 1 end if counter > 0 then return end if isObjectInACLGroup ("user."..Conta, aclGetGroup ( "Console" ) ) then setElementPosition(veh, x + 2.5, y, z) setElementRotation(veh, 0, 0, 0) else outputMessage("Você não tem permissão para usar este comando", source) end end addCommandHandler("trazerveic", levarveic) function entrarcarroqueixa( player, seat, jacked ) local Placa = getElementData(source, "Placa") local data = dbPoll(dbQuery(db, "SELECT * FROM VehicleList WHERE Placa = ?", Placa), -1) if type(data) == "table" and #data ~= 0 then local dono = data[1]["Account"] if getAccountName(getPlayerAccount(player)) == dono then setElementData(source, "Roubado", "Não") end end end addEventHandler ( "onVehicleEnter", getRootElement(), entrarcarroqueixa ) function outputMessage (text, player, r, g, b) return exports["notices"]:addNotification( player, text, "info"); end
  16. Em alguns meses eu estava jogando SA-MP e coloquei um mod de um veículo pesado no jogo e o som dos veiculos sumiram do nada e depois de alguns dias jogando o MTA o som dos veiculos também sumiram (dentro de uns 3 dias no max) e eu tentei resolver esse bug e como não consegui deixei de lado e essa semana eu estava pesquisando a forma de resolver mas infelizmente não achei nada. No SA-MP o som todo dos veiculos sumiram , já o MTA eu consigo escutar derrapagens e o som some enquanto estou dentro dele , quando eu saio do veiculo o som aparece de acordo com a posição que fico perto do veiculo , eu troquei os sons do GTA por sons modificados e depois coloquei os sons originais e já mexi nas configurações do MTA e não deu em nada. E recentemente eu estava jogando MTA normalmente e percebi que eu não estava conseguindo escutar a rádio modificada dos servidores e isso não é erro de algum servidor porque todo dia eu jogava nele e coloquei um script de rádio em meu servidor e meu amigo conseguia escutar e eu não. Não sei se deu pra vocês entenderem mas espero que consigam me ajudar.
  17. Olá, queria saber se tem algum código para fazer que a viatura das corporação no meu servidor não capotasse tão fácil. (Fiz um script que ele edita a velocidade mais não sei o nome pra não capotar) function loadHandling(v) if getElementModel(v) == 560 then setVehicleHandling(v, "mass", 1600) setVehicleHandling(v, "turnMass", 3000) setVehicleHandling(v, "dragCoeff", 1.8) setVehicleHandling(v, "centerOfMass", { 0, 0.15, -0.3 } ) setVehicleHandling(v, "percentSubmerged", 75) setVehicleHandling(v, "tractionMultiplier", 0.9) setVehicleHandling(v, "tractionLoss", 0.9) setVehicleHandling(v, "tractionBias", 0.497) setVehicleHandling(v, "numberOfGears", 5) setVehicleHandling(v, "maxVelocity", 211) setVehicleHandling(v, "engineAcceleration", 15) setVehicleHandling(v, "engineInertia", 50) setVehicleHandling(v, "driveType", "awd") setVehicleHandling(v, "engineType", "petrol") setVehicleHandling(v, "brakeDeceleration", 50) setVehicleHandling(v, "ABS", false) setVehicleHandling(v, "steeringLock", 35) setVehicleHandling(v, "headLight", 0) setVehicleHandling(v, "tailLight", 1) setVehicleHandling(v, "animGroup", 0) setVehicleHandling(v, "suspensionUpperLimit", 0.0) setVehicleHandling(v, "suspensionLowerLimit", -0.04) end
  18. Bom quando entro no mta sem entrar em servidores nem nd, O mta fica travando mt, A setinha do mouse fica se teletransportando demais, Quase não da pra mecher nada me ajude por favor porque não estava assim
  19. meu mta ficando dando esse bug, quando entro em um certo servidor. alguem poderia me ajudar?
  20. Mas não consigo, algo da errado no 'isElementInRange', alguém poderia me ajudar? addCommandHandler("car", function(thePlayer,veh) local x, y, z = getElementPosition (thePlayer) local veh = getElementsByType('vehicle') if isElementInRange(veh, x, y, z, 25) then outputChatBox("teste",thePlayer,255,255,255,true) end end end ) Print do erro: https://prnt.sc/12bhy03
  21. Versão = 1.5.8-release-20860.0.0.000 Tempo = Sat Apr 24 15:06:02 2021 Módulo = D:\jogos\GTA San Andreas\gta_sa.exe Código = 0xC0000005 Offset = 0x003C91CC EAX=212B4C68 EBX=212B4C58 ECX=0177FA78 EDX=001AC31C ESI=0000000000 EDI=000000001 EBP=0177FC2 8 ESP=0177FA58 EIP=007C91CC FLG=00210202 CS=0023 DS=002B SS=002B ES=002B FS=0053 GS=002B https://pastebin.mtasa.com/999993530
  22. Então queria saber se tem como e qual seria o script usado para não deixar alguém morrer, Exemplo a pessoa leva um tiro na cabeça e ao invés de morrer ela fica desmaiada, sei que tem vários script na net disso, mais nenhum deles é realmente oque eu preciso, queria um script que independente do que acontecer a pessoa não morrer, mesmo se cair de um lugar alto, alguém pode me ajudar em quanto a isso?
  23. então esse script deixa o id invisível para todo mundo, e queria colocar que somente membros da acl staff consiga ver o id, normalmente, já procurei tutorial e não entendi muito bem como fazer isso, alguém poderia me ajudar nessa questão? local drawDistance = 7 g_StreamedInPlayers = {} function onClientRender() local cx, cy, cz, lx, ly, lz = getCameraMatrix() for k, player in pairs(g_StreamedInPlayers) do if isElement(player) and isElementStreamedIn(player) then local vx, vy, vz = getPedBonePosition(player, 4) local dist = getDistanceBetweenPoints3D(cx, cy, cz, vx, vy, vz) if dist < drawDistance and isLineOfSightClear(cx, cy, cz, vx, vy, vz, true, false, false) then local x, y = getScreenFromWorldPosition(vx, vy, vz + 0.3) if x and y then if getElementAlpha(player) > 0 then -- se o alpha do player for maior que 0 mostra o ID local ID = getElementData(player, "ID") or "N/A" local w = dxGetTextWidth(ID, 0.1, "default-bold") local h = dxGetFontHeight(1, "default-bold") dxDrawText(""..ID.."", x - 1 - w / 1, y - 1 - h - 12, w, h, CorTag, 1.20, "default-bold", "left", "top", false, false, false, false, false) CorTag = tocolor(255, 255, 255) if getElementData(player, "Cor", true) then CorTag = tocolor(0, 255, 0) end end end end end else table.remove(g_StreamedInPlayers, k) end end addEventHandler("onClientRender", root, onClientRender) function CorTagid () if getElementData(localPlayer, "Cor", true) then setElementData(localPlayer, "Cor", false) else setElementData(localPlayer, "Cor", true) end end bindKey ( "z", "both", CorTagid ) function onClientElementStreamIn() if getElementType(source) == "player" and source ~= getLocalPlayer() then setPlayerNametagShowing(source, false) table.insert(g_StreamedInPlayers, source) end end addEventHandler("onClientElementStreamIn", root, onClientElementStreamIn) function onClientResourceStart() local players = getElementsByType("player") for k, v in pairs(players) do if isElementStreamedIn(v) and v ~= getLocalPlayer() then setPlayerNametagShowing(v, false) table.insert(g_StreamedInPlayers, v) end end end addEventHandler("onClientResourceStart", resourceRoot, onClientResourceStart)
  24. locais screenW , screenH = guiGetScreenSize () local exibir_painel = função falsa PainelDX () dxDrawLine (( telaW * 0,3807 ) - 1 , ( telaH * 0,1615 ) - 1 , ( telaW * 0,3807 ) - 1 , telaH * 0,7734 , tocolor ( 237 , 0 , 0 , 245 ), 1 , false ) dxDrawLine ( telaW * 0,6208 , ( telaH * 0,1615 ) - 1 , ( telaW * 0,3807 ) - 1 , ( telaH * 0,1615 ) - 1 , tocolor ( 237 , 0 , 0 , 245 ), 1 , falso ) dxDrawLine (( telaW * 0,3807 ) - 1 , tela H * 0,7734 , telaW * 0,6208 , telaH * 0,7734 , tocolor ( 237 , 0 , 0 , 245 ), 1 , falso ) dxDrawLine ( telaW * 0,6208 , telaH * 0,7734 , telaW * 0,6208 , ( telaH * 0,1615 ) - 1 , tocolor ( 237 , 0 , 0 , 245 ), 1 , falso ) dxDrawRectangle ( telaW * 0,3807 , telaH * 0,1615 , telaW * 0,2401 , telaH * 0,6120 , tocolor ( 3 , 0 , 0 , 153 ), falso ) dxDrawImage ( telaW * 0,4290 , telaH * 0,2227 , screenW * 0,1435 , screenH * 0.2747 , ": guieditor / images / examples / LavarMoney.png" , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , 255 ), false ) dxDrawText ( "Lavagem de Dinheiro" , screenW * 0.4305 , screenH * 0,1693 , tela W * 0,5652 , tela H * 0,2005 , tocolor ( 255 , 255 , 255 , 255 ), 0,70 , "bankgothic" , "center" , "center" , false , false , false , false , false ) dxDrawText ( "O dinheiro sujo pode ser lavado 100 mil por PenDrive com Trojan" , screenW * 0,4173 , tela H * 0,5117 , tela W * 0,5798 , tela H * 0,5638 , tocolor ( 255 , 255 , 255 , 255 ), 0,50 , "bankgothic" , "center" , "center" , false , true , false , false , false ) dxDrawLine (( screenW * 0.4239 ) - 1 , ( screenH * 0.6237 ) - 1 , ( telaW * 0,4239 ) - 1 , telaH * 0,7018 , tocolor ( 255 , 3 , 3 , 254 ), 1 , falso ) dxDrawLine ( telaW * 0,5798 , ( telaH * 0,6237 ) - 1 , ( telaW * 0,4239 ) - 1 , ( telaH * 0,6237 ) - 1 , tocolor ( 255 , 3 , 3 , 254 ), 1 , falso ) dxDrawLine (( telaW * 0,4239 ) - 1 , telaH * 0,7018 , telaW * 0,5798 , telaH * 0,7018 , tocolor ( 255 , 3 , 3 , 254 ), 1 , falso ) dxDrawLine ( telaW * 0,5798 , telaH * 0,7018 , screenW * 0.5798, (screenH * 0.6237) - 1, tocolor(255, 3, 3, 254), 1, false) dxDrawRectangle(screenW * 0.4239, screenH * 0.6237, screenW * 0.1559, screenH * 0.0781, tocolor(11, 0, 0, 203), false) dxDrawText("Lavar", screenW * 0.4231, screenH * 0.6237, screenW * 0.5798, screenH * 0.7018, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "center", false, false, false, false, false) dxDrawLine((screenW * 0.6040) - 1, (screenH * 0.1693) - 1, (screenW * 0.6040) - 1, screenH * 0.1953, tocolor(240, 254, 3, 254), 1, false) dxDrawLine(screenW * 0.6179, (screenH * 0.1693) - 1, (screenW * 0.6040) - 1, (screenH * 0.1693) - 1, tocolor(240, 254, 3, 254), 1, false) dxDrawLine((screenW * 0.6040) - 1, screenH * 0.1953, screenW * 0.6179, screenH * 0.1953, tocolor(240, 254, 3, 254), 1, false) dxDrawLine(screenW * 0.6179, screenH * 0.1953, screenW * 0.6179, (screenH * 0.1693) - 1, tocolor(240, 254, 3, 254), 1, false) dxDrawRectangle(screenW * 0.6040, screenH * 0.1693, screenW * 0.0139, screenH * 0.0260, tocolor(0, 0, 0, 131), false) dxDrawText("X", screenW * 0.6032, screenH * 0.1693, screenW * 0.6179, screenH * 0.1953, tocolor(255, 255, 255, 255), 0.60, "bankgothic", "center", "center", false, false, false, false, false) end addEvent("Exibir_Painel_Ao_Hitar_O_Marker", true) addEventHandler("Exibir_Painel_Ao_Hitar_O_Marker", root, function() if exibir_painel == false then addEventHandler("onClientRender", getRootElement(), PainelDX) exibir_painel = true showCursor(true) else RemoveEventHandler("onClientRender", getRootElement(), PainelDX) exibir_painel = false showCursor(false) end end) function isMouseInPosition ( x, y, width, height ) if ( not isCursorShowing( ) ) then return false end local sx, sy = guiGetScreenSize ( ) local cx, cy = getCursorPosition ( ) local cx, cy = ( cx * sx ), ( cy * sy ) return ( ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) ) end -- Modified version for DX Text function isCursorOverText(posX, posY, sizeX, sizeY) if ( not isCursorShowing( ) ) then return false end local cX, cY = getCursorPosition() local screenWidth, screenHeight = guiGetScreenSize() local cX, cY = (cX*screenWidth), (cY*screenHeight) return ( (cX >= posX and cX <= posX+(sizeX - posX)) and (cY >= posY and cY <= posY+(sizeY - posY)) ) end addEventHandler("onClientClick", getRootElement(), function(button, state) if button == "left" and state == "down" then if exibir_painel == true then if isMouseInPosition(screenW * 0.6040, screenH * 0.1693, screenW * 0.0139, screenH * 0.0260) then removeEventHandler("onClientRender", getRootElement(), PainelDX) exibir_painel = false showCursor(false) end end end end) local Sujo = getElementData(source, "moneysujo") or 0 addEventHandler("onClientClick", getRootElement(), function(button, state) if button == "left" and state == "down" then if exibir_painel == true then if isMouseInPosition(screenW * 0.4239, screenH * 0.6237, screenW * 0.1559, screenH * 0.0781) then if Sujo >= 100000 and "PenDrive Com Trojan" then setElementData(source, "moneysujo", -100000) givePlayerMoney(source, givePlayerMoney(source)+100000) end end end end end) Estou fazendo um script com Painel DX e estou tendo problema na parte de limpar o dinheiro pois não está funcionando eu clicko no botão de "Lavar" e não tira os 100k de dinheiro sujo para virar 100k limpo além disso para conseguir fazer essa lavagem com o dinheiro precisa está com um PenDrive com Trojan para cada lavagem de dinheiro, ou seja, cada pendrive lava 100k alguem pode me ajudar Imagem do painel: https://uploaddeimagens.com.br/imagens/NXxdneg
  25. Eu queria deixar esse nome tag com a funçao de quando o staff digitasse um comando o nome dele sumisse junto com a vida e o colete. alguem poderia me ajudar? words = {} SQLS3D = { qury = executeSQLQuery } chatTime = {} lastChatMessage = {} addEventHandler("onPlayerChat", getRootElement(), function(text, msgtype, thePlayer) local account = getAccountName(getPlayerAccount(source)) local name = getPlayerName(source) local root = getRootElement() local id = getElementData(source, "ID") or "N/A" local name = getPlayerName(source) local r,g,b = getPlayerNametagColor(source) local Account1 = getPlayerAccount ( source ) local new = "" local iter = 0 msg = string.gsub(text,"ـ","") for word in msg:gmatch("%S+") do iter = iter + 1 -- for i,swr in ipairs(words) do -- local src = word:lower():gsub("%s","") -- local src = src:gsub("#%x%x%x%x%x%x","") -- local src = src:gsub("%c","") -- local src = src:gsub("%p","") -- local pat = swr:lower():gsub("%s","") -- if src:find(pat) then -- local replaceString = "" -- for x=1,word:gsub("#%x%x%x%x%x%x",""):len() do -- replaceString = replaceString.."*" -- end -- word = word:gsub(word,replaceString) -- end -- end if iter == 1 and word:len() > 0 then word = word:gsub("%a",string.upper,1) end new = new..word.." " end if new ~= "" then msg = new end text = msg if chatTime[source] and chatTime[source] + tonumber(1000) > getTickCount() then cancelEvent() outputChatBox("Espere 1 segundo para poder digitar novamente!", source, 255, 0, 0) return else chatTime[source] = getTickCount() end lastChatMessage[source] = text local r, g, b = getPlayerNametagColor(source) cancelEvent() if isObjectInACLGroup("user." .. account, aclGetGroup("Console")) then cancelEvent(true) outputChatBox("#00ffff╠═⟦ #ffffffв#00ffff√#ffffffʟ#00ffff ⟧#2F2F2F ⌜ #00ff00Dona #ff0000Geral #2F2F2F⌟ #ffffff" .. name .. "#FFFFFF ("..id..") »#ffffff " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Subdono")) then cancelEvent(true) outputChatBox("#00ffff╠═⟦ #ffffffв#00ffff√#ffffffʟ#00ffff ⟧#2F2F2F ⌜ #00BFFFSub #ff0000Dono #2F2F2F⌟ #FFFFFF" .. name .."#FFFFFF ("..id..") »#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Admin geral")) then cancelEvent(true) outputChatBox("#00ffff╠═⟦ #ffffffв#00ffff√#ffffffʟ#00ffff ⟧ #2F2F2F⌜ #00FFFFAdministrador #FFFAFAGeral #2F2F2F⌟ " .. name .."#FFFFFF ("..id..") »#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then cancelEvent(true) outputChatBox("#00ffff╠═⟦ #ffffffв#00ffff√#ffffffʟ ⌟ #2F2F2F⌜ #FF0040Adminis#FFFFFFtrador #2F2F2F⌟ #FFFFFF" .. name .."#FFFFFF ("..id..") »#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Moderador")) then cancelEvent(true) outputChatBox("#00ffff╠═⟦ #ffffffв#00ffff√#ffffffʟ#00ffff ⟧ #2F2F2F⌜ #9B30FFModer#FFFFFFador #2F2F2F⌟ #FFFFFF" .. name .."#FFFFFF ("..id..") »#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("SuperModerator")) then cancelEvent(true) outputChatBox("#00ffff╠═⟦ #ffffffв#00ffff√#ffffffʟ#00ffff ⟧ #2F2F2F⌜ #00ff00Super#2F2F2F Moderador ⌟ #FFFFFF" .. name .."#FFFFFF ("..id..") »#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Ajudante")) then cancelEvent(true) outputChatBox("#00ffff╠═⟦ #ffffffв#00ffff√#ffffffʟ#00ffff ⟧ #2F2F2F⌜ #7FFFD4Ajud#FFFFFFante #2F2F2F ⌟ #FFFFFF" .. name .."#FFFFFF ("..id..") »#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("vip")) then cancelEvent(true) outputChatBox("#00ffff╠═⟦ #ffffffв#00ffff√#ffffffʟ#00ffff ⟧ #2F2F2F⌜ #FF00FFVIP #2F2F2F⌟ #FFFFFF" .. name .."#FFFFFF ("..id..") »#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Versatil Drifting")) then cancelEvent(true) outputChatBox("#00ffff╠═⟦ #ffffffв#00ffff√#ffffffʟ#00ffff ⟧ #2F2F2F⌜ #2F2F2FVЄƦƧƛƬƖԼ #FF0040ƊƦƖƑƬƖƝƓ ⌟ #FFFFFF" .. name .."#FFFFFF ("..id..") »#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("tagdovip")) then cancelEvent(true) outputChatBox("#00ffff╠═⟦ #ffffffв#00ffff√#ffffffʟ#00ffff ⟧ #2F2F2F⌜ #FFFFFFV҉I҉P#363636-™ #2F2F2F⌟ #FFFFFF" .. name .."#FFFFFF ("..id..") »#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("tdetag")) then cancelEvent(true) outputChatBox("#00ffff╠═⟦ #ffffffв#00ffff√#ffffffʟ#00ffff ⟧#2F2F2F⌜ #00BFFF✘ ŦŘØƤΔ ĐΔ €ŞĆØĆƗΔ ✘ #2F2F2F⌟ #FFFFFF" .. name .."#FFFFFF ("..id..") »#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("cvtag")) then cancelEvent(true) outputChatBox("#00ffff╠═⟦ #ffffffв#00ffff√#ffffffʟ#00ffff ⟧#2F2F2F⌜ #ff0000✞ ĆØΜΔŇĐØ V€ŘΜ€ŁĦØ ✞ #2F2F2F⌟ #FFFFFF" .. name .."#FFFFFF ("..id..") »#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Everyone")) then cancelEvent(true) outputChatBox("#00ffff╠═⟦ #ffffffв#00ffff√#ffffffʟ#00ffff ⟧ #2F2F2F⌜ #00BFFFJoga#FFFFFFdor #2F2F2F⌟ #FFFFFF" .. name .."#FFFFFF ("..id..") »#FFFFFF" .. text, root, 255, 255, 255, true) outputServerLog("CHAT: " .. name .. ": " .. text) end end )
×
×
  • Create New...