Jump to content

neves768

Members
  • Posts

    93
  • Joined

  • Last visited

Everything posted by neves768

  1. function playerDamage_text ( attacker, loss ) if not (getElementData(source, "attackerD")) then setElementData(source, "attackerD", "N/A") return end if attacker then if (getElementData(source, "attackerD") == getElementData(attacker, "char:name")) then else setElementData(source, "attackerD", getElementData(attacker, "char:name")) end end end addEventHandler ( "onPlayerDamage", getRootElement (), playerDamage_text ) function contador() local timer = interpolateBetween(deadTime, 0, 0, 0, 0, 0, (getTickCount()-tick)/deadTime, "Linear") local minutes, seconds = convertTime(timer) local attackerD = "Desconhecido" if getElementData(localPlayer, "attackerD") then attackerD = getElementData(localPlayer, "attackerD") end if minutes < 10 then minutes = "0"..minutes end if seconds < 10 then seconds = "0"..seconds end dxDrawRectangle(screenW * 0.3580, screenH * 0.8099, screenW * 0.2621, screenH * 0.1328, tocolor(0, 0, 0, 182), false) dxDrawText("SISTEMA EMERGÊNCIA IMPOSE", screenW * 0.3580, screenH * 0.7878, screenW * 0.6201, screenH * 0.8151, tocolor(255, 25, 25, 255), 1.20, "default-bold", "center", "top", false, false, false, false, false) dxDrawText("Você está ferido e precisa de um médico", screenW * 0.3580, screenH * 0.8229, screenW * 0.6201, screenH * 0.8477, tocolor(255, 255, 255, 255), 1.20, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("Chame os paramédicos no /192 e aguarde", screenW * 0.3580, screenH * 0.8477, screenW * 0.6201, screenH * 0.8724, tocolor(255, 255, 255, 255), 1.20, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("um paramédico chegar.", screenW * 0.3580, screenH * 0.8724, screenW * 0.6201, screenH * 0.8971, tocolor(255, 255, 255, 255), 1.20, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("TEMPO DE VIDA:", screenW * 0.3616, screenH * 0.9154, screenW * 0.4305, screenH * 0.9375, tocolor(255, 254, 254, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("#ff0000".. minutes.."#ffffff:#ff0000"..seconds, screenW * 0.3580, screenH * 0.9023, screenW * 0.6201, screenH * 0.9505, tocolor(255, 25, 25, 255), 1.40, "default-bold", "center", "center", false, false, false, true, false) dxDrawText("Assasino:"..attackerD, screenW * 0.5400, screenH * 0.9154, screenW * 0.4305, screenH * 0.9375, tocolor(255, 254, 254, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) end
  2. Poderia elaborar mais? Você criou um server web com mysql/mariadb? Eu recomendo o uso do Adminer por ser mais simples de implementar (só jogar o arquivo no ftp) https://www.adminer.org/ Gostaria de lembra-lo também que você está no fórum do MTA:SA.
  3. It's even better If you compare to 2018 recap. You will see similar positive results =)
  4. Merry xmas, everyone! What a year to MTA! Great numbers =) *coff* that recap was better than yt rewind *coff coff*
  5. neves768

    Sound issue

    //Fixed After so many attempts, I've figured out the solution after posting this issue.
  6. neves768

    Sound issue

    I can't hear MTA:SA audio since 2017 (I think it started on 1.5.4). I've been searching for solutions, but i couldn't find anything that really could solve it. O.S: Windows 10 x64
  7. It is beautiful and works with power and some charm (nice UI). AAAND guess what the best thing is? It's Open Source! Come with us to contribute to a better community:)
  8. Questions 1 - I think that i can't move the MTA:SA to my USB flash drive, because MTA:SA uses Windows Registry, but it can be possible? 2 - Can i install MTA:SA Client at Ubuntu with Wine or it has a linux version that i don't know? I'm trying to install MTA:SA on a non-Administrator account at my Academy's PC to develop and test my scripts.
  9. Se você deseja a função para apenas um grupo específico, então aqui está: -- CLIENT-SIDE optionsTable = {} optionsTable[1] = {x=1583.68408, y=1450.32666, z=9.83114} -- LV optionsTable[2] = {x=348.91159, y=2539.05054, z=15.74509} -- VM optionsTable[3] = {x=-1460.63989, y=-152.66759, z=13.14844} -- SF optionsTable[4] = {x=1562.28149, y=-2414.01587, z=12.55469} -- LS lastTarget = false deliveryPrice = false deliveryMarker = false deliveryBlip = false team = "Police" function onPlaneEnter() local daVehicle = getPedOccupiedVehicle(localPlayer) if getTeamName(getPlayerTeam(localPlayer)) == team then if daVehicle and getVehicleType(daVehicle) == "Plane" then if isElement(deliveryMarker) then destroyElement(deliveryMarker) deliveryMarker = false end if isElement(deliveryBlip) then destroyElement(deliveryBlip) deliveryBlip = false end local optionsNew = deepcopy(optionsTable) if lastTarget then table.remove(optionsNew, lastTarget) end local randomNumber = math.random(1,#optionsNew) lastTarget = randomNumber local x = optionsNew[randomNumber]['x'] local y = optionsNew[randomNumber]['y'] local z = optionsNew[randomNumber]['z'] exports.saptcommands:sendClientMessage("*Pilot Delivery* Your load is ready to be delivered. ", 0, 255, 0) deliveryMarker = createMarker(x,y,z,"cylinder",5) local px, py = getElementPosition(localPlayer) deliveryPrice = getDistanceBetweenPoints2D(x, y, px, py) * 5 deliveryBlip = createBlipAttachedTo(deliveryMarker,5) addEventHandler("onClientMarkerHit",deliveryMarker,onDeliveryHit) addEventHandler("onClientVehicleExit",daVehicle ,onPlaneExit) addEventHandler("onClientVehicleExplode",daVehicle ,onPlaneExit) addEventHandler("onPlayerWasted", localPlayer, deleteMission) end end end addEventHandler("onClientPlayerVehicleEnter",localPlayer,onPlaneEnter) function onDeliveryHit(hitPlayer, matchingDimension) if hitPlayer == localPlayer then if getPedOccupiedVehicle(hitPlayer) and matchingDimension and isVehicleOnGround(getPedOccupiedVehicle(hitPlayer)) and getVehicleType(getPedOccupiedVehicle(hitPlayer)) == "Plane" then exports.saptcommands:sendClientMessage("*Pilot Delivery* You've delivered it successfully, great job!", 50, 255, 50) exports.saptcommands:giveMoney(localPlayer, deliveryPrice) destroyElement(deliveryMarker) destroyElement(deliveryBlip) deliveryMarker = false deliveryBlip = false deliveryPrice = false onPlaneEnter() end end end function onPlaneExit() removeEventHandler("onClientVehicleExit",localPlayer,onPlaneExit) deleteMission() end function deleteMission() if deliveryMarker then exports.saptcommands:sendClientMessage("Pilot Delivery* The delivery failed. Keep going, you were going great!", 0, 255, 0) destroyElement(deliveryMarker) destroyElement(deliveryBlip) deliveryMarker = false deliveryBlip = false deliveryPrice = false end end addEventHandler("onClientPlayerSpawn", localPlayer, deleteMission) function deepcopy(object) local lookup_table = {} local function _copy(object) if type(object) ~= "table" then return object elseif lookup_table[object] then return lookup_table[object] end local new_table = {} lookup_table[object] = new_table for index, value in pairs(object) do new_table[_copy(index)] = _copy(value) end return setmetatable(new_table, getmetatable(object)) end return _copy(object) end A mágica está em: team = "Police" -- Nome do grupo function onPlaneEnter() if getTeamName(getPlayerTeam(localPlayer)) == team then -- código end end addEventHandler("onClientPlayerVehicleEnter",localPlayer,onPlaneEnter)
  10. [2016-02-03 03:04:03] [Network] InResultQueue > 200000 msgs. This is due to server overload or script freeze "This is due to server overload or script freeze"
  11. Alguém já teve o mesmo problema em https://bugs.multitheftauto.com/view.php?id=8439 Algum recurso está fazendo isto.
  12. -- Server-side local acls = {"VIP"} function CarVehiclePainelVip() local accName = getAccountName(getPlayerAccount(source)) for _, k in ipairs(acls) do if isObjectInACLGroup("user."..accName, aclGetGroup(k)) then setElementData(source,"VehiclePainel",true) end end end addEventHandler("onPlayerVehicleEnter", getRootElement(), CarVehiclePainelVip) -- Client-side if getElementData(getLocalPlayer(), "VehiclePainel") then dxDrawImage(botX+sizeX+650, 250, 49, 39, "img/icoRepair.png") end
  13. @OFF "abaixarem"? The correct is downloading or download... Idk what do you want with this word. @ON Good Great idea.
  14. Tente isto: serials = { ["9C9F3B55D9D7BB7135FF274D3BF444E4"] = true, ["1D6F76CF8D7193792D13789849498452"] = true, } function aologar() local serial = serials[getPlayerSerial(source)] if serial == true then setElementData(source, "MAX_Slots", -1) outputChatBox(source.."; Nick:"..getPlayerName(source)) outputChatBox(tonumber(getElementData(source, "MAX_Slots"))) end end addEventHandler("onPlayerLogin",getRootElement(),aologar)
  15. serials = { {"01",2}, {"02",2} } function banotrotipo () for i , playerserial in ipairs(serials) do outputChatBox(tostring(playerserial[1])) local serialdoplayer = getPlayerSerial(source) local accountaplayer = getPlayerAccount(source) if (serialdoplayer == playerserial[1]) then if source then setElementData(source, "MAX_Slots", -1) outputChatBox(getPlayerName(source)) end end end end addEventHandler( "onPlayerLogin",getRootElement(),banotrotipo,source)
  16. #Segura ai -- Client side / Lado do cliente spawns = { {33,-2356.3515625,37.765151977539}, {-2142.9504394531,-2356.3515625,50.765151977539}, } function scriptdetest() local points2 = math.random(#spawns) for i,all in ipairs(spawns) do if all[i] == all[points2] then local x,y,z = all[1],all[2],all[3] --createVehicle(548,x,y,z,nil,nil,nil) outputChatBox(all[1]) outputChatBox("SUCESSO!") end end end addCommandHandler("eventoon",scriptdetest)
  17. Dude, you want the full script code? Mathematic and logic is the key. Tip: When you can't find the bug: Try with outputChatBox and keep testing and restarting the resource...
  18. This resource is at ADMIN group. And in previous version (version of 1 week ago) was working. Edit: Solved! Fix: The newer version of MTA needs ase enabled
  19. I have a lot of callRemote commands, but the recent MTA:SA updates makes this not work. R.I.P: callRemote command; Little example: LUA -- LUA function version(ver) outputChatBox("The newer version is "..ver) -- Return ERROR on variable ver end function checkversion() callRemote("http://localhost:2015/dev/query.php", version) end checkversion() PHP <?php include("mta_sdk.php"); $input = mta::getInput(); mta::doReturn("1.66"); ?> All files and URLs are okay! Tested at 3 different URLs. Edit: Solved! Fix: The newer version of MTA needs ase enabled
  20. you code dont work. no erro. change code.. addEvent("b2.deletarcarro", true) addEventHandler("b2.deletarcarro", getRootElement(), function(deletarcarro1,xx,yy,zz) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) then if deletarcarro1 then for i , v in pairs (getElementsByType("vehicle")) do if getElementModel (v) == getVehicleModelFromName (tostring (deletarcarro1)) then local x,y,z = getElementPosition( v ) if x == tonumber(xx) or y == tonumber(yy) or z == tonumber(zz) then destroyElement(v) end end end end end end) punch it only deletes if you have one car on spawn But, this is not what you want?
  21. -- server side addEvent("b2.deletarcarro", true) addEventHandler("b2.deletarcarro", getRootElement(), function(deletarcarro1,xx,yy,zz) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) then if deletarcarro1 then for i , v in pairs (getElementsByType("vehicle")) do if getElementModel (v) == getVehicleModelFromName (tostring (deletarcarro1)) then local x,y,z = getElementPositin(v) if x == tonumber(xx) and y == tonumber(yy) and z == tonumber(zz) then -- Here's only 1 vehicle or more if have 2 (or more) vehicles at the same coordinates destroyElement(v) end end end end end end) Use it with a trigger and for xx,yy and zz use the X,Y and Z columns.
  22. I don't believe on gods, but this is not an discussion... It's only a suggestion to the MTA Team or an other team which is searching ideas and not to the MTA:SA. LUA is an amazing language, but current engines haven't explored the potential from it like the MTA Team and his multiplayer mod. Love2D haven't problems, but still have limitations... see the functions list on https://love2d.org/wiki/Main_Page. Anyway, have 2 ways: 2D or 3D Engine.
  23. Probably isn't a bad idea like you think. New possibilities and communities will appear and grow!
  24. LUA Engine IDEA? Yes, my suggestion is exactly what you are thinking now. If MTA Team can build an amazing mp mod to GTA:SA with LUA language, they can build an amazing LUA engine with same easiest functions. LUA Engine can be 2D or 3D; Samples of 2D LUA Engine: Love2D, Agen, Corona & others; Examples of 3D LUA Engine: Maratis3D(Limited LUA), Guru3D(as script), Leadwerks Game Engine(best implementation) & others And your question can be: why make a new LUA Engine if there exist a lot of it and my answer is: because engines have a lot of limitations and your main competitor will be Leadwerks Game Engine which haven't much limitation... MTA Team is exploring all sides from LUA language, "thing" which LUA Engines haven't make. A poll was created, please vote on
  25. Try it(now with colshape): -- CRIATE BY *SpoC^ for TWD -- local PraiaProtegidax = createColCuboid(163.32458, -1840.56104, 2, 55, 65, 60) function Protect1(source,dimens) if getElementType(source) == "vehicle" then setElementData(source,"godmode",true) else outputChatBox('#00bfff* Entrou na Área de Proteção: #ffffffSeu veículo ficou indestrutível!',source,255,255,255,true) toggleControl(source,"fire",true) toggleControl(source,"aim_weapon",true) end end addEventHandler("onColShapeHit",PraiaProtegidax,Protect1) function godmodeveh() godvar = getElementData(source,"godmode") if godvar then setVehicleDamageProof(source,true) setElementHealth(source,1000) cancelEvent() end end addEventHandler("onPlayerDamage",getRootElement(),godmodeveh) function Protect21(source,dimens) if getElementType(source) == "vehicle" then setVehicleDamageProof(source,false) setElementData(source,"godmode",false) else outputChatBox ('#00bfff* Saiu da Área de Proteção: #ffffffSeu veículo não esta mais indestrutível!',source,255,255,255,true) toggleControl(source, "fire", true) toggleControl(source, "aim_weapon", true) end end addEventHandler("onColShapeLeave",PraiaProtegidax,Protect21)
×
×
  • Create New...