• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

How to add exhaust to talkactions script ??

wladca

Member
Joined
Dec 9, 2008
Messages
641
Reaction score
6
Location
Poland,Grodzisk Mazowiecki
How to add exhaust to this script for ex. ?

function onSay(cid, words, param)
if doPlayerRemoveMoney(cid, 10000) then
doPlayerAddItem(cid, 2173, 1)
doPlayerSendTextMessage(cid, 19, "You've bought amulet of loss for 10000 gold coins.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_BLUE)
else
doPlayerSendCancel(cid, "Sorry, you need 10000 gold coins to buy amulet of loss.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
return true
end

this is my lib file :

exhaustion =
{
check = function (cid, storage)
if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
return false
end

return getPlayerStorageValue(cid, storage) >= os.time(t)
end,

get = function (cid, storage)
if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
return false
end

local exhaust = getPlayerStorageValue(cid, storage)
if(exhaust > 0) then
local left = exhaust - os.time(t)
if(left >= 0) then
return left
end
end

return false
end,

set = function (cid, storage, time)
setPlayerStorageValue(cid, storage, os.time(t) + time)
end,

make = function (cid, storage, time)
local exhaust = exhaustion.get(cid, storage)
if(not exhaust) then
exhaustion.set(cid, storage, time)
return true
end

return false
end
}
 
please write exhaust to this script for example

function onSay(cid, words, param)
if doPlayerRemoveMoney(cid, 10000) then
doPlayerAddItem(cid, 2173, 1)
doPlayerSendTextMessage(cid, 19, "You've bought amulet of loss for 10000 gold coins.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_BLUE)
else
doPlayerSendCancel(cid, "Sorry, you need 10000 gold coins to buy amulet of loss.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
return true
end

and everything I'll know ;-)
 
Try this.

function onSay(cid, words, param)

local storage = 14678
local time = 3 -- time in minutes

if doPlayerRemoveMoney(cid, 10000) and getPlayerStorageValue(cid,storage) <= os.time() then
doPlayerAddItem(cid, 2173, 1)
doPlayerSendTextMessage(cid, 19, "You've bought amulet of loss for 10000 gold coins.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_BLUE)
setPlayerStorageValue(cid,storage, os.time()+time*60)
else
doPlayerSendCancel(cid, "Sorry, you need 10000 gold coins or need need to wait ".. time .." minutes to buy amulet of loss.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
return true
end
 
Lua:
function onSay(cid, words, param)
if exhaustion.get(cid, 101) then
		doPlayerSendCancel(cid, 'You can use this command only once per 5 seconds.')
		return true
	end
	exhaustion.set(cid, 101, 5)
if doPlayerRemoveMoney(cid, 10000) then
doPlayerAddItem(cid, 2173, 1)
doPlayerSendTextMessage(cid, 19, "You've bought amulet of loss for 10000 gold coins.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_BLUE)
else
doPlayerSendCancel(cid, "Sorry, you need 10000 gold coins to buy amulet of loss.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
return true
end
 
only vip can use this command, is it posible ?

and the !bless comm.

vip by mock

Code:
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!')elseif doPlayerRemoveMoney(cid,50000)== TRUE then
doPlayerAddBlessing(cid,1)
doPlayerAddBlessing(cid,2)
doPlayerAddBlessing(cid,3)
doPlayerAddBlessing(cid,4)
doPlayerAddBlessing(cid,5)
doSendMagicEffect(getPlayerPosition(cid),28)
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have been blessed by the gods!')else
doPlayerSendCancel(cid,"You need 50000 gold coins to get blessed!")endendreturn TRUE
end
 
Code:
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!')elseif doPlayerRemoveMoney(cid,50000)== TRUE then
doPlayerAddBlessing(cid,1)
doPlayerAddBlessing(cid,2)
doPlayerAddBlessing(cid,3)
doPlayerAddBlessing(cid,4)
doPlayerAddBlessing(cid,5)
doSendMagicEffect(getPlayerPosition(cid),28)
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have been blessed by the gods!')else
doPlayerSendCancel(cid,"You need 50000 gold coins to get blessed!")endendreturn TRUE
end
wtf is that.
Code:
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!')
     elseif doPlayerRemoveMoney(cid, 50000) == TRUE then
         for i = 1, 5 do
             doPlayerAddBlessing(cid, i)
         end
         doSendMagicEffect(getPlayerPosition(cid),28)
         doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have been blessed by the gods!')
     else
         doPlayerSendCancel(cid,"You need 50000 gold coins to get blessed!")
     end
     return TRUE
end
Code:
function onSay(cid, words, param)

     if not vip.hasVip(cid) then
         doPlayerSendCancel(cid,'You require vip!')
         return true
     end
    
     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!')
     elseif doPlayerRemoveMoney(cid, 50000) == TRUE then
         for i = 1, 5 do
             doPlayerAddBlessing(cid, i)
         end
         doSendMagicEffect(getPlayerPosition(cid),28)
         doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have been blessed by the gods!')
     else
         doPlayerSendCancel(cid,"You need 50000 gold coins to get blessed!")
     end
    
     return TRUE
end
 
Back
Top