Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 25/03/20 in all areas

  1. Presented By (Previously J Series) With more than 3 years of work I decided to publicly release my map conversions, I had dropped my previous listings due to some "Issues" however, they're back. ---------------------------------------------------------------------------------------------- Download Streaming Quality - 8/10 Get's the job done, awesome all around, but some places are better than others ---------------------------------------------------------------------------------------------- Download Streaming Quality 7/10 Beats VC in other places, very poor in others; as well as a huge FPS drop in the first island (Issues are rockstars fault) ---------------------------------------------------------------------------------------------- Download Streaming Quality 9/10 Beats both VC and LC ---------------------------------------------------------------------------------------------- Vehicle testing gridmap Download Streaming Quality 10/10 Perfecto ---------------------------------------------------------------------------------------------- Download Streaming Quality 7/10 Decent all around Might be a tad laggy due to the high poly and Russian nature of this map Extremely detailed for a user created map ------------------------------------------------- Download (Coming soon) streaming quality 10/10 Very light weight ------------------------------------------------- MTA-Stream MTA-Stream a new lightweight streamer promising near instant load times and better streaming Post any bugs here Or here Questions or discussions can be either posted in this topic or here --- If you would like to support my work, please donate encourages me to make good updates. https://www.paypal.me/BlueJayL
    1 point
  2. Hello Bartje, I understand that you want to simulate shooting a rocket launcher in the direction of the player's view/camera/where-he-is-looking-at. I assume that you want to have the definition of the line starting from the camera position going in the direction of the camera's front vector. This is actually not as difficult as you might think. Here is some code as an idea. client.Lua -- Calculate the direction vector. local csx, csy, csz, ctx, cty, ctz = getCameraMatrix(); local cdir = Vector3(ctx - csx, cty - csy, ctz - csz); cdir:normalize(); -- The line starts of (csx, csy, csz) and the direction vector is cdir. -- You can now interpolate on this line using setElementPosition and the following function. local function interpolate_position(px, py, pz, dir, timeSpeed) return px + dir.x * timeSpeed, py + dir.y * timeSpeed, pz + dir.z * timeSpeed; end -- An example? local obj = createObject(1454, csx, csy, csz); local moveStart = getTickCount(); addEventHandler("onClientRender", root, function() local curTime = getTickCount(); local elapsedTime = ( curTime - moveStart ); local timeSeconds = elapsedTime / 1000; setElementPosition(obj, interpolate_position(csx, csy, csz, cdir, timeSeconds)); end ); (code not tested) Explanation: the direction is defined as the normal vector of the difference between two 3D points. You can subtract the start 3D vector from the target 3D vector to get the difference between two 3D points. Of course, if you want to keep multiple objects flying in certain directions you must remember their starting positions and their direction vectors along with the MTA object handle. Should be a good exercise with the boiler-plate code above. You have mentioned the moveObject function. Your feeling may be correct because that function does specify fixed timelimit for object flight whereas above code does allow for indefinite length of object flight. - Martin
    1 point
  3. Hello, I present to you a simple monitoring script for your server written in Python 3. This script will be useful for your site, for example, if you are developing it using Django / AIOHTTP / Flask or for other purposes. This script provides simple server information: game (mta) port - server main port (UDP) ase_port - server All Seeing Eye port (main MTA:SA port + 123) name - server name gamemode - server mode map - server map version - mta:sa server version players - number of players on the server right now maxplayers - the maximum number of players that can join Usage: from mta.monitoring import Server # pass server address and port s = Server('46.243.253.51', 22003) # get current server online and max players print('{}/{}'.format(s.players, s.maxplayers)) Download & Source code: github
    1 point
  4. Hello ein.How its goin.İ hope its good. Few days ago CoolApple said me something. An Admin/Mod named Dyxa gave players rank 22.(5 or 6 players and he send me a photo.They all was 1-2 hours played players and they was rank 22) is that right or should we take his admin/mod ? Take care ! wash ur hands for covid-19 ! See you Ein !
    1 point
  5. Nenhuma função deve ser evitada de usar, muito pelo contrário - use-as. Todas as funções irão depender da sua lógica de programação, você não pode realizar uma tarefa, na maioria das vezes, sem uma condição. Realizar verificações antes de uma execução de código pode evitar vários bugs e falhas de segurança. Um código limpo e legível, com funções e variáveis nomeadas corretamente, estruturação, organização de pastas e nomeação de arquivos, tudo isso deve conter dentro de um projeto. Não é simplesmente sair colocando qualquer nome que venha à cabeça. Pensar e raciocinar antes de escrever um código é extremamente importante na área da programação. Também, para não ocorrer bugs ou falha de segurança, tente criar possibilidades de "como isso poderia bugar?" ou "como alguém poderia burlar o sistema?". Seja criativo e veja o funcionamento do seu sistema de diferentes perspectivas, isso é muito importante. Sobre desempenho, evite ao máximo repetir linhas de código para executar uma tarefa. Crie funções para isso! Dessa forma, o seu código terá rotinas que, sempre que quiser uma parte do código, ela estará dentro de uma função, sendo assim você irá criar um ciclo e não uma bagunça. Por exemplo, ao invés de criar vários comandos para executar a mesma tarefa (exemplo abaixo): Por que não criar apenas um comando para executar a função? (exemplo abaixo) Tudo irá depender da sua criatividade, perspectiva, manutenção do código, organização e condições. Recomendo você assistir esta playlist para clarear mais as idéias e escrever um código bom e legível.
    1 point
  6. Respondendo à sua primeira pergunta: function enterVehicle(thePlayer, seat, jacked) local account = getPlayerAccount(thePlayer) if (not account or isGuestAccount(account)) then return end local accountName = getAccountName(account) if (not isObjectInACLGroup("user.".. accountName,aclGetGroup("VIPCARRO"))) then -- Se não estiver em tal grupo da ACL, então if (seat == 0) and (getElementModel(source) == 602) then -- Se estiver entrando como motorista, então cancelo o evento e ele não entra outputChatBox("#ffff00SOMENTE MEMBROS DA #000000[ #ff0000Nome da gang #000000] #ffff00PODEM USAR ESSE VEICULO!", thePlayer) cancelEvent() end end end addEventHandler("onVehicleStartEnter",root,enterVehicle) Detalhe do código: A lógica: Se não estiver no determinado grupo e tentar entrar como motorista no carro de tal ID, ele não vai conseguir entrar. O que quer dizer que ele vai poder entrar em qualquer outro assento mesmo não sendo do determinado grupo da ACL. OBS: Usei a função cancelEvent pois ela é mais fácil e prática de se lidar nessas ocasiões que o setVehicleLocked. Quanto à sua segunda pergunta, se puder esclarecer melhor tentarei responder.
    1 point
  7. Olá, respondendo a sua primeira pergunta -> seat um exemplo: HeliHabs = { [487]=true,[488]=true,[497]=true,[417]=true } function enterVehicle ( player, seat, jacked ) if seat == 0 then -- // se ele entrar de piloto então: local MinhaConta = getPlayerAccount(player) if ( HeliHabs[getElementModel(source)] ) then local Hab = getAccountData(MinhaConta, "Hab") if Hab == false then cancelEvent() end end end end addEventHandler ( "onVehicleStartEnter", getRootElement(), enterVehicle )
    1 point
×
×
  • Create New...