enriel
Big L
Anyone that can help me make a script like !buyxp, it basically takes 1 item and gives u instead 20mil exp. Anyone that can make it for me?
function onSay(cid, words, param)
local item = xxxx -- Id of the item which should be removed
local exp = 20000000 -- the exp which he should get
if doPlayerRemoveItem(cid,item,1) == TRUE then
doPlayerAddExp(cid, exp)
else
doPlayerSendCancel(cid,"You don't have the required item.")
end
return FALSE
end
local config = {
xpToGive = 20000000,
itemToRemove = 1234,
itemCount = 1
}
function onSay(cid, words, param)
if doPlayerRemoveItem(cid, config.itemToRemove, config.itemCount) == TRUE then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have bough "..config.xpToGive.." experience points.")
doPlayerAddExp(cid, config.xpToGive)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, "You need "..config.itemCount.." "..getItemNameById(config.itemToRemove)..".")
end
return FALSE
end
@up;
You wasnt here when I was posting
Code:local config = { xpToGive = 20000000, itemToRemove = 1234, itemCount = 1 } function onSay(cid, words, param) if doPlayerRemoveItem(cid, config.itemToRemove, config.itemCount) == TRUE then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have bough "..config.xpToGive.." experience points.") doPlayerAddExp(cid, config.xpToGive) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, "You need "..config.itemCount.." "..getItemNameById(config.itemToRemove)..".") end return FALSE end
for TFS 0.2 change getItemNameById to getItemName.