Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 21/06/20 in all areas

  1. Apenas uma observação: onPlayerCommand também é chamado ao mandar mensagens no chat, pois internamente vc está usando o comando /say Mensagem
    2 points
  2. Sim, é possível fazer. Você pode escolher algumas formas de fazer; algumas delas são: banco de dados ou um simples arquivo de texto. Há vários eventos que detectam o que aconteceu dentro do servidor, seja com jogadores ou o servidor em si. Deixarei abaixo alguns eventos que possam ser úteis: [Antes de tudo, considere usar getRealTime para obter o horário e/ou dia que tal ação aconteceu. Em outras palavras, para ter um controle melhor sobre os acontecimentos.] onPlayerChat - Pode ser útil para obter e armazenar as mensagem que os jogadores enviaram no servidor; onPlayerCommand - Utilizado para obter os comandos que os jogadores executaram no servidor; onPlayerWasted - Com esse evento, você pode obter o jogador que matou o outro, ou suicídio; onPlayerChangeNick - Útil para obter a alteração do nome de um jogador; (Exemplo: fiz besteira no servidor e rapidamente mudei de nome. Com um registro em mãos, você iria ter uma prova) onPlayerConnect - O evento é chamado assim que um jogador clica para entrar no servidor, isto é, antes de entrar, digamos assim. Decidi adicioná-lo a lista de eventos pois pode ser útil; onPlayerPrivateMessage - Pode valer a pena salvar o registro de mensagens que os jogadores mandam via privado (/msg); onPlayerLogin - O MTA por si só já salva os registros de logins, mas caso queira criar um do zero para o seu sistema, vá em frente. Exemplo: Imagem do arquivo de registro: Lembrando que é possível salvar qualquer tipo de registro, basta usar a criatividade.
    2 points
  3. você pode usar a renderização do cliente e verificar se o mouse está na posição, para mudar de cor, aqui está um exemplo local sX, sY = guiGetScreenSize() local r, b, g, alpha = 0, 0, 0, 0 local visible = false local state 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 function draw() if visible = true then dxDrawRectangle(sX * 0.0154, sY * 0.3008, sX * 0.2284, sY * 0.3242, tocolor(r, b, g, alpha)) if isMouseInPosition(sX * 0.0154, sY * 0.3008, sX * 0.2284, sY * 0.3242) then r,b,g = 255,0,0 else r,b,g = 0,0,0 end end end function fadeIN_FadeOut() if state == 'increase' then if alpha < 1 then alpha = alpha + 5 end if alpha > 254 then removeEventHandler('onClientRender',fadeIN_FadeOut) end elseif state == 'decrease' then if alpha > 254 then alpha = alpha - 5 end if alpha < 1 then removeEventHandler('onClientRender',fadeIN_FadeOut) end end end bindKey('F2','down', function() if visible == false then visible = true addEventHandler("onClientRender", root, draw) addEventHandler("onClientRender", root, fadeIN_FadeOut) state = 'increase' else visible = false removeEventHandler("onClientRender", root, draw) addEventHandler("onClientRender", root, fadeIN_FadeOut) state == 'decrease' end end)
    1 point
  4. 1 point
  5. Just don't use MD5, instead of bcrypt.. please. Here is NanoBob's tutorial, how to handle passwords: https://forum.multitheftauto.com/topic/119243-user-authentication-password-handling-and-doing-it-safely/ (Functions in php: password_hash, password_verify)
    1 point
  6. Pois é, e adivinha quem foi que criou essa função? ahauahuahaua
    1 point
  7. https://wiki.multitheftauto.com/wiki/IsVehicleReversing <- usa esta função para verificar se o veículo esta dando ré e use marker corona para fazer a luz
    1 point
  8. Que no tire errores en el debug es buena señal pero no te asegura que esos scripts se ejecuten de forma correcta. Podrías hacerle un barrido con el rescpu para ver los recursos que están consumiendo más recursos e intentar optimizarlos. Distribuir correctamente la ejecución de código es una tarea de las más importantes. Según he leído tienes un porrón de scripts por lo que deberías ir fijándote poco a poco los más "problemáticos". Algunos de los causantes de una ralentización pueden ser: Bucles muy grandes (véase carga de mapas Lua con bastantes objetos) ejecutados al mismo tiempo. Eventos de onClientRender que no se ligan a ninguna función y se ejecutan constantemente. Timers infinitos que ejecuten X cantidad de tareas a la vez. Mala distribución de los elementData. Aunque también te digo que ya de por sí, si inicias tu servidor en local tienes que tener en cuenta que todo lo está haciendo tu ordenador, lo cual puede causar fallas de rendimiento ya que no tienes un servidor aparte que ejecuta X tareas y te agiliza el trabajo.
    1 point
  9. Na página da função (engineLoadIFP) tem anexado um resource que faz o que você precisa. Baixe o ifp_demo e veja como funciona.
    1 point
  10. First of all thanks for replying I am honored to get an answer straight away from a member of the MTA team and I am greatful for your time to begin with. I actually wrote a reply to this previously but then firefox decided to stop functioning so although it makes much less sense it's shorter... Ok so the way I see it is that there are two different "script variations" that's what I'll call them, now, whether that's a valid statement I don't know, it might not even be a thing but I don't know why it's built like that. Here's the one that the map editor uses "Script Variation" #A <object id="object (BinNt07_LA) (1)" breakable="true" interior="0" alpha="255" dimension="0" model="1337" scale="1" doublesided="false" collisions="true" posX="2482.6001" posY="-1687.1" posZ="13.2" rotX="0" rotY="0" rotZ="0"></object> Here is the one that the convertffs uses "Script Variation" #B <object id="convertFFS (obviously)" model="id" posX="?" posY="?" posZ="?" rotX="?" rotY="?" rotZ="?" dimension="#" interior="#" /> For now I won't be using the <map edf:definitions="editor_main"> </map> that's supposed to be there and I'll try understanding the supposed use of it that I am not grasping. The problem is that it feels like two different separate versions (Which it might not be at all but why does the first version have more use then the first one?) It's as if I had to convert different "types" from a different set of "script variations" or it could just even be a split subtype. The way my .map file is now the MTA map editor can't read it for example it could only read This one: Object<ID> PosX<> PosY<> PosZ<> Interior<> But not: ModelID<> CoordinateX<> CoordinateY<> CoordinateZ<> Dimension<> (ON A OFFTOPIC NOTE: Interior and Dimension are actually two different things or one of them could just another word for a world I've never grasped that either but that doesn't matter) And what's my issue? Well it feels like only one of the "script variations" are required to function properly and I am having to convert each word/type of those things and even reorder different words when I am only able to replace words with CTRL+F but cannot reorder them as well as some of the symbols, there just has to be a better way without having to do it all manually. (ANOTHER OFFTOPIC SIDE NOTE: Am I the only one still using convertffs? There may be other tools and I might not even know however there's more vehicle's stuff then object's related stuff and that's another thing that never made sense but enough about that) The worst part about it is that there's no difference because it's just another type but I haven't yet learned or figured out a trick which is able to arrange it succesfully so it's in the right format. What makes absolutely no sense at all though is that the first variation has more stuff then the other variation for the last time so even if I was able to use the correct version and even if I reordered it I'd still mess it up and have left overs that I'd have no clue how to avoid, except now I am having to do it the other way round and include things such as the solidity of the model, scaling and doublesidedness. Yeah you can already tell I am hoping there's no more because I really can't be bothered with going through every model I've already carefully placed and in actuality already thought about with now that just jungling up the results and making it harder then it should be. Maybe you can tell that I've mapped it in MTA and put it in the other client but any time I want to convert MTA stuff into SAMP and then back it always goes wrong and even though I could use the construction tool it's nowhere near as good as what you guys offer over here.
    0 points
×
×
  • Create New...