Jump to content

itHyperoX

Members
  • Posts

    522
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by itHyperoX

  1. Edit mine. local DisabledCharacters = "[\\/\\\\\"\\]\\[\\'\\-{}^$*+?,;:!£%&()_=@#~,<.>?]" addEvent("sourceRequest[Register]", true) addEventHandler("sourceRequest[Register]", root, function(username, password) if (client) and (client == source) then local playerSerial = getPlayerSerial(source) if username and #username > 3 and password and #password > 3 then if not pregFind(username, DisabledCharacters) and not pregFind(password, DisabledCharacters) then dbQuery(function(queryHandler, source) local result, rows = dbPoll(queryHandler, -1) for _, data in ipairs(result) do if data["Username"] == username then outputChatBox("This username already in use") return end if data["Serial"] == playerSerial then outputChatBox("You already have an account") return end end -- YOUR DBEXEC HERE outputChatBox("Successfully registered!") end, {source, username, password}, mysql:getConnection(), "SELECT * FROM accounts") else outputChatBox("You can't use special characters!") end else outputChatBox("Username / password must be 3 character") end end end)
  2. If you using this: - If you have a high player count, it's can cause some lag. local r1 = dbPoll(dbQuery(db, "SELECT * FROM sticks WHERE ID = ? AND model = ?", id, getElementModel(source)), -1) -- I prefer dbQuery(function(id, query) local result, row, _ = dbPoll(query, -1) -- here you can use for k, value in ipairs(result) do -- or simple sticker = result[1] end, {id}, db, "SELECT * FROM stickers WHERE ID=? AND model=?", id, getElementModel(source))
  3. Hi, i'm sure that function can be created with a string.find, or idk. So anyone can gimme a little help about how can i get that the pressed character only A to Z, and from 0 to 9 ?
  4. try to use dbQuery, check if is that better, if not, then try to use less elementData
  5. itHyperoX

    Save a memo

    i think you can with onClientResourceStop, setElementData / getElementData, or just with a simple Table
  6. ID System local charID = {} entHandler("onPlayerJoin", getRootElement(), function() local slot = nil for i = 1, 1024 do if (charID[i]==nil) then slot = i break end end charID[slot] = source setElementData(source, "Player:ID", slot) end) addEventHandler("onPlayerQuit", getRootElement(), function() local slot = getElementData(source, "Player:ID") if (slot) then charID[slot] = nil end end)
  7. Yes, you correct. With JSON. https://wiki.multitheftauto.com/wiki/ToJSON https://wiki.multitheftauto.com/wiki/FromJSON
  8. setTimer(function() addEventHandler("onClientRender", root, text) setTimer(function() removeEventHandler("onClientRender", root, text) end, 3000, 1) end, 1000, 1) function text() dxDrawText -- yourstuff here end
  9. Give me a script to solve the problem. wtf setAccountData getAccountData givePlayerMoney setElementModel
  10. https://wiki.multitheftauto.com/wiki/GetDistanceBetweenPoints3D
  11. onMarkerHit parameters: Parameters element hitElement, bool matchingDimension
  12. use onPlayerJoin then setElementData(source, "Player:Loggedin", false) in votemanager somewhere before the render, use > if no getElementData(localPlayer, "Player:Loggedin") then return end
  13. rlly, you already have a server but you don't even know how to add cars. cmon..
  14. https://wiki.multitheftauto.com/wiki/ShowPlayerHudComponent
  15. local BlockedWords = { "mtasa", "second", "third", "addmore", } addEventHandler("onPlayerChat",getRootElement(), function(message, type) cancelEvent() if (type == 1) or (type == 2) then cancelEvent() end if (type == 0) then local new = "" local counter = 0 for word in message:gmatch("%S+") do counter = counter + 1 for i, swr in ipairs(BlockedWords) do local src = word:lower():gsub("%s", "") local src = src:gsub("#%x%x%x%x%x%x", "") local src = src:gsub("%c", "") local src = src:gsub("%p", "") local pat = swr:lower():gsub("%s", "") if src:find(pat) then local replaceString = "" for x=1,word:gsub("#%x%x%x%x%x%x",""):len() do replaceString = replaceString.."*" end word = word:gsub(word, replaceString) end end if counter == 1 and word:len() > 2 then word = word:gsub("%a", string.upper, 0) end new = new..word.." " end if new ~= "" then message = new end outputChatBox(getPlayerName(source)..":#FFFFFF "..message, root, 255, 255, 255, true) end end)
  16. download gta sa map editor, then find the object id, then use removeWorldModel
  17. setPlayerBlurLevel ( element, 0 )
  18. meta.xml <meta> <script src="server.lua" type="server" /> <script src="client.lua" type="client" /> <export function="giveMoney" type="server" /> <export function="giveMoney" type="client" /> </meta> client.lua --[[ CLIENT SIDE ]] function giveMoney(value) triggerServerEvent("source >> giveMoney", getLocalPlayer(), value) end server.lua --[[ SERVER SIDE ]] addEvent("source >> giveMoney",true) addEventHandler("source >> giveMoney", getRootElement(), function(value) givePlayerMoney(source, value) return true end) function giveMoney(element, value) if isElement(element) and tonumber(value) then givePlayerMoney(element, value) return true else return false end end
  19. function heroinDrugOff(source,player) local playerHealth = getElementHealth(theDrugPlayer) setPlayerStat (theDrugPlayer, 24, 590) if (playerHealth > 100) then setElementHealth(theDrugPlayer, 100) else setElementHealth(theDrugPlayer, playerHealth) end outputChatBox("yourmessages") end
×
×
  • Create New...