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

Solved /i command won't work

EvoSoft

Is Da Mapper
Joined
Mar 10, 2010
Messages
693
Reaction score
5
Location
Northen part of Sweden
Hey!
I'm using this: https://otland.net/threads/10-76-tfs-1-0-sources-cast-system-update-v8-1.230271/

I'm group ID 3 on my character (Administrator, highest group), still I can't seem to create items.. When I type /i <id> or /i <id>, 1 nothing happens.. Not even a white cloud..
I've tried to change administrator to id 5.. and tried to change this line:
Code:
  if player:getAccountType() < ACCOUNT_TYPE_GOD then

     return false
to this:
Code:
  if player:getAccountType() < 3 then

     return false
Nothing..

What more can I try?
Thanks for any help!

create_item.lua:
Code:
function onSay(player, words, param)
   if not player:getGroup():getAccess() then
     return true
   end

   if player:getAccountType() < ACCOUNT_TYPE_GOD then
     return false
   end

   local split = param:split(",")

   local itemType = ItemType(split[1])
   if itemType:getId() == 0 then
     itemType = ItemType(tonumber(split[1]))
     if itemType:getId() == 0 then
       player:sendCancelMessage("There is no item with that id or name.")
       return false
     end
   end

   local count = tonumber(split[2])
   if count ~= nil then
     if itemType:isStackable() then
       count = math.min(10000, math.max(1, count))
     elseif not itemType:isFluidContainer() then
       count = math.min(100, math.max(1, count))
     else
       count = math.max(0, count)
     end
   else
     if not itemType:isFluidContainer() then
       count = 1
     else
       count = 0
     end
   end

   local result = player:addItem(itemType:getId(), count)
   if result ~= nil then
     if not itemType:isStackable() then
       if type(result) == "table" then
         for _, item in ipairs(result) do
           item:decay()
         end
       else
         result:decay()
       end
     end
     player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
   end
   return false
end
 
Back
Top