Jump to content

NeXuS™

Retired Staff
  • Posts

    1,134
  • Joined

  • Last visited

  • Days Won

    37

Everything posted by NeXuS™

  1. Do you have a command so players can create their own team and join a team?
  2. Use getTeamColor setPlayerNametagColor I think the scoreboard uses the player's nametag color.
  3. Try this. if getPlayerMoney(source) >= tonumber(string.sub(price, 2)) then -- attempt to compare string with number. I if use tonumber(price) the error is => attempt to compare nil with number giveWeapon(source,weaponID,ammo) -- without the condition it gives me the weapon end
  4. NeXuS™

    Tag Panel

    This is a show-off of an already done script. This post should be in the Resources sub-forum, not in the Scripting one. @Dutchman101.
  5. Can you do a screenshot of it? It's maybe non-convertible to number.
  6. Try debugging the script. Add outputChatBox(price) above the if statement on your server-sided script.
  7. I dont think you should check if the player has enough money on client-side.
  8. This script has more errors than the given debug error messages. Would you mind if I rewrite the whole thing?
  9. You'll have to edit the scoreboard to fix it.
  10. A txt format wont be converted to db format with nothing. You can't convert a text file to a database, because they don't do the same. A txt file is for notes, a db file is for datas.
  11. There is a way to do it without timers, but it's much more simple with them. If you want to, you can do with getTickCount and a while cycle.
  12. Search for something like "databases" folder.
  13. Can you do a screenshot of the mapinterims table?
  14. function delAllTopsOfPlayer(player, command, name) local accountName = getAccountName(getPlayerAccount(player)) if isGuestAccount (getPlayerAccount(player)) or not (isObjectInACLGroup("user."..accountName, aclGetGroup("Admin")) or isObjectInACLGroup("user."..accountName, aclGetGroup("SuperModerator"))) then return end if not name then outputChatBox("You must specify a player name in order to delete all of their toptimes!", player, 255, 0, 0, true) return end local otherPlayer = string.lower(name) local otherPlayerName local rname local map_names = {} for k, v in ipairs(exports.mapmanager:getMapsCompatibleWithGamemode(getResourceFromName('race'))) do rname = getResourceName(v) local mode = 'Sprint' map_names['race maptimes '..mode..' ' .. (getResourceInfo(v, 'name' ) or getResourceName(v))] = v end local maps_table = executeSQLQuery("SELECT tbl_name FROM sqlite_master WHERE tbl_name LIKE 'race maptimes %' ") for k, v in ipairs(maps_table) do local mapTable = v.tbl_name if map_names[mapTable] then local mapTimes = executeSQLQuery("SELECT playerName FROM ?", mapTable) for i, t in ipairs(mapTimes) do if getAccount(t.playerName) then if string.lower(getAccountData(getAccount(t.playerName), "currentPlayerName"):gsub( '#%x%x%x%x%x%x', '' )) == otherPlayer:gsub( '#%x%x%x%x%x%x', '' ) then otherPlayerName = getAccountData(getAccount(t.playerName), "currentPlayerName") executeSQLQuery("DELETE FROM ? WHERE playerName=?", mapTable, t.playerName) outputServerLog("Toptimes of "..otherPlayerName:gsub( '#%x%x%x%x%x%x', '' ).." deleted!") local delays = executeSQLQuery("SELECT * FROM mapinterims WHERE mapname = ?", getResourceName(map_names[mapTable])) if #delays > 0 then executeSQLQuery("DELETE FROM mapinterims WHERE mapname=?", getResourceName(map_names[mapTable])) outputServerLog("Delay times for "..otherPlayerName:gsub( '#%x%x%x%x%x%x', '' ).." deleted!") end end end end end end if otherPlayerName then outputChatBox("#FF0000All of #FFFFFF"..otherPlayerName.."#FF0000's toptimes were deleted!" , root, 255, 0, 0, true) else outputChatBox("No such player name found in toptimes database.", p, 255, 0, 0, true) end end addCommandHandler("deletealltimes", delAllTopsOfPlayer) addCommandHandler("deletealltops", delAllTopsOfPlayer) addCommandHandler("delalltimes", delAllTopsOfPlayer) addCommandHandler("delalltops", delAllTopsOfPlayer) Try this one. If this doesn't work, post a screenshot of the SQL table.
  15. Does the outputServerLog outputs anything?
  16. executeSQLQuery("DELETE FROM ? WHERE playerName=?", mapTable, t.playerName) Try this one.
  17. For the last script, you'll have to paste your starting position, where the heli spawns, and next move to the end position, where you want the heli, and just replace "here" with that position.
  18. 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") nextID = theTable[#theTable]["id"] + 1 executeSQLQuery("INSERT INTO testing (id, text, name) VALUES (?,?,?)", nextID, 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) Try this one.
  19. NeXuS™

    Firehose

    Same as dxDrawLine3D, just uses a material instead of colors.
  20. NeXuS™

    map

    Won't need that one, it disables the radar, not the map, you'll have to use a function to detect the press of F11 and do a cancelEvent on it.
  21. NeXuS™

    map

    Use dxDrawImage or guiCreateStaticImage for both.
  22. NeXuS™

    map

    You can just draw this image when you press F11 and draw the blips on it.
  23. Try stopping every resource (keep the MTA default ones), and restart this hud script, see if it is still not working for you.
  24. Do you use any other scripts?
×
×
  • Create New...