Leaderboard
Popular Content
Showing content with the highest reputation on 03/02/19 in all areas
-
Feito o que eu queria. Obrigado a todos que responderam. Isto que eu pretendia fazer: RESOLVIDO!3 points
-
Events tutorial The reason why I created this topic, is that a lot of people are struckeling with them. In this tutorial I will only discus the very basic of them. If you want more, then there is a list of links at the end with more information. If I made any mistakes in the code, please let me know because I am not going to test every part. What are events? (basic description) Events are something custom added by MTA to make it easier to bring scripting(Lua) closer to our game. If we do not have events, then the only thing we can do is give instructions to our game. But our code will never detect changes in our game. The same question again: "So what are the events?" Events are a way to communicate changes in our game to our scripts (or from our scripts). So for example my little ped(cat) gets ran over by a car. Then I really want to know about that, don't I? When an event activates, I describe this as: triggered (from the word trigger) Full wiki information can be found here: Event_system Before we can use events, what do we need to know? There are two things we need to know: The reason why it is triggered. <What happens?/when something happens?> In MTA this is the eventName of the event. (Example: you <ran over> my ped) Who is the one using the event? The event system in MTA is using elements as base (baseElement). This makes it easier to combine the what/when happens? with the one who is related to it. In MTA this is the source of the event. (Example: you ran over my <ped>) Trigger an event A scripting example: (this is not an official event) local ped = createPed( 120, 5540.6654, 1020.55122, 1240.545 ) -- my ped triggerEvent("onPedRanOver", ped) In this example, a custom event gets triggered to tell you that my new created ped has been ranOver. The eventName is "onPedRanOver" and the baseElement is ped. local ped = createPed( 120, 5540.6654, 1020.55122, 1240.545 ) -- my ped local drunkDriver = getRandomPlayer() triggerEvent("onPedRanOver", ped, drunkDriver) In this SERVERSIDE example, I am also adding an extra argument drunkDriver to use the player that ran over the ped. This is not required, but it makes it more complete. See syntax. Syntax bool triggerEvent ( string eventName, element baseElement, [ var argument1, ... ] ) TriggerEvent Receiving triggers Receiving triggers is a bit more complicated, because there are a lot of options for it. You can receive events by listening to them. It is like: You know that something is going to happen but you do not know when. The first step that you have to take is related to this question: "Do I want to receive a custom or not custom event?" Custom events are self created events. They only exist when a scripter makes them. Two lists of NOT CUSTOM EVENTS but default MTA events, serverside and clientside: Server_Scripting_Events Client_Scripting_Events Do I want to receive a CUSTOM event? In case of a custom event, you have to register/enable it first. If you do not enable it and trigger it, you will receive a warning/error about that in your debug console. Syntax bool addEvent ( string eventName [, bool allowRemoteTrigger = false ] ) AddEvent The example below, shows you how to enable a custom event only for trigger events within the same server/client side. addEvent("eventName") -- Is the same as: addEvent("eventName", false) If you put the second argument to false or not fill it in, this means that you can't communicate from the other server/client-side. This option is most likely used for security reasons. Some events shouldn't be able to trigger by the other side For example, worst case scenario: (remote events enabled for a default MTA event) Serverside code: addEvent("onPlayerWasted", true) Clientside code: triggerServerEvent("onPlayerWasted", player, 0, localPlayer, 0, 9, false) OnPlayerWasted If this event is enabled for remote trigger events, then it might be possible to cheating kills/deaths score. Of course, it is not likely that players can run their own clientside code, but it is not impossible in case of not trust able community resources. Enable a custom event for trigger events that crossing sides (From clientside to serverside. From serverside to clientside). addEvent("eventName", true) This event can now be used by remote trigger event functions. See list: Client to server TriggerClientEvent TriggerLatentClientEvent Server to client TriggerServerEvent TriggerLatentServerEvent Enable the event from our previous example: addEvent("onPedRanOver", false) local ped = createPed( 120, 5540.6654, 1020.55122, 1240.545 ) -- my ped local drunkDriver = getRandomPlayer() triggerEvent("onPedRanOver", ped, drunkDriver) If you do not use cross triggering, then I recommend to use the addEvent function in the same resource as where you are going to trigger from. This makes sure that the event is already added and that you will never receive this kind of error/warning "Event isn't added". If you put it in another resource which hasn't started yet, then after triggering you would still receive that error/warning. Start listening The next step is to add the addEventHandler. This function is used to listen to events. When an event is triggered, this handler(addEventHandler) will call the function you have attached to it, in MTA this function is called the handlerFunction. Syntax bool addEventHandler ( string eventName, element attachedTo, function handlerFunction [, bool getPropagated = true, string priority = "normal" ] ) AddEventHandler Resource 1 addEvent("onPedRanOver", false) local ped = createPed( 120, 5540.6654, 1020.55122, 1240.545 ) -- my ped local drunkDriver = getRandomPlayer() triggerEvent("onPedRanOver", ped, drunkDriver) Resource 2 function handlerFunction () end addEventHandler("onPedRanOver", root, handlerFunction) The first 3 arguments, the require ones: eventName attachedTo handlerFunction Making sure that the addEventHandler options are correct set-up. Resource 1 addEvent("onPedRanOver", false) local ped = createPed( 120, 5540.6654, 1020.55122, 1240.545 ) -- my ped local drunkDriver = getRandomPlayer() triggerEvent("onPedRanOver", ped, drunkDriver) Resource 2 function handlerFunction () end addEventHandler("onPedRanOver", root, handlerFunction) There are two conditions for an eventHandler to call the handlerFunction. 1. The event has to be exactly the same. In this case the event "onPedRanOver" is the same in both resources. 2. In both functions, triggerEvent and addEventHandler is an element being used. This element has to be exactly the same. (from where you trigger as well as where you receive) <OR> The triggered element from resource 1, has to be a CHILD of the element in resource 2. The root element is the very top layer of the MTA element structure. It will accept all elements you want to use for your events. See the element tree: If you do not understand the element tree please read this page: Element_tree Source variable The source of an event is the element that triggers the event. This variable isn't passed as an parameter, but it is predefined. This means that it is already created before hand. Some predefined variables do only exist under special conditions. The source variable is one of those, it is a hidden and local variable which is only available when a function is called by an event. List of predefined variables. addEvent("onPedRanOver", false) -- local ped = createPed( 120, 5540.6654, 1020.55122, 1240.545 ) -- my ped local drunkDriver = getRandomPlayer() triggerEvent("onPedRanOver", ped, drunkDriver) function handlerFunction (drunkDriver) iprint(source) -- ped element end addEventHandler("onPedRanOver", resourceRoot, handlerFunction) In this example the ped is the source. See how those two code blocks are connected: addEvent("onPedRanOver", false) -- local ped = createPed( 120, 5540.6654, 1020.55122, 1240.545 ) -- my ped local drunkDriver = getRandomPlayer() triggerEvent("onPedRanOver", ped, drunkDriver) function handlerFunction (drunkDriver) iprint(source) -- ped element end addEventHandler("onPedRanOver", resourceRoot , handlerFunction) resourceRoot In some examples, you see people use the resourceRoot instead of the root element for their addEventHandlers. The resourceRoot is an element created by a resource. This element holds all elements of that resource as (in)direct children. In the example above, the resourceRoot as baseElement will not work, because there are two resources. Each resource has it's own resourceRoot element. The resourceRoot is accessible with the same keyword: resourceRoot, but if you were to inspect the element in multiple resources, then the user data (element identifier) value is not the same. outputChatBox(inspect(resourceRoot)) If we were to put everything in one resource, then it would work: ? addEvent("onPedRanOver", false) -- function handlerFunction () end addEventHandler("onPedRanOver", resourceRoot, handlerFunction) -- local ped = createPed( 120, 5540.6654, 1020.55122, 1240.545 ) -- my ped local drunkDriver = getRandomPlayer() triggerEvent("onPedRanOver", ped, drunkDriver) In case of remote triggering, the resourceRoot in serverside and clientside is considered the same.(As long as they are part of the same resource) Why/when would we use resourceRoot? 1. Limit eventHandlers to the resource elements If you have 1000 markers in your server. One of the resources is for example a trucker mission, where you can get money by hitting markers. The resourceRoot element will make sure that the onMarkerHit event will only trigger for markers created by that resource. addEventHandler("onMarkerHit", resourceRoot, function () -- source element is the marker end) OnMarkerHit 2. Another benefit is that you are able to re-use the same eventNames. Resource 1 addEvent("onPedRanOver", false) function handlerFunction () end addEventHandler("onPedRanOver", resourceRoot, handlerFunction) -- local ped = createPed( 120, 5540.6654, 1020.55122, 1240.545 ) -- my ped local drunkDriver = getRandomPlayer() triggerEvent("onPedRanOver", ped, drunkDriver) Resource 2 addEvent("onPedRanOver", false) function handlerFunction () end addEventHandler("onPedRanOver", resourceRoot, handlerFunction) -- local ped = createPed( 120, 5540.6654, 1020.55122, 1240.545 ) -- my ped local drunkDriver = getRandomPlayer() triggerEvent("onPedRanOver", ped, drunkDriver) These two resources do use the same event, but will not trigger each other their addEventHandlers. Warning: If root was used, then they will!!!! ;@ Lets cross triggering with resourceRoot! Clientside triggerServerEvent("example", resourceRoot) Serverside addEvent("example", true) -- second argument is true! cross triggering enabled! addEventHandler("example", resourceRoot, function () end) getPropagated In this bigger example we will be talking about the option getPropagated. If this option is disabled, it will not detect children any more. Keep reading! After that start code scanning from A, to B and then to C. Syntax addEventHandler bool addEventHandler ( string eventName, element attachedTo, function handlerFunction [, bool getPropagated = true, string priority = "normal" ] ) Example: Clientside -- A triggerServerEvent("onClientPlayerLoaded", resourceRoot) -- trigger an event to serverside --------------------------------------- -- C addEvent("onResponseServer", true) -- first listener addEventHandler("onResponseServer", resourceRoot, function () outputChatBox("getPropagated enabled") end, true) -- getPropagated true by default. -- second listener addEventHandler("onResponseServer", resourceRoot, function () outputChatBox("getPropagated disabled") end, false) -- getPropagated is false. Serverside -- B addEvent("onClientPlayerLoaded", true) -- second argument is true! cross triggering enabled! addEventHandler("onClientPlayerLoaded", resourceRoot, function () --[[ client is a predefined variable, which represents the client/player that communicates with the server More information about predefined variables: https://forum.multitheftauto.com/topic/33407-list-of-predefined-variables/ ]] triggerClientEvent(client, "onResponseServer", resourceRoot) -- first trigger event local element = createElement("randomElement") -- making a randomElement triggerClientEvent(client, "onResponseServer", element) -- second trigger event end) How does this this code works? A. When a client his code has been started, it will execute a triggerServerEvent. (It doesn't wait for any other clientside files to be loaded) B. The server receives the event. And sends two triggerClientEvents back: The first one is using the resourceRoot as baseElement. The second one is using a randomElement as baseElement. Both are using the event "onResponseServer" C. There are two addEventHandlers listening to the event: "onResponseServer" The first one is using getPropagated and the second one is not using getPropagated. The randomElement that is created, is by default an indirect child of the resourceRoot of the same resource. What will happen? When firing the first trigger event, both listeners will call their handlerFunction. But when firing the second trigger event, only the first listener will call it's handlerFunction. The randomElement is an indirect child of resourceRoot, but because getPropagated is disabled it will not call it's handlerFunction. Other tutorials related to this one: See also this tutorial about deeper limiting event ranges within your resource and reducing addEventHandlers https://forum.multitheftauto.com/topic/100069-tut-addeventhandler-on-a-group-of-elements-small-tutorial/ More information Full wiki information: Event_system A list of more information about triggering events: (Client to client / server to server) TriggerEvent Client to server TriggerClientEvent TriggerLatentClientEvent Server to client TriggerServerEvent TriggerLatentServerEvent A list of more information about receiving events: AddEvent AddEventHandler RemoveEventHandler Two lists of MTA events, serverside and clientside: (warning: not custom events) Server_Scripting_Events Client_Scripting_Events Cancel events CancelEvent WasEventCancelled (warning: custom events ONLY) GetCancelReason (Server only) Cancel latent events and their status GetLatentEventHandles CancelLatentEvent GetLatentEventStatus2 points
-
2 points
-
You can't add them there automatic. But there are two other ways to start resources. 0. https://wiki.multitheftauto.com/wiki/GetResources https://wiki.multitheftauto.com/wiki/GetResourceState https://wiki.multitheftauto.com/wiki/XML (this can be a external or internal (meta.)xml file, and you can also generate for your mtaserver.conf file) or https://wiki.multitheftauto.com/wiki/JSON Ways of starting: https://wiki.multitheftauto.com/wiki/StartResource https://wiki.multitheftauto.com/wiki/RestartResource (requires admin rights) <include /> https://wiki.multitheftauto.com/wiki/Meta.xml (warning: the source resource can't be started if the included resources are missing or broken, this can be annoying or a benefit for validation)2 points
-
if ( elemnt == support_mymessage ) then دا يتحقق هل هذا الايديت بوكس هو الايديت اللي انتا تبيه حق السبورت او ممكن تسويها كدا addEventHandler("onClientResourceStart", resourceRoot, function() local screenW, screenH = guiGetScreenSize() help_grid1 = guiCreateGridList((screenW - 640) / 2, (screenH - 476) / 2, 640, 476, false) help_grid2 = guiCreateGridList(10, 52, 620, 414, false, help_grid1) support_gridlist = guiCreateGridList(10, 52, 620, 414, false, help_grid1) support_memo = guiCreateMemo(10, 7, 600, 310, "", false, support_gridlist) support_mymessage = guiCreateEdit(10, 350, 600, 30, "", false, support_gridlist) addEventHandler( "onClientGUIAccepted", support_mymessage, check ) end ) function check ( ) outputChatBox( guiGetText( source ) ) end مشكلتك انك عطيتنا اللوحة متقطعه يعني كل جزء في حتة1 point
-
1 point
-
دحين وين دي mainpage ?? : | + بدل دي guiSetProperty(support_gridlist, "Visible", "false") خليها كدا guiSetVisible( support_gridlist , false )1 point
-
1 point
-
What about your solution for this? Because i didn't test it/create it yet. Everything should be okay?1 point
-
addEventHandler( "onClientGUIAccepted", edit_msg, function () outputChatBox( guiGetText( source ) ) end )1 point
-
اولا الرسايل لازم تكون ميمو او جريد ليست ثانيا اعمل حدث عندما يدوس علي انتر عشان يبعت الرسالة onClientGUIAccepted وبعد كدا تحقق هل الرسالة فارغة ام لا if ( utf8.len( guiGetText( youEditBox ) ) > 1 ) then end وبعد كدا اهم خطوة وهي ترسل تريقر للسيرفر وبعد كدا ترسل تريقر من السيرفر للكلنت لكل الاعبين -- Client -- addEventHandler( 'onClientGUIAccepted' , yourEditBox , function( ) msg = guiGetText( source ) if( utf8.len( msg ) > 1 ) then triggerServerEvent( 'msgServer' , localPlayer , msg ) -- نرسل تريقر للسيرفر عشان نجيب الروت يعني جميع الاعبين end end ) -- Server -- addEvent( 'msgServer' , true ) addEventHandler( 'msgServer' , root , function( msg ) triggerClientEvent( root , 'msgClient' , source , msg ) -- نرسل تريقر للكلنت بجميع الاعبين عشان تظهر لكل الاعبين الرسالة الجديدة end ) : واخيرا لو تبي تضيف الرسالة A - لو كانت جريد ليست 1 - تضيف رو 2 - تحط الرسالة اسم الاعب اللي قالها ( طبعا الاعب احنا ارسالنا في التريقر ) addEvent( 'msgClient' , true ) addEventHandler( 'msgClient' , root , function( msg ) local PlayerName = '[ ' .. getPlayerName( source ):gsub( "#%x%x%x%x%x%x" , "" ) .. ' ]' newRow = guiGridListAddRow( yourGridList ) guiGridListSetItemText( yourGridList , newRow , MsgColumn , PlayerName .. ' : ' .. msg , false , false ) end ) B - لو كانت ميمو 1 - تجيب كل الكلام اللي كان مكتوب 2 - تضيف الرسالة الجديدة مع الكلام المكتوب addEvent( 'msgClient' , true ) addEventHandler( 'msgClient' , root , function( msg ) local PlayerName = '[ ' .. getPlayerName( source ):gsub( "#%x%x%x%x%x%x" , "" ) .. ' ]' -- نمسح الالوان من اسم الاعب local oldMessages = guiGetText( yourMemo ) if( oldMessages == '' ) then -- نتحقق هل دي اول رسالة guiSetText( yourMemo , msg ) else guiSetText( yourMemo , oldMessages .. '\n' .. PlayerName .. ' : ' .. msg ) end end ) وبالتوفيق1 point
-
@EDIT SERVER-SIDE setVehicleSirensOn( ); -- // para desativar as luzes da sirene Obrigado por avisar, @Lord Henry. É que eu fiz o script completo aqui para eu mesmo testar. O código está funcionando perfeitamente, realmente faltava essa função para ficar xuxu.1 point
-
@majqq@Pirulax I am terrible sorry. It seems like my information is partly incorrect. I tested it: It seems that it only will destroy children when you manually destroy an element. (It will only destroy it's children with destroyElement + propagation is enabled) And changing the parent to player doesn't work. Information that is still correct: Sound elements do destroy them self after ending.1 point
-
1 point
-
1 point
-
-------------------------3 parte---------------------- As funções dele envolvem salvar dados. Vc poderia sim usá-lo para salvar dinheiro 0 nas contas. Mas vc teria que reprogramar o sistema para adicionar um comando que faça isso. E sim, esse mod funciona obrigatoriamente com banco de dados. Ou salvando no banco de dados nativo ou salvando em um banco de dados criado por ele mesmo. Teria que abrir o código dele pra ver isso. A principio ele salva no banco de dados internal.db.1 point
-
Vamos por partes. Nesse caso, por se tratar de apenas 40 contas. Dá pra editá-las manualmente acessando o banco de dados internal.db usando o programa gratuito DB Browser For SQLite e setando a grana das contas uma por uma em 0. Ou se preferir fazer via código, vc vai precisar obter todas elas com getAccounts e verificar todas elas através de um loop for que vai setar a data da grana em 0 em cada uma das contas. OU Você pode simplesmente deletar todas as contas, em vez de ir setando grana 0, delete cada conta com removeAccount. Mas eu particularmente acho mais fácil acessar o banco de dados pra fazer isso do que programar um script temporário só pra fazer isso. ------------------2 parte-------------------- Já vi um mod de concessionária que funcionava assim também, com banco de dados MySQL criado pelo próprio resource. Mas eu sempre tive problemas pois toda vez que o servidor era desligado, todos os carros eram perdidos. Por isso acabei recriando outra concessionária que salva tudo no banco de dados nativo do MTA em SQLite no registry.db e lá ele não perde os dados. Verifique se o seu mod funciona corretamente, caso contrário os jogadores perderão os veículos após quedas do servidor. Que eu saiba, mods de painel de login geralmente não criam bancos de dados (existem raras exceções). Eles geralmente salvam no banco de dados nativo do MTA por meio da função addAccount. Elas ficam salvas no internal.db, as senhas são criptografadas, então nem mesmo o dono do servidor consegue saber. Ele só vai ver um código serial no lugar da senha. Nunca testei se deletar o banco de dados inteiro causa alguma falha no servidor, sempre que eu preciso fazer alguma alteração, acesso ele por meio do programa que citei anteriormente. E quando preciso deletar uma conta específica, faço por meio de comando no painel Admin. (parecendo um Hacker) Não tenho certeza, mas eu ACHO que o servidor recria o banco de dados ao iniciar, caso ele não exista. Não esqueça de verificar no arquivo ACL.xml (abra com notepad++) se alguma das contas está lá. Se tiver, delete a linha que ela aparece. Contas que não existem podem dar erros nas ACL.1 point
-
Use o programa: SQLiteStudio Abra o 'SQLiteStudio' Importa o arquivo 'internal.db' (arquivo encontrado em: \server\mods\deathmatch\) Vai na tabela 'userdata' Clique no menu 'Data' Aperte 'Ctrl + A' Aperte em 'Delete' Aperte 'Ctrl + Enter'1 point
-
addEventHandler( "onClientMarkerHit", marker, function ( p, md ) if p == localPlayer and md and ( not getElementData(localPlayer,"prison") ) then if not isInColExport () then guiSetVisible(Window_VS, not guiGetVisible(Window_VS)) guiSetVisible (Window_CHK, false) playSound(":EQPsons/open.wav") showCursor(guiGetVisible(Window_VS)) vehsa = getElementData(localPlayer,"spawnedcars") or {} vehs = "" for ind,veh in ipairs(vehsa) do if vehs ~= "" then vehs = vehs..", "..veh.."" else vehs = vehs..""..veh.."" end end end end end ) 'marker' deve ser a variável da função createMarker1 point
-
1 point
-
Não é tão complicado. Para desativar o som de sirene e giroflex, basta usar essa função no lado client. function fClientResourceStart( ) setWorldSoundEnabled( 17, 10, false, true ); setWorldSoundEnabled( 17, 11, false, true ); end addEventHandler( "onClientResourceStart", resourceRoot, fClientResourceStart ); As funções que você deverá usar são: CLIENT-SIDE bindKey( ); -- // para fazer uma função de toggle (down, up), verificando se o jogador está segurando ou não a tecla H playSound3D( ); -- // para tocar o áudio setSoundVolume( ); -- // para alterar o volume da sirene setSoundMinDistance( ); -- // altere para 1.0 setSoundMaxDistance( ); -- // a distância que os jogadores irão ouvir attachElements( ); -- // fazer com que o elemento áudio grude no jogador responsável por apertar a tecla H triggerServerEvent( ); -- // para sincronizar o áudio (client -> server) SERVER-SIDE triggerClientEvent( ); -- // mandar o áudio e o jogador responsável por apertar a tecla H para o client1 point
-
1 point
-
1 point
-
JSON passa longe de ser uma linguagem de programação. Ele é um formato hierárquico de dados (como XML) muito utilizado no armazenamento e transferência de dados @Vazern vamos supor que eu tenha o seguinte arquivo: info.txt ou info.json { "player1" : { "nick" : "zLastink", "mail" : "[email protected]", "pass" : "1234", }, "player2" : { "nick" : "Jonnut", "mail" : "[email protected]", "pass" : "4321", } } Eu consigo facilmente carrega-lo como uma tabela no MTA: file = fileOpen("info.txt") json = fileRead(file, fileGetSize(file) tbl = fromJSON(json) print(tbl["player1"]["nick"]) print(tbl["player2"]["nick"]) fileClose(file) E o mesmo pode ser feito transformando uma tabela do MTA em JSON (toJSON) e salvando como se fosse uma "string".1 point
-
I'm not a Discord type of person, so I'll keep waiting for updates on this post. I'm tired of generic servers that use the same scripts, this looks original, keep it up.1 point
-
Cara, recomendo que estude inglês. Tudo na área da tecnologia precisa de inglês. Ou vc faz curso em uma escola de idiomas (tipo Wizard, CCAA, etc) ou vc baixa o app do Duolingo e aprende jogando.1 point
-
JSON é uma linguagem de programação. Com toJSON você pode converter um valor para string, e com fromJSON o você converte um valor que já está em JSON para o valor original novamente. addEventHandler( "onResourceStart", resourceRoot, function( ) executeSQLQuery( "CREATE TABLE IF NOT EXISTS save ( account TEXT, pos TEXT )" ); end ); function savePosition( player ) local account = getPlayerAccount( player ); if ( not isGuestAccount( account ) ) then local account_name = getAccountName( account ); local result = executeSQLQuery( "SELECT pos FROM save WHERE account = ? LIMIT 1", account_name ); local x, y, z = getElementPosition( player ); local pos = toJSON( { x, y, z } ); if ( table.maxn( result ) == 0 ) then executeSQLQuery( "INSERT INTO save ( account, pos ) VALUES ( ?, ? )", account_name, pos ); else executeSQLQuery( "UPDATE save SET pos = ? WHERE account = ?", pos, account_name ); end end end function loadPosition( player ) local account = getPlayerAccount( player ); if ( not isGuestAccount( account ) ) then local account_name = getAccountName( account ); local result = executeSQLQuery( "SELECT pos FROM save WHERE account = ? LIMIT 1", account_name ); if ( table.maxn( result ) > 0 ) then local x, y, z = fromJSON( result[ 1 ][ "pos" ] ); setElementPosition( player, x, y, z + 1 ); end end end split separa uma string em substrings, você especifica um caractere que sera usado como separador, ele ira retornar uma table com as substrings. local string = "a;b"; local table_ = split( string, ";" ); -- table_ está com o valor de uma tabela, com duas substrings. { "a", "b" }; for _, character in ipairs( table_ ) do outputChatBox( character ); end -- result; --> a; --> b; unpack separa todos os valores que estão na table. local pos = { 0, 0, 0 }; addCommandHandler( "gotozero", function( ply ) local x, y, z = unpack( pos ); -- { 0, 0, 0 } to 0, 0, 0; setElementPosition( ply, x, y, z ); end ); Acho que consegui explicar corretamente ;x1 point
-
mtaserver.conf At the end of the file <resource src="admin" startup="1" protected="0" /> <resource src="defaultstats" startup="1" protected="0" /> <resource src="helpmanager" startup="1" protected="0" /> <resource src="joinquit" startup="1" protected="0" /> <resource src="mapcycler" startup="1" protected="0" /> <resource src="mapmanager" startup="1" protected="0" /> <resource src="parachute" startup="1" protected="0" /> <resource src="performancebrowser" startup="1" protected="0" /> <resource src="reload" startup="1" protected="0" /> <resource src="resourcebrowser" startup="1" protected="1" default="true" /> <resource src="resourcemanager" startup="1" protected="1" /> <resource src="scoreboard" startup="1" protected="0" /> ....1 point
-
We're still going strong! The Development Update for January 2019 has just been released, going over how December's Alpha testing went, web development progress and what we have planned for February. Tell us what you think on Discord! Read it here: https://forums.emeraldgaming.net/topic/332-development-update-6-january/1 point
-
Que tal, he creado mi primera función a base de algunos de mis conocimientos, aquí la comparto con la comunidad: local unlerp = function(from,to,lerp) return (lerp-from)/(to-from) end function dxDrawProgressBar( startX, startY, width, height, progress, color, backColor ) local progress = math.max( 0, (math.min( 100, progress) ) ) local wBar = width*.18 for i = 0, 4 do --back local startPos = (wBar*i + (width*.025)*i) + startX dxDrawRectangle( startPos, startY, wBar, height, backColor ) --progress local eInterval = (i*20) local localProgress = math.min( 1, unlerp( eInterval, eInterval + 20, progress ) ) if localProgress > 0 then dxDrawRectangle( startPos, startY, wBar*localProgress, height, color ) end end end Link de la función en la wiki1 point
-
طب أخوي ليش دخلت بـ نيتي على طول !! انا ابي اسوي لوحة للكونسلية فيها خيارات الي هي توزيع ساعات ومسابقات وصك باند وسحب رتب وصلاحيات اسل ...0 points