bok
Member
I wonder as I do for my server to send messages only player with premium account?
--Pirate server--
--By; Gugah--
function onThink(interval, lastExecution)
local Online = getPlayersOnline()
local msgtype = MESSAGE_INFO_DESCR --Here u put the msg type.
local msg = "Messeger." -- Here is the message.
for pid = 1, #Online do
if isPremium then
doPlayerSendTextMessage(Online[pid], msgtype, msg)
else
return true
end
end
return true
end
<globalevent name="servemsg" interval="1000" event="script" value="scriptname.lua"/>
local msgtype = MESSAGE_INFO_DESCR
local msg = "Message"
function onThink(interval, lastExecution)
for _, pid in ipairs(getOnlinePlayers()) do
if isPremium(cid) then
doPlayerSendTextMessage(pid, msgtype, msg)
end
end
return true
end
veri bugas@up bugas
fix
Code:local msgtype = MESSAGE_INFO_DESCR local msg = "Message" function onThink(interval, lastExecution) for _, [B][COLOR="Blue"]pid[/COLOR][/B] in ipairs(getOnlinePlayers()) do if isPremium([B][COLOR="Red"]cid[/COLOR][/B]) then doPlayerSendTextMessage(pid, msgtype, msg) end end return true end
local msgtype = MESSAGE_INFO_DESCR
local msg = "Message"
function onThink(interval, lastExecution)
for _, pid in ipairs(getOnlinePlayers()) do
if isPremium(pid) then
doPlayerSendTextMessage(pid, msgtype, msg)
end
end
return true
end
this is a globalevent not a creaturescriptyou cant use function onThink(cid, interval) ? S:
if isPremium(pid) then
if not isPremium(pid) then
local t =
{
message = "Yayaya!",
type = MESSAGE_STATUS_CONSOLE_ORANGE
{
function onThink(interval, lastExecution)
for _, pid in ipairs(getPlayersOnline()) do
if isPremium(pid) then
doPlayerSendTextMessage(pid, t.type, t.message)
end
end
return true
end