Jump to content

Hamatora

Members
  • Posts

    11
  • Joined

  • Last visited

Everything posted by Hamatora

  1. function giveWeaponsOnPlayerSpawn() giveWeapon (source, 26, 20) end addEventHandler ("onPlayerSpawn", getRootElement (), giveWeaponsOnPlayerSpawn) -- use function's name here And the meta: <meta> <script src="script.lua" type="server"/> </meta> Use '/debugscript 3' to check the errors within the script.
  2. DGS = exports.dgs function clientsideResourceStart () gridlist = DGS:dgsCreateGridList ( 0.80, 0.10, 0.15, 0.60, true ) DGS:dgsSetVisible(gridlist, false) local column = DGS:dgsGridListAddColumn( gridlist, "Player", 0.85 ) end addEventHandler ( "onClientResourceStart", resourceRoot, clientsideResourceStart ) function testing() DGS:dgsSetVisible(gridlist, true) for id, playeritem in ipairs(getElementsByType("player")) do local row = DGS:dgsGridListAddRow ( gridlist ) DGS:dgsGridListSetItemText ( gridlist, row, column, getPlayerName ( playeritem ) ) end end addCommandHandler("testing", testing) https://imgur.com/a/JHkf5CO What's wrong in it?
  3. Well, dgsDxGridlistSetItemColor doesnt works or only for me.. You might check it
  4. Working fine for me.
  5. Hamatora

    string.gsub

    Can anyone tell me how do I remove [ ] brackets using string.gsub?
  6. dgsDxGUISetEnabled only works on button I mean it should work on tabs too
  7. Wow great.. I suggest if there were a tab panel enabling
  8. Hamatora

    Help.

    And what if I want to edit the field?
  9. Hamatora

    Help.

    Suppose I created a table, and inserted 8 fields into it. Now I wish to remove the 3rd field how can I? Like this: mytable = { {"1"}; {"2"}; {"3"}; {"4"}; {"5"}; {"6"}; {"7"}; {"8"}; }
  10. Thanks alot @NeXuS™
  11. Hello guys, I need help with this simple server script. Everything is working fine, the problem is that when I delete ID from the table. Take a look: function onResourceStart() executeSQLQuery("CREATE TABLE IF NOT EXISTS testing (id INT, text TEXT, name TEXT)") end addEventHandler("onResourceStart", resourceRoot, onResourceStart) function onChat(msg, msgType) if msgType == 0 then theTable = executeSQLQuery("SELECT * FROM testing") executeSQLQuery("INSERT INTO testing (id, text, name) VALUES (?,?,?)", #theTable + 1, msg, getPlayerName(source)) end end addEventHandler("onPlayerChat", root, onChat) function showTable() theTable = executeSQLQuery("SELECT * FROM testing") for i,v in ipairs(theTable) do outputChatBox("ID: "..tostring(v.id).." NAME: "..tostring(v.name).." MSG: "..tostring(v.text)) end end addCommandHandler("showtable", showTable) function deleteFromTable(source, cmd, id) executeSQLQuery("DELETE FROM testing WHERE id=?", id) end addCommandHandler("delete", deleteFromTable) Suppose the table is: ID: 1 NAME: Hamatora MSG: test ID: 2 NAME: Hamatora MSG: test ID: 3 NAME: Hamatora MSG: test -> Use /delete 2 Means ID 2 will be deleted. -> Now chat -> Now use /showtable You will see that ID 3 is repeated two times, thats the problem
×
×
  • Create New...