felipedorgas
New Member
- Joined
- Aug 10, 2010
- Messages
- 34
- Reaction score
- 1
hey guys, i need help in this script:
if the player does not have enough money, he takes a part, not bless them and says he does not have enough money
i need help in this script too:
vip ends when the script has to take the storage 5000.
I tried, it did not work more:
i rep++++
thx
if the player does not have enough money, he takes a part, not bless them and says he does not have enough money
Code:
function onSay(cid, words, param)
local fail = 0
if getPlayerLevel(cid) < 31 then
cost = 2000
else
cost = ((getPlayerLevel(cid) - 30) * 200) + 2000
end
if cost > 20000 then
cost = 20000
end
for i = 1, 5 do
if getPlayerBlessing(cid, i) then
fail = fail + 1
else
if doPlayerRemoveMoney(cid, cost) == TRUE then
doPlayerAddBlessing(cid, i)
if i == 5 and not(fail == 5) then
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
end
else
doPlayerSendCancel(cid, "You do not have enough money to buy all the blessings!")
break
end
end
end
if fail == 5 then
doPlayerSendCancel(cid, "You already have all the blessings!")
end
return TRUE
end
i need help in this script too:
vip ends when the script has to take the storage 5000.
I tried, it did not work more:
Code:
function onLogin(cid)
if isVip(cid) == FALSE then
doPlayerSetPromotionLevel(cid,1)
end
local vip = isVip(cid)
if getVipTime(cid) > 0 and vip == FALSE then
doPlayerSetStorageValue(cid, 5000, 0) -- Termina a VIP
local townid = 2
doPlayerSetTown(cid, townid)
local templePos = getTownTemplePosition(getPlayerTown(cid))
doTeleportThing(cid, templePos, false)
setVipTime(cid, 0)
doTeleportPlayers(cid, templePos)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sua Vip acabou!")
elseif vip == TRUE then
local duration = getVipDate(cid)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você possui "..getVipDays(cid).." dia(s) de vip."..(duration and (" Ela irá durar até "..duration..".") or ""))
end
return TRUE
end
i rep++++
thx