Jump to content

Metall

Members
  • Posts

    44
  • Joined

  • Last visited

Everything posted by Metall

  1. Metall

    Delete

    Seems cool, good job.
  2. You posted a code where you could choose an URL directly from the command. I posted a little guide how to do it with a GUI and a table.
  3. 1. Make a GUI using something like GUIEditor. 2. Create a table looking something like this, urls = { {"www.youradress.com/song.mp3"}, } 3. Get the data from that table, for index, data in ipairs(urls) do url = data[1] -- Do something with that data, ex. outputChatBox(data[1]) -- Outputs the url into the chatbox (not needed). end 4. Set that data into a gridlist or something of your choice using something like this, guiCreateGridList guiGridListAddColumn guiGridListAddRow guiGridListSetItemText Should turn into something like this (not tested, only an example) window = guiCreateWindow(0, 0, 0, 0, "Example", false) gridlist = guiCreateGridList(0, 0, 0, 0, false, window) column = guiGridListAddColumn(gridlist, "URLs", 1) urls = { {"http://www.181.fm/asx.php?station=181-eagle"}, } for index, data in ipairs(urls) do local row = guiGridListAddRow(gridlist) guiGridListSetItemText(gridlist, row, column, index, false, false) end And then ofcourse you would have to get that URL from the gridlist and play it using playSound or playSound3D.
  4. I guess this is what you wanted to do, Server: local LV = createColRectangle(866, 656, 2100, 2300) function onEnter(player, md) if (player and isElement(player) and getElementType(player) == "player" and md) then outputChatBox("Welcome to Las Venturas!", player, 0, 255, 0) end end addEventHandler("onColShapeHit", LV, onEnter) md is short for matchingDimension, both can be used in as included parameters. It's probably not even needed unless you only want it to be triggered in the main dimension (0).
  5. You could use dxDrawText to draw a text on your screen, but you want to be able to write in it don't you? If so, I have no idea. dxDrawText
  6. Metall

    Question

    setWeaponProperty For example, to set the weapon accuracy property of an M4 to "poor" you code it like this function setDamage() setWeaponProperty(31, "poor", "damage", 200) end addCommandHandler("damage", setDamage) "poor" means that all the players who have that effect will get increased damage on their M4. It can be changed to "std" and "pro" also.
  7. Try taking a look at this resource, https://community.multitheftauto.com/index.php?p= ... ils&id=844
  8. I saw that OVH doesen't accept offers in Sweden, means i won't be able to buy a dedicated server. What should i do? Is it possible getting a middle? Or something..?
  9. Stop the play gamemode/resource
  10. Well, if the commandHandler you made has a "-" in it, then yes. Like if your command handler under your function is: addCommandHandler("staff", function) Then it's executeCommandHandler("staff", localPlayer)
  11. function commandPanel(plr) executeCommandHandler("yourCommand1", plr) executeCommandHandler("yourCommand2", plr) end addCommandHandler("commandpanel", commandPanel) ?
  12. Well if i get it right you can do it like this: addCommandHandler("cmd", function) addCommandHandler("cmd", function) Multiple times for different functions.
  13. local marker = createMarker() setElementInterior(marker, interior) setElementDimension(marker, dimension)
  14. function teleportarPlayer (player, CMD, targetName) local accountName = getAccountName(getPlayerAccount(player)) if isObjectInACLGroup("user."..accountName , aclGetGroup("Admin")) then if not targetName then outputChatBox("Uso Correto: /goto nick") else local target = getPlayerFromName (targetName ) if not target then -- check if the name is valit outputChatBox("ERRO: Jogador não encontra-se online!") else local x,y,z = getElementPosition ( target ) setElementPosition ( player,x,y,z+1) --setElementPosition ( player, getElementPosition ( target )) end end end end addCommandHandler ( "goto", teleportarPlayer ) Tested and works! NOTE: Must be serverside.
  15. Metall

    FPS 49 lagg

    Try setting the FPS on 60, otherwise if it's on 49, it will go from 49 to 30, and repeat, which causes lag.
  16. function teleportarPlayer (player, CMD, targetName) local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then if not targetName then outputChatBox("Uso Correto: /goto nick") else local target = getPlayerFromName (targetName ) if not target then -- check if the name is valit outputChatBox("ERRO: Jogador não encontra-se online!") else local x,y,z = getElementPosition ( target ) setElementPosition ( player,x,y,z+1) --setElementPosition ( player, getElementPosition ( target )) end end end end addCommandHandler ( "goto", teleportarPlayer )
  17. Well, the semi-column is used for ending a sentance of code like: g.fillRect(0, 0, 100, 100); That's Java, but that's atleast how i use them, they also exist in the most other programming languages. In Lua you won't have to use them, unless it makes it easier for you. AnyMoreProblemsThenPostHere();
  18. Well, sortof you asked how to load it so here it is: "picture.png" /> Sorry for not being able to help you further, also, shaders is the only way possible i think, atleast a easy one. I
  19. Metall

    Sql problem

    I guess it's because TEXT means that it's a text, like the name of a vehicle or so. So i think that'll work anyways.
  20. Metall

    Sql problem

    That's because you never created that table, use this: addEventHandler("onResourceStart", resourceRoot, function() database = dbConnect("sqlite", "projectsa.db") local exec = dbExec(database, "CREATE TABLE IF NOT EXISTS 'characters' ( characterID TEXT PRIMARY KEY )" ) local query = dbQuery( database, "SELECT * FROM characters") outputChatBox(tostring(query)) local result, rows, msg = dbPoll(query, 0) if result == false then outputConsole( "dbPoll failed. Error code: " .. tostring(rows) .. " Error message: " .. tostring(msg) ) end end) Which is this: local exec = dbExec(database, "CREATE TABLE IF NOT EXISTS 'characters' ( characterID TEXT PRIMARY KEY )" )
  21. spawnPlayer Basiclly like this, you can use a table or so, to get the coordinate spawn locations from and then sort of just spawn the player: spawnPlayer(source, x, y, z)
  22. For ACL check: local accountName = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup("user."..accountName , aclGetGroup("Admin")) or isObjectInACLGroup("user."..accountName , aclGetGroup("Moderator")) then Checks both Moderator and Admin ACL. For teamcheck: if(getPlayerTeam(player) == getTeamFromName("Staff")) then
  23. I used to program Java, when i used ";" Well, here you don't have to and i never do that in Lua, i think it won't give any errors, if your more familiar with it, but i just go without ;
  24. Metall

    Help

    function example(player) if(getPlayerTeam(player) == getTeamFromName("TeamName")) then -- do something else -- if not return -- return end end if(getPlayerTeam(player) == getTeamFromName("TeamName")) then Basiclly checks if the player is in that team, that's what i guess you want. For your request if in criminal team: if(getPlayerTeam(player) == getTeamFromName("Criminal")) then
  25. Metall

    ERROR

    [2013-02-25 19:39:02] ERROR: ?:0: attempt to index field '?' (a nil value) It seems like your actual resource name gives that error, or file name, try changing them to something else than ?, take client or server
×
×
  • Create New...