function onThink(cid)
for _, cid in ipairs(getPlayersOnline()) do
if isPremium(cid) and getPlayerPromotionLevel(cid) < 1 then
setPlayerPromotionLevel(cid,1)
else
if getPlayerPromotionLevel(cid) > 0 then
setPlayerPromotionLevel(cid,0)
end
end
end
return true
end
<event type="think" name="t" event="script" value="xxxx.lua"/>
registerCreatureEvent(cid, "t")
local cfg = {
newtownid = 1
}
function onThink(cid)
for _, cid in ipairs(getPlayersOnline()) do
local queststatus = getPlayerStorageValue(cid,2333)
if queststatus == -1
if isPremium(cid) == false and getPlayerPromotionLevel(cid) >= 1 then
doPlayerSetTown(cid, cfg.newtownid)
setPlayerPromotionLevel(cid,0)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))
setPlayerStorageValue(cid,2333,1)
end
end
end
return true
end
local cfg = {
newtownid = 1
}
function onThink(cid)
for _, cid in ipairs(getPlayersOnline()) do
if isPremium(cid) == false and getPlayerPromotionLevel(cid) >= 1 then
setPlayerPromotionLevel(cid,0)
doPlayerSetTown(cid, cfg.newtownid)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))
setPlayerStorageValue(cid,2333,1)
end
end
return true
end
local cfg = {
newtownid = 1
}
function onThink(cid)
for _, cid in ipairs(getPlayersOnline()) do
local queststatus = getPlayerStorageValue(cid,2333)
if (not isPremium(cid)) and queststatus == 1 then
doPlayerSetTown(cid, cfg.newtownid)
setPlayerPromotionLevel(cid,0)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))
setPlayerStorageValue(cid,2333,-1)
end
if isPremium(cid) and queststatus < 1 then
setPlayerStorageValue(cid,2333,1)
end
end
return true
end
blessingOnlyPremium = true
blessingOnlyPremium = false
function onSay(cid, words, param)
if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then
doPlayerSendCancel(cid,'You have already got one or more blessings!')
else
if doPlayerRemoveMoney(cid, 60000) == TRUE then
doPlayerAddBlessing(cid, 1)
doPlayerAddBlessing(cid, 2)
doPlayerAddBlessing(cid, 3)
doPlayerAddBlessing(cid, 4)
doPlayerAddBlessing(cid, 5)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have been blessed by the gods!')
else
doPlayerSendCancel(cid, "You need 6 crystal coin to get blessed!")
end
end
return 1
end