Jump to content

Search the Community

Showing results for tags 'source'.

  • 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 13 results

  1. Hello, I recently returned to making a server after a year and I wanted to remind myself how the "source", "root", "this", "sourceResource", "sourceResourceRoot", "client" etc. Elements worked. Unfortunately, when I checked the MTA wiki, I didn't understand any of these elements. In general, the best help would be if someone explained to me how these elements work on examples for AddEventHandler because in mta wiki there is only one example for a "source" and I guess "root"? element
  2. Olá pessoal, hoje vamos falar de algo que destrói a cabeça de novatos no MTA: Quando e onde devo usar source? Então vamos a primeira pergunta que surge, mas o que diabos é source no MTA? source nada mais é do que: parâmetro determinado por uma função ou evento. Você agora você deve estar perguntando o que é parâmetro. É muito simples, pense comigo na função addCommandHandler. Ela tem 2 parâmetros predeterminados que são (Quem_Executou, Nome_Do_Comando), como na imagem abaixo: Como você pode ver na imagem, ela tem os 2 parâmetros citados acima. Lembrando que: a própria wiki fala sobre os parâmetros. playerSource: O jogador que acionou o comando ou o console do servidor. Se não for acionado por um jogador (por exemplo, por administrador) ou console de servidor, isso será falso. commandName: O nome do comando que foi acionado. Isso é útil se vários comandos passarem por uma mesma função. Mesmo o parâmetro sendo predeterminado, você pode botar o nome que você quiser, por ex: O parâmetro de quem executou o comando é playerSource, mas você pode botar qualquer nome como: p, player, sujeito, shuppinga e etc.... da mesma maneira o commandName (nome do comando), você pode botar (nome_do_comando, comando). Como você prefere. (mas é claro, siga um padrão a qual os outros programadores possam entender seu código !!) _____________________________________________________________ Mas quando devo usar source então? Simples, quando não existe o parâmetro que indique o sujeito. Por exemplo, o evento onPlayerWasted. O evento onPlayerWasted tem o seguintes parâmetros: totalAmmo - A munição total que a vitima tinha quando morreu, killer - O assassino que matou a vitima, killerWeapon - O id da arma do assassino, bodyPart - A parte do corpo da vítima que foi atingida quando ela morreu, stealth - Um valor booleano representando se esta foi ou não uma morte furtiva. Note que não existe o parâmetro vítima. Então aqui que entra o source. Mas como saber o que é o source? A própria wiki diz, basta ler A source deste evento é o jogador que morreu ou foi morto. Então o tutorial fica por aqui :), bye bye. (lembrando que essas fontes são próprias, então pode ser um conteúdo incorreto, mas espero ter ajudado a tirar a dúvida, lembrando que ela pode ser corrigida por alguém de bom conhecimento sobre do conteúdo.)
  3. download it here https://github.com/rivor/dayz-mta screenshots http://prntscr.com/heso7h http://prntscr.com/hesp1n http://prntscr.com/hesp9l http://prntscr.com/hespjo http://prntscr.com/hesqgu http://prntscr.com/hesqqz http://prntscr.com/hesrb8 http://prntscr.com/hesrhg http://prntscr.com/hesrqh http://prntscr.com/hessgx http://prntscr.com/hested
  4. Estou fazendo um sistema de Porte de Armas + Venda de Armas. E eu quero deixar assim, só quem pode comprar arma é quem tem o porte de armas. Quem não tem, não consegue comprar as armas. Alguém que possa me ajudar?
  5. I wanted to ask if there is a possibility of the disappearance of the weapon that we are currently holding ... for example, I will enter a function in the script addEventHandler(" onResourceStart ", root, function () giveWeapon (source, 31, 69) end) And the gun I got, I want her to disappear. So how can I do that?
  6. -- server side cylinder = createMarker(-712.09100, 967.01917, 12.33547-1, "cylinder", 1.5, 255, 50, 0, 255) setElementData(cylinder, "BoxWithPoints", 0) function TIMER() if getElementData(cylinder, "BoxWithPoints") >= 8 then setElementData(cylinder, "BoxWithPoints", 8) else setElementData(cylinder, "BoxWithPoints", getElementData(cylinder, "BoxWithPoints")+1) end if isElementWithinMarker(source, cylinder) then triggerServerEvent("givePointsToServer", root) PointsServer = getElementData(source, "points") BoxPoints = getElementData(cylinder, "BoxWithPoints") setElementData(source, "points", PointsServer + BoxPoints) setElementData(cylinder, "BoxWithPoints", 0) end end setTimer(TIMER, 3000, 0) -- client side setElementData(getLocalPlayer(), "points", 0) addCommandHandler("ShowMyPoints", function() outputChatBox(tostring(getElementData(getLocalPlayer(), "points")), 255, 255, 0) end) addEvent("givePointsToServer", true) addEventHandler("givePointsToServer", root, function(player) local player = client setElementData(player, "points", getElementData(player, "points")) end) The problem is with the ruler where isElementWithinMarker (source, cylinder) shows me the error that argument 1 got nil, I don't know what to think about it because I checked meta.xml and server side and client side is the correct type, could someone explain why is this happening?
  7. I would like to know what commands I need for this script. And I don't accept answers about "slothbot / slothman" commands, because I want to use commands directed to Ped, eg "CreatePed", the best answer that helps me will get a love of me
  8. function enableAccount ( accountJ ) if not isGuestAccount ( accountJ ) then if accountJ then local source = getAccountPlayer ( accountJ ) local XP = getAccountData ( accountJ, "XP" ) or 0 setElementData ( source, "XP", XP ) local Level = getAccountData ( accountJ, "Level" ) or 0 setElementData ( source, "Level", Level ) end end end function saveAccount ( accountJ ) if accountJ then local source = getAccountPlayer ( accountJ ) local XP = getElementData(source, "XP" ) or 0 setAccountData ( accountJ, "XP", XP ) local Level = getElementData(source, "Level" ) or 0 setAccountData ( accountJ, "Level", Level ) end end ---- function restartScript ( res ) if res == getThisResource ( ) then for i, player in ipairs ( getElementsByType ( "player" ) ) do local acc = getPlayerAccount ( player ) if not isGuestAccount ( acc ) then enableAccount ( acc ) end end end end addEventHandler ( "onResourceStart", getRootElement ( ), restartScript ) addEventHandler("onPlayerLogin", root, function( _, acc ) enableAccount ( acc ) end ) function stopScript (res) if res == getThisResource ( ) then for i, player in ipairs ( getElementsByType ( "player" ) ) do local acc = getPlayerAccount ( player ) if not isGuestAccount ( acc ) then saveAccount ( acc ) end end end end addEventHandler ( "onResourceStop", getRootElement ( ), stopScript ) function playerQuit ( quitType ) local acc = getPlayerAccount ( source ) if not isGuestAccount ( acc ) then if acc then saveAccount ( acc ) end end end addEventHandler ( "onPlayerQuit", getRootElement ( ), playerQuit ) function uparLevel(source) local exp = getElementData(source, "XP") local exps = tonumber(getElementData(source, "XP")) local lvls = tonumber(getElementData(source, "Level")) if lvls and exps then local needexp = 1000 if not exp then setElementData(source, "Level", 0) setElementData(source, "XP", 0) else if exps >= needexp then setElementData(source, "Level", lvls + 1) setElementData(source, "XP", 0) end end end end setTimer(uparLevel, 60, 1) Esse é meu código de level, mas está com três erros, esse level será exibido em uma hud, já estou ciente que não é possível usar source em um setTimer(), ja coloquei um for i, v in pair(getElementByType), mas quando eu coloco ele generaliza e seta o elementdata para todos os players.
  9. Server closed, mode resources https://drive.google.com/file/d/1a1LhPHrO0mmq2bSfqlUhCwS2BOwyQeCt/view
  10. Guest

    help

    guys i want to ask you when i type ' source ' and when i type ' thePlayer' for example: outputChatBox ( "Text", source ) outputChatBox ( "Text", thePlayer )
  11. function test() setElementPosition ( mark, pos.x,pos.y,pos.z ) end addEventHandler("onMarkerHit", mark, test) this is the code. if i hit the marker, the element position change for all players.. how to fix this? sorry for my bad english.
  12. Open Source Roleplay Hi there. As most of you know there aren't many strict roleplay servers on Multi Theft Auto for various reasons; one of the main reasons being that there aren't any roleplay resources out there for one to download and create a server, so people resort to using leaked roleplay scripts from previously hacked servers, which results in DDoS wars, hacking, revenge, servers getting taken down, and so on. In the end, only one server stays up and that is the one and only OwlGaming that has been around since 2014. Ofcourse you can find old and outdated roleplay scripts on the internet that you could use for your server for example vG and uG scripts. But there's no point in using those since they're old, malfunction and players dislike them. For a long time no one has ever decided to work publicly on an open source roleplay resource pack. I think if we want MTA to evolve it should be time that we all unite and get our hands on some RP scripts that anyone can download and make a server with. You may ask: wouldn't this mean there'd be tons of identical roleplay servers out there? There would, but that's actually the point. If we want MTA to grow and attract more players to it this is the solution: allow people to create their own rolpeplay servers legally without using any stolen scripts. This thread is a suggestion and its intention is to discuss this matter and maybe gather scripters to create this unique Open Source Roleplay resource pack for the community to use. It doesn't need to be super high quality and detailed. It should contain the basic scripts that allow roleplay to take place. For those that are not very familiar with it let me list some down: • Account System • Login Panel • Tutorial • Vehicle System • Property/Interior System • Bank/Currency System • Inventory System • Faction System • Elevator System • Faction System • Gate System • Fuel System • Chat System • GPS Sytem | Map Blips • Help System • Admin System • Radio System • Phone System • Donation System • Event System ... Let's end the suffering, the DDoS wars, the hacking, the leaked scripts and let's all join together and create the best roleplay scripts out there! It won't take long to make and it won't require a lot of effort if done in a large team of contributors. And thanks to MTA's almost non-existing scripting limitatios we can beat SAMP in this! Leave your opinion and comment below. Cheers. <3
  13. Hi! I have a faction panel, and I want to do that I have a list of faction vehicles with label, and when I click one of these, give me informations of the clicked vehicle. With the members(players) I can do it, because there is a getPlayerFromName. But with vehicles how can I do this?
×
×
  • Create New...