Make a check if he's not PZ-locked and it'd be nice. Right now, it's useless and abusive only.
Don't replace NPCs with actions! Replace actions with NPCs!
Change gold thingy... grrr I hate it tho >.>
Also, tab your scripts correctly, it looks horrible
Call it buy.lua and redirect !backpack and !aol to buy.lua, easy to add more items, just add a new line in the array, change !backpack to the word and itemid etc
Don't replace NPCs with actions! Replace actions with NPCs!
Change gold thingy... grrr I hate it tho >.>
Also, tab your scripts correctly, it looks horrible
PHP:
items = {
["!backpack"] = {1988, 1, 100},
["!aol"] = {2173, 1, 10000},
}
function onSay(cid, words, param)
item = items[words]
if (item ~= nil) then
if doPlayerRemoveMoney(cid, item[3]) == 1 then
doPlayerAddItem(cid, item[1], item[2])
else
doPlayerSendCancel(cid, 'You don\'t have enough money.')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return 0
end
return 1
end
return 0
end
Call it buy.lua and redirect !backpack and !aol to buy.lua, easy to add more items, just add a new line in the array, change !backpack to the word and itemid etc
Last edited: