Snoowy Posted January 14, 2018 Share Posted January 14, 2018 Hy! I started the easily script for today. The command essence the player write /getserial, get the player serial, search for MySQL data, account table, serial column, and if there are write ouputChatBox the yes, if not there are write the outputChatBox no. However command is not working, i write the command in chat, however only write yes. Please help me, and thank you for help! function serialgetme(player, command, serial) local pserial = getPlayerSerial(player) local seri = dbQuery(connection,"SELECT * FROM accounts WHERE serial = ?", pserial) if seri then outputChatBox("yes") else outputChatBox("no") end end addCommandHandler("getserial", serialgetme) Link to comment
Oussema Posted January 14, 2018 Share Posted January 14, 2018 function getPserial (player,cmd) local serial = getPlayerSerial(player) local db = dbPoll( dbQuery(connection,"SELECT * FROM accounts WHERE serial = ?", serial), -1 ) for i, row (db) do return outputChatBox("Serial Found") end return outputChatBox("Serial Not Found") end addCommandHandler("getserial") this will work , try it Link to comment
Snoowy Posted January 15, 2018 Author Share Posted January 15, 2018 Hy! Not working, please help me.. server.lua:12: 'in' expected near '(' Link to comment
URBAN Posted January 15, 2018 Share Posted January 15, 2018 function getPserial (player,cmd) local serial = getPlayerSerial(player) local db = dbPoll(dbQuery(connection,"SELECT * FROM accounts WHERE serial = ?", serial), -1) for i, row in ipairs(db) do return outputChatBox("Serial Found") end return outputChatBox("Serial Not Found") end addCommandHandler("getserial") This will work. Link to comment
Oussema Posted January 18, 2018 Share Posted January 18, 2018 On 15/01/2018 at 17:55, Snoowy said: Hy! Not working, please help me.. server.lua:12: 'in' expected near '(' urban fixed it for u , it's will work , thx urban :v i forget it , bcs i was typing too faster 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now