Jump to content

xXMADEXx

Members
  • Posts

    2,718
  • Joined

  • Last visited

Everything posted by xXMADEXx

  1. You can use string.gsub and search and remove the hex color codes of the players name. Example: local pN = "#00ff00xX#ffff00MADE#00ff00Xx" local new_pn = pN:gsub ( "#%x%x%x%x%x%x", "" ) outputChatBox ( pN.." was converted to "..new_pn )
  2. You can't create an MTA server on a web server. You need to get an mta server.
  3. Can you tell us what debugscript says?
  4. meta.xml: <meta> <script src="client.lua" type="client" /> </meta> client.lua: -- Your code imgW = 500 imgH = 90 function adminLogo() local players = getPlayersInTeam(getTeamFromName("Admin")) for i,player in ipairs(players) do if player ~= localPlayer then local cX, cY, cZ = getCameraMatrix() local hX, hY, hZ = getPedBonePosition(player, hZ = hZ + 0.5 local pX,pY,pZ = getPedBonePosition(localPlayer, pZ = pZ + 0.5 if getScreenFromWorldPosition(hX, hY, hZ) and isLineOfSightClear(cX,cY,cZ, pX,pY,pZ) then local sX, sY, sD = getScreenFromWorldPosition(hX, hY, hZ) local relative = (50 - sD) / 50 if relative > 0 then local iW = imgW * relative local iH = imgH * relative local iX = sX - (iW / 2) local iY = sY - (iH / 2) dxDrawImage(iX, iY, iW, iH, "admin.png") end end end end end addEventHandler("onClientRender", root, adminLogo)
  5. I agree... You should upload it uncompiled, because for all we know there are hidden commands in the script...
  6. I think he means mile... You can try using this: function getDistanceBetweenPoints3DUSA ( x, y, z, x_, y_, z_ ) local dist = ( getDistanceBetweenPoints3D ( x, y, z, x_, y_, z_ ) * 3.28 ) -- Get feet local dist = ( dist / 5280 )-- Convert to miles return dist; -- Return it end -- Example: local p = getRandomPlayer ( ) local x, y, z = getElementPosition ( p ) outputChatBox ( "You are "..getDistanceBetweenPoints3DUSA(x,y,z,0,0,0).." miles from 0, 0, 0", p )
  7. Use one of the following programs (I would recommend XAMPP but it has a bit of a download with a slow internet connection): Wamp: http://www.wampserver.com/en/ XAMPP: https://www.apachefriends.org/index.html USBWebServer: http://www.usbwebserver.net/en/
  8. You forgot to put "do" after the for loop, and make sure you define the "highest" variable before you run the loop. local highest = 0 for i, v in pairs(getAccounts()) do local current = getAccountData(getAccount(v), "ucpMinutesPlayed") or 0 if tonumber( current ) or 0 > highest then highest = getAccountData(getAccount(v), "ucpMinutesPlayed") end end
  9. Try using this code: function kickPing() for i, zPlayer in ipairs(getElementsByType("player")) do local name = getPlayerName ( zPlayer ) if (getPlayerPing(zPlayer) >= 2) then kickPlayer(zPlayer, "Your ping is over 2!") outputChatBox("[ADMIN BOT] What a ping ".. name .." you got 1000 ping you will get kick.", getRootElement(), 255, 255, 0, false) end end end setTimer(kickPing, 10000, 0) addEventHandler("onResourceStart", getRootElement(),kickPing)
  10. https://community.multitheftauto.com/index.php?p= ... ts&id=9225 He stole it form here: viewtopic.php?f=91&t=75387&p=694036 DONE
  11. We're here to help people with their scripts, not steal them. @Wisam, can you please activate /debugscript 3, take a screenshot of it and post it here? Thanks. his name is emmanuel has uploaded his script check community.multitheftauto.com iam not stolen it Ah right, sorry. I didn't see that, I'll go head and ask SolidSnake14 to remove it.
  12. We're here to help people with their scripts, not steal them. Change your code to this: addCommandHandler("turret", function (player) local x,y,z = getElementPosition(player) if (getPlayerMoney(player)>= 10) then triggerClientEvent(root, "turret", root,player, x, y, z) takePlayerMoney(player,10) outputChatBox("You Bought a Turret for $20.000", source, 0,190,50) else outputChatBox("You Don't have enough money to buy a Turret", source, 190,0,50) end end ) addCommandHandler("dturret", function (player) triggerClientEvent(root, "destroy", root, player) outputChatBox("You Destroyed you're turret", getRootElement(), 190,0,50) end )
  13. Maybe you can try to edit this resource or just looking at how he made the scroll.
  14. For an image to be created, the resource has to be downloaded, so the client would have to reconnect to toggle the background, therefore I suggest you use the function setCameraMatrix.
  15. viewtopic.php?f=91&t=26541
  16. It's a server-side script.
  17. You can get it here: https://code.google.com/p/mtasa-blue/so ... xml?r=3511
  18. You can use isTransferBoxActive
  19. You can just go into the editor item list, and scroll threw the items until you find it.
  20. /me is a command that is created by the MTA server. You can use this script to cancel it: addEventHandler ( "onPlayerChat", root, function ( _, tp ) if ( tp == 1 ) then cancelEvent ( ) end end )
  21. Are the events triggering to the server side? (you can test with this) function loginPlayer(username, password, boolRememberUsername, boolRememberPassword) outputChatBox ( "Got event: UIPaccounts.loginPlayer" ) local currentAccount = getPlayerAccount(client) if (not isPlayerGuest(client)) then return end if (not isGuestAccount(currentAccount)) then exports["TopBarChat"]:sendClientMessage ("#0000FF* #FFFFFFYou're already logged in!",client,255,255,255,true) return end if (getAccount(username) and not getAccount(username, password)) then exports["TopBarChat"]:sendClientMessage ("#0000FF* #FFFFFFThe password you submitted is wrong!",client,255,255,255,true) return end if (not getAccount(username)) then exports["TopBarChat"]:sendClientMessage ("#0000FF* #FFFFFFThe account name you submitted does not exist!",client,255,255,255,true) return end local theAccount = getAccount(username, password) for i, player in pairs(getElementsByType("player")) do local theirAccount = getPlayerAccount(player) if (theirAccount == theAccount) then exports["TopBarChat"]:sendClientMessage ("#0000FF* #FFFFFFAlready in-use!", "The account you submitted\nis already used by another player!",client,255,255,255,true) return end end local loginStatus = logIn(client, theAccount, password) if (loginStatus) then triggerClientEvent(client, "UIPaccounts.remove", client) spawnPlayer2(client) local user = getAccountName(theAccount) if (boolRememberUsername and boolRememberPassword) then status = "both" elseif (boolRememberUsername and not boolRememberPassword) then status = "password" elseif (not boolRememberUsername and boolRememberPassword) then status = "username" elseif (not boolRememberUsername and not boolRememberPassword) then status = "destroyBoth" end triggerClientEvent(client, "UIPaccounts.saveAccountDetails", client, user, password, status) end end addEvent("UIPaccounts.loginPlayer", true) addEventHandler("UIPaccounts.loginPlayer", root, loginPlayer) function registerPlayer(username, password, question, answer, city) outputChatBox ( "Got event: UIPaccounts.registerPlayer" ) if (not isPlayerGuest(client)) then return end if (getAccount(username)) then exports["TopBarChat"]:sendClientMessage("#0000FF* #FFFFFFThis account name is already taken!",client,255,255,255,true) return end local acc = addAccount(username, password) if (acc) then local skins = getSkinsTable() logIn(client, acc, password) setAccountData(acc, "UIPaccounts.securityQuestion", question) setAccountData(acc, "UIPaccounts.securityAnswer", answer) end end addEvent("UIPaccounts.registerPlayer", true) addEventHandler("UIPaccounts.registerPlayer", root, registerPlayer)
  22. You can use the function fadeCamera
  23. Strings: https://wiki.multitheftauto.com/wiki/String Loops: http://www.lua.org/pil/4.3.4.html Math: https://wiki.multitheftauto.com/wiki/Math
×
×
  • Create New...