• 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!

!buy "aol invalid item

TKO

Syphero Owner!
Joined
Mar 10, 2008
Messages
2,252
Reaction score
27
Location
Sweden
hey i updated to 0.3.5 distro and i put over the buy.lua and i say !buy "aol it say invalid item why?
code:
Code:
-----------------------By Nahruto--------------------------
-------------------http://otfans.net/----------------------
 function getPlayerMoney(cid)
gold = getPlayerItemCount(cid,2148)
plat = getPlayerItemCount(cid,2152)*100
crys = getPlayerItemCount(cid,2160)*10000
money = gold + plat + crys
return money
end
local items = {
    ["aol"] = {cash=10000, id=2173, amount=1},
    ["backpack"] = {cash=20, id=2000, amount=1},
    ["shovel"] = {cash=50, id=2554, amount=1},
    ["rope"] = {cash=50, id=2120, amount=1},
    ["food"] = {cash=100, id=2672, amount=10}
} 
---------End Config ---------
function onSay(cid, words, param)
bitem = items[param]
	if (bitem ~= nil) then
		if getPlayerMoney(cid) >= bitem.cash then
			doPlayerAddItem(cid,bitem.id,bitem.amount)
			doPlayerRemoveMoney(cid,bitem.cash)
			doSendMagicEffect(getPlayerPosition(cid),14)
		else
			doPlayerSendCancel(cid,"Sorry, you dont have enough money")
			doSendMagicEffect(getPlayerPosition(cid),2)
		end
	else
		doPlayerSendCancel(cid, "Invalid item.")
		doSendMagicEffect(getPlayerPosition(cid),2)         
	end
return 1
end
 
3.5..
Lua:
    <item id="2173" article="an" name="amulet of loss">
        <attribute key="weight" value="420"/>
        <attribute key="slotType" value="necklace"/>
        <attribute key="charges" value="1"/>
        <attribute key="preventDrop" value="1"/>
    </item>
 
Use this talkaction

Code:
<talkaction words="!aol" event="script" value="aol.lua" />

and script aol.lua
Code:
function onSay(cid, words, param)
if doPlayerRemoveMoney(cid, 20000) == TRUE then
doPlayerAddItem(cid, 2173, 1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MORTAREA)
doCreatureSay(cid, "!aol", TALKTYPE_ORANGE_1)
else
doPlayerSendCancel(cid, 'You don\'t have enough money.')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FLAMEAREA)
end
end

It 100% working.
 
Back
Top