beenii
Well-Known Member
- Joined
- Jul 26, 2010
- Messages
- 586
- Solutions
- 1
- Reaction score
- 58
hi people.
I would like a system where log into my database serial numbers automatically, and when the players buy "50 premium points" receive a serial number, to enter serial number on the game or site and get your points.
I'm thinking about using:
function generateSerial()
local strings = "AaBbCcDdEeFfGgHhIiJjKkLlMmOoPpQqRrSsTtUuVvWwXxYyZz"
local newSerialStr, newSerialInt = "", 0
local newSerial = ""
local query, query2, query3
repeat
for k = 1, math.random(1, 10) do
local l = math.random(1, string.len(strings))
newSerialStr = newSerialStr .. string.sub(strings, l, l)
end
newSerialInt = math.random(999999)
newSerial = newSerialStr .. "-" .. newSerialInt
query = db.getResult("select * from player_items where substring(convert(attributes using latin1) from 18) = " .. db.escapeString(newSerial))
query2 = db.getResult("select * from player_depotitems where substring(convert(attributes using latin1) from 18) = " .. db.escapeString(newSerial))
query3 = db.getResult("select * from tile_items where substring(convert(attributes using latin1) from 18) = " .. db.escapeString(newSerial))
until query:getID() == -1 and query2:getID() == -1 and query3:getID() == -1
return "!" .. newSerial
end
this function is of "Anti-Dupe - Delete all items with duplicated serial from your database."
by "Darkhaos"
with this feature, I generate the serial number with the god. on a table in my database.
I just need a function that eliminates the serial number to enter it on game or web, and pass it to another table as a number of series used.
I would like a system where log into my database serial numbers automatically, and when the players buy "50 premium points" receive a serial number, to enter serial number on the game or site and get your points.
I'm thinking about using:
function generateSerial()
local strings = "AaBbCcDdEeFfGgHhIiJjKkLlMmOoPpQqRrSsTtUuVvWwXxYyZz"
local newSerialStr, newSerialInt = "", 0
local newSerial = ""
local query, query2, query3
repeat
for k = 1, math.random(1, 10) do
local l = math.random(1, string.len(strings))
newSerialStr = newSerialStr .. string.sub(strings, l, l)
end
newSerialInt = math.random(999999)
newSerial = newSerialStr .. "-" .. newSerialInt
query = db.getResult("select * from player_items where substring(convert(attributes using latin1) from 18) = " .. db.escapeString(newSerial))
query2 = db.getResult("select * from player_depotitems where substring(convert(attributes using latin1) from 18) = " .. db.escapeString(newSerial))
query3 = db.getResult("select * from tile_items where substring(convert(attributes using latin1) from 18) = " .. db.escapeString(newSerial))
until query:getID() == -1 and query2:getID() == -1 and query3:getID() == -1
return "!" .. newSerial
end
this function is of "Anti-Dupe - Delete all items with duplicated serial from your database."
by "Darkhaos"
with this feature, I generate the serial number with the god. on a table in my database.
I just need a function that eliminates the serial number to enter it on game or web, and pass it to another table as a number of series used.
Last edited: