-
Posts
1,134 -
Joined
-
Last visited
-
Days Won
37
Everything posted by NeXuS™
-
Do you have a command so players can create their own team and join a team?
-
Use getTeamColor setPlayerNametagColor I think the scoreboard uses the player's nametag color.
-
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
-
Can you do a screenshot of it? It's maybe non-convertible to number.
-
Try debugging the script. Add outputChatBox(price) above the if statement on your server-sided script.
-
I dont think you should check if the player has enough money on client-side.
-
You'll have to edit the scoreboard to fix it.
-
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.
-
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.
-
Search for something like "databases" folder.
-
Can you do a screenshot of the mapinterims table?
-
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.
-
Does the outputServerLog outputs anything?
-
executeSQLQuery("DELETE FROM ? WHERE playerName=?", mapTable, t.playerName) Try this one.
-
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.
-
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.
-
Try stopping every resource (keep the MTA default ones), and restart this hud script, see if it is still not working for you.
-
Do you use any other scripts?