Jump to content

FernandoMTA

Members
  • Posts

    419
  • Joined

  • Last visited

  • Days Won

    36

Everything posted by FernandoMTA

  1. @SciptNovato como ficaram os arquivos? Nesse ultimo print falta alguns ', olhe: Tem que ser: <script src="server_S.lua" type="server"/> <script src="client.lua" type="client" cache="false"/> de acordo com os nomes dos arquivos. E o min client version é assim q bota: <min_mta_version client="1.5.9-9.21118.0" server="1.5.9-9.21118.0"/> Pode botar um print("oi") no final de cada arquivo para ver na consola se eles foram carregados.
  2. @copo sobre o 1o script: o addCommandHandler parece bem. Quando a função abrir for executada por ele, vai tentar verificar "painel == false". Não faço ideia de onde vem essa variável, suponho que nunca foi declarada. Quando uma variável não existe, o valor dela é nil e não false. Logo você pode verificar "if painel == nil then" ou "if not painel then". Aí ele vai adicionar o onClientRender. E quando for fazer o comando novamente para esconder o painel, a variável vai estar a true como você setou, então vai executar o que vem depois do "else", removendo assim o onClientRender. Sobre o 2o script: Você estava quase, mude esse "if exibir_bulssola = false then" para "if not exibir_bussola then" (bussola ta mal escrito e também faltava um = na comparação) Sobre o 3o script: N faço ideia o que você está tentando fazer. Essa função apenas seta algumas propriedades de arma sempre que é chamada. Você teria que mudar isso
  3. No worries. You can always change the SPAZ properties serverside to improve the weapon
  4. Eu testei o seu código e realmente não estava acontecendo nada ao entrar no marker, então eu mudei: local entrarInterior = createMarker(2231.294921875,-2414.8959960938,12.65, "cylinder", 1, 255, 255, 255, 50) function entrarLocal(thePlayer, matchingDimension) if (getElementType(thePlayer) == "player") and (matchingDimension) and (not getPedOccupiedVehicle(thePlayer)) then setElementPosition(thePlayer, 941.87628173828, 2115.2114257812, 1011.0302734375) setElementInterior(thePlayer, 1) end end addEventHandler("onMarkerHit", entrarInterior, entrarLocal) - Coloquei getPedOccupiedVehicle em vez de isPedInVehicle pois essa função está obsoleta - adicionei matchingDimension que é um argumento do onMarkerHit - botei o event handler no marker mesmo, em vez de root + verificar o source depois - aumentei ligeiramente a coordenada Z do marker: de 12.54 para 12.65 e passou a funcionar. Realmente o marker estava muito para baixo e não estava detetando o player. Espero ter ajudado @SciptNovato
  5. Esse script é de tipo "server" no meta.xml, certo? Pois o evento onMarkerHit é serverside. Para clientside seria onClientMarkerHit. @SciptNovato
  6. I don't think u need to modify ACL often. Either way, you have many ACL functions to try: https://wiki.multitheftauto.com/wiki/AclGroupAddObject
  7. float leftX, float topY [, float rightX = leftX, float bottomY = topY It uses those arguments for positioning so that you can determine the 4 points of a rectangle in which the text will be. Default alignment is horizontal "left" and vertical "top". You can easily change this to "center", "center" to place your text in the middle of the rectangle you defined with the 4 left, top, right, bottom points. Idk why they didn't just do x,y, width,height but it works like this.
  8. @RaxzenThe wiki says: Custom weapons are weapons you create with https://wiki.multitheftauto.com/wiki/CreateWeapon that can't be held by a player/ped, and are in the world. What you would be looking for is a clientside version of this to set weapon ID properties for the client only, and not the whole server: ... but sadly it doesn't exist. There are some suggestions related to weapon properties, skill levels, etc in the Bug tracker here, which you can explore. I remember seeing a suggestion saying that setWeaponProperty should be able to take a player argument so it only applies to a certain player. I wish this was implemented already
  9. You coud do something like this in a client script: local DAMAGE_AREA = createColPolygon(-1, 4, 5, 8, 9, 4, 5, -2, -1, 4) -- colshape coordinates here local DAMAGE_DELAY = 3000 -- miliseconds between damage hits local DAMAGE_AMOUNT = 5 -- health points to lose local damageTimer local function takeDamage() -- cancel damage timer if dead if isPedDead(localPlayer) then if isTimer(damageTimer) then killTimer(damageTimer) damageTimer = nil end return end -- take damage (this may kill the player) setElementHealth(localPlayer, math.max(0, getElementHealth(localPlayer) - DAMAGE_AMOUNT)) outputChatBox("Ouch", 255, 56, 56) -- you can trigger some visual effects here (if you want) end addEventHandler( "onClientColShapeHit", DAMAGE_AREA, function (theElement, matchingDimension) if (theElement ~= localPlayer) then return end if not (matchingDimension) then return end -- take damage instantly (if you want) takeDamage() -- set damage timer damageTimer = setTimer(takeDamage, DAMAGE_DELAY, 0) end) addEventHandler( "onClientColShapeLeave", DAMAGE_AREA, function (theElement, matchingDimension) if (theElement ~= localPlayer) then return end if not (matchingDimension) then return end -- cancel damage timer if isTimer(damageTimer) then killTimer(damageTimer) damageTimer = nil end end)
  10. Like PUBG outside the safe zone where the player takes damage slowly?
  11. Hi! Very interesting, it definitely sounds useful. Do you know any practical applications of this module so far?
  12. I never heard of this issue. Can u provide screenshots, and what scripts u have running in your server? You can try seeking help in MTA Discord maybe that will be faster.
  13. Eu aconselho colocar apenas 1 único recurso para iniciar automaticamente com o servidor. Esse mesmo recurso vai iniciar todos os recursos que você precisar com startResource. Eu acho que isto permite mais controlo e verificações de eventuais erros ou problemas com os recursos do servidor.
  14. Change will only happen if people ask for it or someone decides to do it out of own will. I don't know if there's need to upgrade Lua version entirely. I know new functions & features can be added directly when needed. You can stay up to date with MTA Development:
  15. I think the Ban Appeals section should be excluded from the forum's default activity stream (recent posts) for the following reasons: - Global MTA ban appeals are only intended to be handled by MTA staff. Regular users shouldn't comment on them. - New ban appeals are posted almost every day, several times a day and seem to be happening more and more frequently. - A lot of appeal attempts are invalid and end up getting a reply by a moderator & locked quickly. - Many of the posts are in another language, and generally not interesting for anyone who is not staff to read through. - Hiding Ban Appeal posts from the recent posts stream will give more exposure to other interesting posts like Resource showcases or Looking for help posts. - Forum feed will feel less spammed. Yay or nay?
  16. MTA uses Lua 5.1 https://github.com/multitheftauto/mtasa-blue/tree/master/vendor/lua (correct me if I'm wrong). Features from more recent Lua versions won't work in your MTA Lua client/server scripts. For example, the goto statement was only added in Lua 5.2 http://lua-users.org/wiki/GotoStatement
  17. @greenops011 I checked and that screenshot_path coreconfig.XML setting is not used. Always defaults to the MTA installation directory / screenshots. You can open a feature request here if you think the user should be able to customize screenshots path.
  18. The 2 most common ways of interacting with other resource scripts is: - calling exported functions like: exports.resourceName:functionName or exports["resourceName"]:functionName - calling events, you should look for which were added in other resources: triggerEvent, triggerServerEvent, etc
  19. Hello, you should look in the MTA wiki for the syntax of the functions that you are using (dxDrawRectangle, dxDrawImage, dxDrawText) to understand how they are drawn on the screen (x and y positions, width, height, etc).
  20. Oh nice, you add as many vehicle components as you want right?
  21. Hey taking advantage of this thread to ask a question xD: Has anyone tried adding more than 5 variants to a vehicle model? The wiki says you can have extra1, extra2, extra3, extra4 or extra5, but would extra6 ... work? ?
  22. We are still looking for developers! We have some vacant positions Please reach out to us via the contact methods on the main post.
  23. Hello, this server is currently massively using Newmodels: https://forum.multitheftauto.com/topic/133992-english-wip-6-monthz-in-zombie-apocalypse-roleplay/ They haven't experienced any lag using this lib, you can check it out for yourself Also I have did a lot of testing and it doesn't affect. The element data is set on the vehicle/object/ped you want to have a custom model. Then the client listens to that elemtn data change, this is not performance heavy. You should have no problems
  24. San Andreas Roleplay is back with some important changes! The setting is now Las Venturas in the year 1989. A fresh start. We've added a ton of new vehicles, properties, items and are actively working on mapping and script updates to enrich the new scenarios. Come roleplay in the server and interact with the several active legal & illegal organisations. IP: server.sa-roleplay.net Forums: https://forums.sa-roleplay.net/ Discord: https://discord.com/invite/5RjXS5s5km
×
×
  • Create New...