slaw
Software Developer
This command will remove player 1 frag, if he have item needed.
talkactions.xml
removefrag.lua
talkactions.xml
Code:
<talkaction words="!rf" script="removefrag.lua" />
removefrag.lua
Code:
local config =
{
item = 333,
count = 1,
fragTime = getConfigInfo('timeToDecreaseFrags')
}
function onSay(cid, words, param)
if getPlayerItemCount(cid, config.item) >= config.count then
local tmp = getPlayerRedSkullTicks(cid)
if tmp >= config.fragTime then
doPlayerRemoveItem(cid, config.item, config.count)
doPlayerSetRedSkullTicks(cid, tmp - config.fragTime)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your one frag has been cleared.")
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You dont have any frag to clear..")
end
else
doPlayerSendCancel(cid, "You dont have this item.")
end
return TRUE
end
Last edited: