Jump to content

Search the Community

Showing results for tags 'export'.

  • 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

Found 6 results

  1. Olá senhoras e senhores. Tenho uma micro-dúvida com relação ao desempenho quando um resource controla os outros. A situação é a seguinte: Tenho 1 resource de painel de gerenciamento de mods de veículos (chamaremos de vehMods). Nesse painel tem uma lista com todos os veículos com as colunas ID, Veículo (nome), Status (ativado/desativado). Quando o jogador clica 2x em um veículo da lista, o painel ativa/desativa a modificação daquele veículo. Mas a modificação está em outro mod de veículo, cada veículo tem seu próprio resource de modificação (exemplo de resource: 420TaxiBMW). Dai o resource do painel vai gerenciar este outro resource do Taxi. Atualmente estou controlando os demais resources apenas forçando o jogador a executar o comando deles depois de clicar no painel. Ex: O jogador clica 2x no item da lista "Taxi". Dai o painel força o jogador que clicou a usar o comando /enableVeh 420 (o 420 ele pega de acordo com o ID que aparece na lista e o comando enableVeh ele usa dependendo do status que aparece na lista. Se estiver como "desativado", ele usa /enableVeh. Se estiver "ativado", ele usa /disableVeh. Dai com esse comando, o mod do Taxi vai aplicar/remover a modificação no Taxi e mandar uma mensagem de confirmação. Como poderia ser: Eu estava pensando em trocar por funções exportadas (call/exports). No entanto na Wiki tem um aviso que essa função é pesada quando executada para chamar funções de outros resources. Cada mod de veículo exportaria sua função que ativa/desativa seu veículo. Logicamente essas funções vão seguir o mesmo padrão, assim como os comandos seguem atualmente. Dai o painel passaria a não precisar mais da permissão especial function.executeCommandHandler (ou acesso Admin). Do jeito que está, além do painel precisar da permissão especial pra funcionar, ele usa triggers para passar o clique do painel (client-side) para o server-side para só então fazer o executeCommandHandler. Já tentei colocar TODOS os veículos no mesmo resource, mas ele estourou o limite de tamanho de segurança do MTA, que passa a não carregar os arquivos excedentes para evitar a queda do servidor. Imagina se eu carregasse isso num server hosteado! Geral ia tomar disconnect! O que vcs acham? Manter por comando forçado ou trocar por função exportada? (ou uma terceira sugestão)
  2. This is the code: addEvent ( "aPlayer", true ) addEventHandler ( "aPlayer", _root, function ( player, action, data, additional, additional2, kickedname ) if checkClient( "command."..action, source, 'aPlayer', action ) then return end if not isElement( player ) then return -- Ignore if player is no longer valid end if ( hasObjectPermissionTo ( source, "command."..action ) ) then local admin = source local mdata = "" local more = "" if ( action == "kick" ) then local reason = data or "" mdata = reason~="" and ( "(" .. reason .. ")" ) or "" setTimer ( kickPlayer, 100, 1, player, source, reason ) exports.ig_kickban:showBoxS (root ,"Kirúgás", player.." kirúgta "..source.." nevű játékost", "kick") the exports.ig_ki...etc line does not working.. why? i get this error: "Attempt to concatenate global source (a userdata value)"
  3. Idea: Creating a marker on Map "Draqonlife" (gamemode play), which leads you to to another map. In this case "DraqonDocks" (gamemode race). known issues to be ignored: event triggers any marker known issues to be fixed: after gamemode change, the map wont change. Marker.lua : >Creates a marker (works) >Triggers player on entering and leaving any Marker (works) >Starts gamemode race (works) ! Does not start Map ! !! No error when map does not start !! !! ERROR: lobby/ChangeMode.lua:7: attempt to call global 'changeGamemodeMap' (a nil value) !! resourceRoot = getResourceRootElement() function onCurrentResourceStart(Draqonlife) local resourceName = getResourceName(Draqonlife) outputChatBox("Hello and welcome to " .. resourceName .. "!") Marker = createMarker (2860, -2115, 10, "corona", 4.0, 0, 0, 255, 255) -- create Marker end addEventHandler("onResourceStart", resourceRoot, onCurrentResourceStart) //Create Marker function MarkerHit( hitElement, matchingDimension ) local elementType = getElementType( hitElement ) local resource = getResourceFromName ("race") -- | this works, startResource( resource ) -- | really good tho --local resource = getResourceFromName ("DraqonDocks") --startResource( resource ) // If I try to start the map Resource directly after the race resource, // the Map resource wont load up end addEventHandler( "onMarkerHit", root, MarkerHit) //Should start gamemode race (and map) function MarkerLeave( leaveElement,matchingDimension) local elementType = getElementType( leaveElement ) local resource = getResourceFromName ("DraqonDocks") -- |Also not working, server ignores this line, startResource( resource ) -- |as it Ignores this line too. end addEventHandler( "onMarkerLeave", root, MarkerLeave ) ChangeMode.lua > My Idea to fix this problem --Thats why i want to import the mapmanager (or the function changeGamemodeMap) --Sadly I found no useful documentation for my case. --adding <exports.mapmanager:changeGamemodeMap/> to the meta.xml of the scripts didnt work function changeGamemodeMap() changeGamemodeMap("DraqonDocks", "race") -- this doesnt work end addCommandHandler("420", changeGamemodeMap) ___________________________________________________________________________________________ It would be very kind if someone could enlight me and give me a short introduction to using mapmanagers functions properly. Sadly the Mapmanager post in wiki didnt help me too much. If you find a fix for the existing (half working) Marker.lua, then I'd be really glad too I would love to get feedback and already thank everyone
  4. Hello, I do have a question about calling an exports. I have an export to add profiles to an xml file the export is: exports.XML:addProfileToXML(id, username); Now I want to use this export event in an javascript function, but it is not triggering the function. It does work if I try to export it clientside but it doesn't in js. I tried using it with or without the "exports.XML:" but it doesnt work mta.triggerEvent("exports.XML:addProfileToXML", id, username); mta.triggerEvent("addProfileToXML", id, username);
  5. Hola, quisiera saber: ¿como hago para poder exportar una GUI? Por ejemplo quiero abrir esa gui desde un botón del panel freeroam. Gracias
  6. Hi guys I was looking into: call and I was wondering, for example; you have the function outputChatBox("") which works both client and server side with the same name. Will I be able to do the same with exports. Example; Client function drawDxStuff () --dx stuff end addEvent("drawDxStuff", true) addEventHandler("drawDxStuff", getRootElement(), drawDxStuff) Server function drawDxStuff() triggerClientEvent(source, "drawDxStuff", source) --source would probably be the player calling the function end Meta <export function="drawDxStuff" type="server"/> <export function="drawDxStuff" type="client"/> Would this work or will this give an error cause they have the same name or for other reasons? Kind Regards
×
×
  • Create New...