Elgenady
Veteran OT User
- Joined
- Aug 5, 2011
- Messages
- 1,638
- 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
and use
doPlayerSendCancel(cid, "Your mentality is "..getmentality(cid)..".")
always say 0
but when use this function
work good
i don't know what i did wrong
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: