Jump to content

cacao

Members
  • Posts

    11
  • Joined

  • Last visited

Recent Profile Visitors

498 profile views

cacao's Achievements

Square

Square (6/54)

3

Reputation

  1. mta-unit-tests -- Example test -- @usage -- First, we need unit test in global table -- Then, we can describe tests g_Tests = g_Tests or {} g_Tests[#g_Tests+1] = { -- Description of testSuite ["_NAME"] = "testSuite:example simplify assert test, should return true", -- Name of assert ["testExample"] = function() assert(true, "that was true!") end, -- Second name another assert ["testAnotherExample"] = function() assertEqual(true, false, "that second assert, should equals!") end } Based script: Lunity https://github.com/READYTOMASSACRE/mta-unit-tests
  2. cacao

    Problem sql

    Try debug your script. Try execute sql query in command prompt and print variables, what you used in query.
  3. cacao

    money hack

    local i = math.floor((0.1+0.7)*10) print (i) -- 7, not 8 Maybe, you about this? this thing in several languages Test this in lua online: https://goo.gl/Wh2apy Be careful when you work with floating-point numbers.
  4. cacao

    Problem sql

    function registerHandler(thePlayer, username, password) local account = getAccount(username, password) -- you need this username = mysql_escape_string(handler, username) password = mysql_escape_string(handler, username) -- because i can put in password string "';[My Custom SQL Query been execute, lol]'" local query = "SELECT * FROM accounts WHERE username=\'"..username.."\' and password=\'"..password.."\';" local result = mysql_query(handler, query) -- ... end in 65 line you have "INSERT INTO accounts (username, password, ip, srial, registerDate) ..." srial? maybe "serial"
  5. -- https://regex101.com/ -- You need format your nicks name = "#ff0Ffffasd" matches = pregMatch(name, "^(.+)(#[0-9a-f]{6})(.+)$/i") -- name = #ff0Ffffasd -- matches[1] = #ff0Ffffasd -- matches[2] = #ff0Ffffasd -- matches[3] = #ff0Ffff if matches then name = matches[4] and matches[1] .. matches[4] or matches[3] -- why this construction? cause if we have asd#ffffffasd -- we need set nick "asdasd" end -- You take nick "asd", sort by this nick
  6. Atom (https://atom.io) UI Theme: Atom Material Theme: Apathy Packages: linter, linter-lua, language-lua
  7. It works, but it strange. Look, i switch createObject and colCircle and it's true, but it is strange.. I need to create in colshape objects and later check them counts..
  8. Yes.Look: Before After Result
  9. I tried it, but still false.
  10. But i'm create colshape on the server and first i'm created the colshape before the object
  11. Hi everyone! have here server-side script local col = createColCircle(170, -377, 15) local object = createObject(737, 175, -377, 6) print(isElementWithinColShape(object, col)) -- print false Can anyone tell me, why i got false, when object IN colshape? Object and colshape have same coordinates.
×
×
  • Create New...