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

TFS 0.X function getmentality

Elgenady

Veteran OT User
Joined
Aug 5, 2011
Messages
1,637
Solutions
35
Reaction score
351
hello i use 0.4
i add mentality attributes like armor attributes in {item.cpp and item.h and items.cpp and items.h and luascript.cpp {luaGetItemInfo}}
and i want to use this function
Lua:
function getmentality(cid)
      local mentality = 0
   for i = CONST_SLOT_FIRST,CONST_SLOT_LAST do
     if getPlayerSlotItem(cid, i).uid > 0 then
       if getItemInfo(getPlayerSlotItem(cid,i).itemid).mentality > 0 then
         mentality = mentality + getItemInfo(getPlayerSlotItem(cid,i).itemid).mentality
       end
     end
   end
   return mentality
end

and use
doPlayerSendCancel(cid, "Your mentality is "..getmentality(cid)..".")
always say 0

but when use this function
Lua:
function getArm(cid)
   local armor = 0
   for i = CONST_SLOT_FIRST,CONST_SLOT_LAST do
     if getPlayerSlotItem(cid, i).uid > 0 then
       if getItemInfo(getPlayerSlotItem(cid,i).itemid).armor > 0 then
         armor = armor + getItemInfo(getPlayerSlotItem(cid,i).itemid).armor
       end
     end
   end
   return armor
end

work good

i don't know what i did wrong
 
Last edited:
Back
Top