Shawak
Intermediate OT User
This function check, if the player is online .
Version:
TFS 0.3.5.
data/lib/functions.lua at the end, add:
Example:
I hope you like it .
Regards,
Shawak
Version:
TFS 0.3.5.
data/lib/functions.lua at the end, add:
Lua:
function isPlayerOnline(name)
local result = db.getResult("SELECT `online` FROM `players` WHERE `name` = '"..name.."';")
return result:getDataInt("online") == 1 and TRUE or FALSE
end
Example:
Lua:
function onSay(cid, words, param, channel)
if isPlayerOnline(param) == TRUE then
doPlayerSendTextMessage(cid, 18, ""..param.." is online.")
else
doPlayerSendTextMessage(cid, 18, ""..param.." is offline.")
end
return TRUE
end
I hope you like it .
Regards,
Shawak