Jump to content

Erknneto

Members
  • Posts

    47
  • Joined

  • Last visited

Everything posted by Erknneto

  1. Amigo, você vai precisar usar a vida e o colete para calcular o tamanho das barras do HUD, é uma matemática simples. Como você quer um fundo, vamos usar uma largura de valor 200. A largura desse fundo não pode mudar quando o jogador sofrer dano, então temos que fazer um cálculo onde o resultado é sempre 200. Na barra que mostra a vida ou o colete, a largura deve mudar ao sofrer dano, então vamos apenas trocar o 100, que é o valor chave do cálculo, pelo valor da vida/colete do jogador. local vida = getElementHealth(localPlayer) -- Valor da vida do jogador local colete = getPedArmor(localPlayer) -- Valor do colete do jogador dxDrawRectangle(screenW*0.4870, screenH*0.4005, screenW*200/100*100, screenH*0.0046, tocolor(0, 0, 0, 250), false) -- Calculo o fundo da vida, valor máximo é 100. dxDrawRectangle(screenW*0.4870, screenH*0.4005, screenW*200/100*vida, screenH*0.0046, tocolor(255, 255, 255, 255), false) -- Calculo a barra de vida, substituindo o máximo pelo valor da vida do jogador. dxDrawRectangle(screenW*0.4870, screenH*0.4074, screenW*200/100*100, screenH*0.0046, tocolor(0, 0, 0, 250), false) -- Calculo o fundo do colete, valor máximo é 100. dxDrawRectangle(screenW*0.4870, screenH*0.4074, screenW*200/100*colete, screenH*0.0046, tocolor(255, 255, 255, 255), false) -- Calculo a barra de colete, substituindo o máximo pelo valor do colete do jogador.
  2. I've sold it, the new server IP is mtasa:13.95.1.226:22003
  3. IT'S ALREADY BEEN SOLD The new server IP is mtasa://13.95.1.226:22003 SELLING - Rust gamemode + Facebook page with 4.2k likes Hello! I'm selling my Rust gamemode I've been creating since 2016. It has been tested once as a server with 80+ players. The reason I'm selling is because I'm leaving MTA forever. I'll show some screenshots, some old videos people made on the server, and I'll show you what's so special about this gamemode. ABOUT THE GAMEMODE I started making this gamemode back in 2016 with two friends of mine, we slowly made it and it became a server in 2017. From that day, we've improved the gamemode and added a bunch of new stuff. We were the first Rust server ever to be online! SCREENSHOTS AND VIDEOS youtu.be/BF2Eq2-4RnU youtu.be/E6SI_lA21M4 youtu.be/0qn-jq_cS1o youtu.be/4pE1EE7rKKY youtu.be/8AvMt9sb7u8 ALL SCREENSHOTS CAN BE FOUND HERE BASIC INFORMATION The gamemode is complete, it has a lot of systems, exclusive contents, all done by us 3 No errors showing up the 'debugscript 3' A custom anticheat to prevent a lot of griefers 3 languages (en-US, pt-BR, ca-ES) All data stored at separated databases (MySQL) Exclusive objects and systems It comes with 10+ extra resources It has a Facebook page with 4.2k likes A lot of bugs that were found over 3 years of server are fixed (including duplicating items WHAT SYSTEMS DOES IT HAS? Full base systems, players can build the way they want Full raid systems, players can raid other players to steal their items using C4 Full building and crafting mode with +30 exclusives objects Full resources scavenging systems, players can get resources scavenging Full MySQL data storage, all data is stored in separated databases Full lobby with tutorial and player editor Inventory, backpacks, items, weapons, resources Health, hunger and thirsty Group system Beds Chests, safe boxes Furnaces Workbenchs Campfires Vehicles (including players can craft a Bicycle) Animals Airdrops and supply boxes players can call using an item Sentry guns players can put to deffend their bases Light Machine Gun players can put in the back of a truck to shoot and raid other players Radioactive areas A store where players can buy and sell items A factory where players can make a stronger metal for strongers bases Big cities are blocked Map weather changes as the days goes by Implemented VIP systems and a lot more... PRICE SOLD CONTACT SOLD
  4. function peds(player) local rx,ry,rz = getElementRotation(localPlayer) local px, py, pz = getElementPosition(localPlayer) local rz = math.floor(rz) setClipboard("{179 ,"..px..", "..py..", "..pz..", "..rz.."};") outputChatBox("Todas as informações para adicionar o ped foram copiadas!") end addCommandHandler("localped", peds) Bom, eu colocaria dessa forma. A função 'math.floor' vai te dar o menor valor inteiro dentro de um número, acredito que funcionaria melhor nesse caso. Ali eu só pedi pro script me retornar o 'rz' novamente, mas no caso o 'rz' inteiro, diferente do primeiro rz que foi dado, entende? Por exemplo: x = 1,5 Se eu fizer o math.floor(x), ele vai me dar x = 1
  5. We need more information. You need to show us screenshots of any errors occurring when you use the '/svp' command. Use '/debugscript' 3 to do it. But for now I suppose you should check if you're set as an admin to use that command, try to set your admin element data using the admin panel.
  6. function ... () local username = getPlayerName(source) local qh_account = dbQuery(db, "SELECT * FROM accounts WHERE username=(?) LIMIT 1", username) local result_account = dbPoll(qh_account,-1)[1] if ( result_account ) then local serial = tostring(result_account.serial) local userSerial = getPlayerSerial(source) if ( serial == userSerial ) then outputChatBox("Yes.",source) return else outputChatBox("No.",source) return end end return end The code you're using is kind different from the ones I use about databases, but this might work. You just needed to set the serial from the db as a string and check if it's the same as the one from the player.
  7. Você deve postar na área de português, amigo... lá nós brasileiros podemos te ajudar. Essa aqui é a área exclusiva para dúvidas em inglês. Link: ÁREA DE PORTUGUÊS
  8. Erknneto

    Replace Error

    You're using a non-compatible model for the weapons, try to use another models. It might work.
  9. I think you were setting the wrong element datas, try this code function apagarRadar () setPlayerHudComponentVisible(source,"radar",false) setElementData(source,"showRadar",false) end addEventHandler("onPlayerJoin",getRootElement(),apagarRadar) function mostrarRadar (source) if not ( getElementData(source,"showRadar") ) then setElementData(source,"showRadar",true) setPlayerHudComponentVisible(source,"radar",true) else outputChatBox("Já tens um mapa.",source) end end addCommandHandler("mapa",mostrarRadar)
  10. That code works for all resolutions, just put your resolution there and edit. It will work fine in all resolutions, just edit in your resolution and test in others.
  11. function interiorEnter (element) if ( getElementType(element) == "player" ) then if ( getPlayerMoney(element) >= 100 ) then takePlayerMoney(element,100) setElementPosition(element,834.6,7.4,1004.1) setElementInterior(element,3) else outputChatBox("#ff0000You don't have enough money!",element,255,255,255,true) end end end addEventHandler("onMarkerHit",markerJoin,interiorEnter) Try this, m8.
  12. Well, I always use this code to draw DX stuff, and I recommend you to try it so local sx,sy = guiGetScreenSize() local px,py = 1366,768 --Put your resolution here local x,y = (sx/px),(sy/py) --Example code dxDrawRectangle(x*0, y*0, x*1366, y*80, tocolor(0, 0, 0, 170), false) dxDrawText("Test", x*0, y*0, x*1366, y*80, tocolor(255, 255, 255, 255), 1.5, "pricedown", "center", "center", false, false, false, false, false) It always fits in all resolutions.
  13. You can use the function showCursor. for example: function inventory () showCursor(true,false) --it will show the cursor and the player will still be able to move, etc end bindKey("tab","down",inventory) https://wiki.multitheftauto.com/wiki/ShowCursor
  14. Oh, sorry! You can ignore that, that is an old code from my resources! You can remove that return if you want!
  15. function ejectPlayer (source) if ( isPedInVehicle(source) ) then removePedFromVehicle(source) return end end addCommandHandler("eject",ejectPlayer) Try this code.
  16. You were making some functions not work as they should, and you're not using client-side when you need to be using. This may be working. SERVER SIDE --[[ SERVER SIDE --]] local greenzone = createColRectangle(-2434.68799,-688.11896,150,200) local greenzoneMap = createRadarArea(-2434.68799,-688.11896,150,200,0,255,0,100) function greenzoneEnter (element) if ( getElementType(element) == "player" ) then if not ( getElementData(element,"invincible") ) then setElementData(element,"invincible",true) end outputChatBox("You've entered the greenzone!",element,50,252,3) toggleControl(element,"fire",false) toggleControl(element,"next_weapon",false) toggleControl(element,"previous_weapon",false) toggleControl(element,"aim_weapon",false) toggleControl(element,"vehicle_fire",false) toggleControl(element,"vehicle_secondary_fire",false) setPedWeaponSlot(element,0) end end addEventHandler("onColShapeHit",greenzone,greenzoneEnter) function greenzoneLeave (element) if ( getElementType(element) == "player" ) then if ( getElementData(element,"invincible") ) then setElementData(element,"invincible",false) end outputChatBox("You've left the greenzone!",element,50,252,3) toggleControl(element,"fire",true) toggleControl(element,"next_weapon",true) toggleControl(element,"previous_weapon",true) toggleControl(element,"aim_weapon",true) toggleControl(element,"vehicle_fire",true) toggleControl(element,"vehicle_secondary_fire",true) end end addEventHandler("onColShapeLeave",greenzone,greenzoneEnter) CLIENT SIDE --[[ CLIENT SIDE --]] addEventHandler("onClientPlayerDamage",getLocalPlayer(),function() if ( getElementData(localPlayer,"invincible") ) then cancelEvent() end end) addEventHandler("onClientPlayerStealthKill",getLocalPlayer(),function(target) if ( getElementData(target,"invincible") ) then cancelEvent() end end)
  17. You know the bind will only be set if the player joins the server, right? Try to reconnect and check if the bind works. Or check the debugscript to see if any errors appears.
  18. Erknneto

    SetTime

    It's not 'setTime', the correct function is setTimer. Read more about it : https://wiki.multitheftauto.com/wiki/SetTimer
  19. function setJetpack (source) local acc = getAccountName(getPlayerAccount(source)) if ( isObjectInACLGroup("user."..acc,aclGetGroup("Admin")) ) then if ( doesPedHaveJetPack(source) ) then removePedJetPack(source) return end givePedJetPack(source) end end addEventHandler("onPlayerJoin",getRootElement(),function() bindKey(source,"J","down",setJetpack) end) try this one
  20. function fixAllVehicles (source) local acc = getAccountName(getPlayerAccount(source)) if ( isObjectInACLGroup("user."..acc,aclGetGroup("Admin")) ) then for _,veh in ipairs(getElementsByType("vehicle")) do if ( veh ) then fixVehicle(veh) end end outputChatBox("The Admin "..getPlayerName(source).." fixed all the vehicles!",getRootElement(),0,255,0) else outputChatBox("You don't have access to this command!",source,255,0,0) end end addCommandHandler("fixall",fixAllVehicles) done
  21. function fixAllVehicles (source) local acc = getAccountName(getPlayerAccount(source)) if ( isObjectInACLGroup("user."..acc,aclGetGroup("Admin")) ) then for _,veh in ipairs(getElementsByType("vehicle")) do if ( veh ) then fixVehicle(veh) end end outputChatBox("The Admin "..getPlayerName(source).." fixed all the vehicles!",getRootElement(),0,255,0) end end addCommandHandler("fixall",fixAllVehicles) Try this one.
  22. function adminFreeze (source,command,name) local acc = getAccountName(getPlayerAccount(source)) if ( isObjectInACLGroup("user."..acc,aclGetGroup("Admin")) ) then local selectedPlayer = getPlayerFromName(name) if ( selectedPlayer ) then if ( isElementFrozen(selectedPlayer) ) then setElementFrozen(selectedPlayer,false) outputChatBox("You have unfrozen the player "..name.."!",source,0,255,0) outputChatBox("You have been unfrozen by the Admin "..getPlayerName(source).."!",selectedPlayer,0,255,0) return end setElementFrozen(selectedPlayer,true) outputChatBox("You have frozen the player "..name.."!",source,0,255,0) outputChatBox("You have been frozen by the Admin "..getPlayerName(source).."!",selectedPlayer,255,0,0) else outputChatBox("Invalid player!",source,255,0,0) end end end addCommandHandler("freeze",adminFreeze) You don't need the "/unfrozen" command, you can use "/freeze" to make the both actions.
  23. function createLoginGui () wdwLogin = guiCreateWindow(529, 206, 488, "Login Panel", false) guiWindowSetMovable (wdwLogin, false) guiWindowSetSizable (wdwLogin, false) guiSetAlpha(wdwLogin, 1.00) guiSetProperty(wdwLogin,"CaptionColour","FFFEFEFE") lblMainLogin = guiCreateLabel(7, 14, 293, 48,"Testing server",true,wdwLogin) lblUsernameLogin = guiCreateLabel (11, 77, 124, 24, "Username", true, wdwLogin) edtUsernameLogin = guiCreateEdit (11, 106, 279, 34, "", true, wdwLogin) lblPasswordLogin = guiCreateLabel (16, 147, 128, 24, "Password", true, wdwLogin) edtPasswordLogin = guiCreateEdit (11, 171, 279, 34, "", true, wdwLogin) btnLogin = guiCreateButton (10, 308, 114, 34, "Register", true, wdwLogin) end createLoginGui() Try now.
×
×
  • Create New...