- Joined
- Aug 19, 2007
- Messages
- 4,941
- Solutions
- 11
- Reaction score
- 352
Create column `online` in `players` table and edit your Login and Logout.lua scripts to update that column...
Create column `online` in `players` table and edit your Login and Logout.lua scripts to update that column...
function onLogin(cid)
registerCreatureEvent(cid, "PlayerDeath")
dofile("./config.lua")
if sqlType == "mysql" then
env = assert(luasql.mysql())
con = assert(env:connect(mysqlDatabase, mysqlUser, mysqlPass, mysqlHost, mysqlPort))
else -- sqlite
env = assert(luasql.sqlite3())
con = assert(env:connect(sqliteDatabase))
end
if serverStarted == FALSE then
assert(con:execute("UPDATE `players` SET `online` = 0;"))
serverStarted = TRUE
end
assert(con:execute("UPDATE `players` SET `online` = `online`+1 WHERE `id` = "..getPlayerGUID(cid)..";"))
con:close()
env:close()
return TRUE
end
function onLogout(cid)
dofile("./config.lua")
if sqlType == "mysql" then
env = assert(luasql.mysql())
con = assert(env:connect(mysqlDatabase, mysqlUser, mysqlPass, mysqlHost, mysqlPort))
else -- sqlite
env = assert(luasql.sqlite3())
con = assert(env:connect(sqliteDatabase))
end
assert(con:execute("UPDATE `players` SET `online` = `online`-1 WHERE id = "..getPlayerGUID(cid)..";"))
con:close()
env:close()
return TRUE
end
Avarian do you need help with your AAC? So how I can help you
PS: I am standing 2 times in the Credits
Avarian do you need help with your AAC? So how I can help you
PS: I am standing 2 times in the Credits
@Avarian, yea it works good, I tested here.
@Marcinek Paladinek, check old replys, I've made a system to show if players has banned, and fix the guild membership to show his currently guild too.
I gonna improve it more, maybe Avarian like it, hope so =)
@Avarian, yea it works good, I tested here.
@Ronaldino, how I told, this system will work with the last revision of the TFS, but u can edit ur database, login.lua and logout.lua to see it working.
Just make that Marcinek Paladinek told.
@Marcinek Paladinek, check old replys, I've made a system to show if players has banned, and fix the guild membership to show his currently guild too.
I gonna improve it more, maybe Avarian like it, hope so =)