Jump to content

Michael#

Members
  • Posts

    168
  • Joined

  • Last visited

About Michael#

  • Birthday 05/01/1997

Details

  • Gang
    EGT
  • Location
    United Kingdom
  • Interests
    Programming, Gaming

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Michael#'s Achievements

Busta

Busta (15/54)

0

Reputation

  1. Also, next time don't copy log from GameCP Console or whatever the panel is. Copy from the server file.
  2. Michael#

    @castillo

    exports['gang-resource']:getAccountGang ( getPlayerAccount ( thePlayer ) )
  3. Michael#

    Help

    Check distances between player and hospitals.
  4. There are only 2 original ideas: Animations and Camera moving. Good job anyway!
  5. Who will buy those retarded maps for $2 each? You mad.
  6. Isso é apenas para lembrar que é uma variável sem uso, tipo, quando eu preciso de um parametro especifico de uma função e só esse mas esse é, por exemplo, o quarto parametro, eu boto: _, _, _, meuParam . Igual nesse loop, como eu não vou necessitar dos índices da tabela eu boto _. Espero que tenha entendido // Sobre as Classes, tem muita gente que podem não estar entendendo isso então leia e releia como o Stanley fez. Os iniciantes podem achar que isso não ajuda em nada, mas sim, ajuda muito, uma das coisas em que ajuda é na organização do código e também fica muito mais fácil de encontrar as funções. Você em vez de: function drawTextBehindWindow ( nX, nY, nZ, uAssignTo ) Pode simplesmente fazer: function theWindow:drawText ( nX, nY, nZ, uAssignTo ) Mas não se esqueça aqui no último exemplo theWindow:drawText que self ( classe ) tem que ser um objecto da classe, ou seja, theWindow tem que ser uma janela criada com uma função de classe. Entende?
  7. Fuu I confused getPedOccupiedVehicle with getVehicleController.
  8. arc_ animation library have a lot of bugs.
  9. Your code is wrong Booo. addEventHandler ( 'onClientPlayerWeaponFire', root, function ( _, _, _, _, _, _, uHit ) if ( getElementType ( uHit ) == 'vehicle' ) then outputChatBox ( getPlayerName ( source ) .. ' shooted on ' .. getPlayerName ( getPedOccupiedVehicle ( uHit ) ), 255, 255, 255, false ) end end )
  10. Check if lib_mysqld.dll is in MTA Server.exe directory.
  11. Bom dia. Para começar vou mostrar como usar metatabelas e metamétodos que são partes de um sistema de classes. // Uma metatabela é uma tabela que faz com que nós possamos mudar o comportamento de uma tabela. A metatabela é usada em classes mas como LUA é orientado a funções e não a objetos, então isso só vai ficar "parecendo" classes. Para criar uma tabela usamos setmetatable. Para saber: self é a classe da função. // Metamétodos são as funções dentro dos métodos. Para criar um metamétodo você deve fazer o seguinte: function Classe:NomeDoMétodo ( parametros ) end Para você poder executar métodos e passar parametros para / entre eles você tem que definir uma metatabela, exemplo: -- dentro da funçao setmetatable ( { parametro = parametro1; parametr = parametro2 }, Classe ); -- global, sem precisar botar dentro da funçao setmetatable ( { __index = Classe }, Classe ); // Exemplo de script: Contatos = { } -- declara uma tabela -- declara um metamétodo function Contatos:AddClientValue ( tValues ) -- bota todos os parametros do nosso método em uma tabela e a define como metatabela de self setmetatable ( { unpack ( tValues ) }, self ); -- adiciona todos os valores em self table.insert ( self, tValues ); -- executa o método SendToClient self:SendToClient ( 'Data sent sucessfully!' ); end function Contatos:SendToClient ( sMessage ) -- bota todos os parametros do nosso metodo em uma tabela e a define como metatabela de self setmetatable ( { message = sMessage }, self ); -- envia a mensagem _G['print'] ( tostring ( sMessage ) ); -- _G é uma variavel contendo todas as funções de LUA -- declara um loop for e envia todos os dados da tabela self for selfIndex, selfValue in pairs ( self ) do for index, value in pairs ( selfValue ) do _G['print'] ( index .. ' => ' .. value ); end end end -- Exemplo de uso: Contatos:AddClientValue { ['Name'] = "Michael", ['Age'] = "20", ['Job'] = "Hosting Company Owner - Damaged Games"; } -- Output: Name => Michael Age => 20 Job => Hosting Company Owner - Damaged Games Espero que tenham entendido
  12. The problem is that you have admin and scoreboard resource in two folders.
  13. Answering your first question, you can use onClientRender event and slide the GUI setting up GUI position every frame or you can use interpolateBetween function and onClientRender event.
×
×
  • Create New...