Exactly
New Member
- Joined
- Jul 14, 2014
- Messages
- 117
- Reaction score
- 4
Hello, i have problem on addon system on action
Bug when i use item on map:
My script:
function onUse(cid, item, fromPos, itemEx, toPos)
for i = 0, #outfity do
if item.uid == outfity.uniqueid then
if getPlayerStorageValue(cid, outfity.uniqueid) < 1 then
if getPlayerSex(cid) == 1 then
doPlayerAddOutfit(cid, outfity.outfitmale, outfity.addon)
doCreatureSay(cid, 'Zdobyles addon numer ' .. outfity.addon .. ' do ' .. outfity.nazwamale .. ' outfit.', TALKTYPE_MONSTER)
doPlayerSetStorageValue(cid, outfity.uniqueid, 1)
else
doPlayerAddOutfit(cid, outfity.outfitfemale, outfity.addon)
doCreatureSay(cid, 'Zdobylas addon numer ' .. outfity.addon .. ' do ' .. outfity.nazwafemale .. ' outfit.', TALKTYPE_MONSTER)
doPlayerSetStorageValue(cid, outfity.uniqueid, 1)
end
else
doCreatureSay(cid, 'Posiadasz juz ' .. outfity.addon .. ' addon do ' .. outfity.nazwamale .. ' outfit.', TALKTYPE_MONSTER)
end
else
-- ERROR --
end
end
return true
end
THANKS!!
Bug when i use item on map:
Code:
attempt to call global 'doPlayerSetStorageValue' (a nil value)
stack traceback:
[C]: in function 'doPlayerSetStorageValue'
My script:
Code:
function onUse(cid, item, fromPos, itemEx, toPos)
for i = 0, #outfity do
if item.uid == outfity[i].uniqueid then
if getPlayerStorageValue(cid, outfity[i].uniqueid) < 1 then
if getPlayerSex(cid) == 1 then
doPlayerAddOutfit(cid, outfity[i].outfitmale, outfity[i].addon)
doCreatureSay(cid, 'Zdobyles addon numer ' .. outfity[i].addon .. ' do ' .. outfity[i].nazwamale .. ' outfit.', TALKTYPE_MONSTER)
doPlayerSetStorageValue(cid, outfity[i].uniqueid, 1)
else
doPlayerAddOutfit(cid, outfity[i].outfitfemale, outfity[i].addon)
doCreatureSay(cid, 'Zdobylas addon numer ' .. outfity[i].addon .. ' do ' .. outfity[i].nazwafemale .. ' outfit.', TALKTYPE_MONSTER)
doPlayerSetStorageValue(cid, outfity[i].uniqueid, 1)
end
else
doCreatureSay(cid, 'Posiadasz juz ' .. outfity[i].addon .. ' addon do ' .. outfity[i].nazwamale .. ' outfit.', TALKTYPE_MONSTER)
end
else
-- ERROR --
end
end
return true
end
function onUse(cid, item, fromPos, itemEx, toPos)
for i = 0, #outfity do
if item.uid == outfity.uniqueid then
if getPlayerStorageValue(cid, outfity.uniqueid) < 1 then
if getPlayerSex(cid) == 1 then
doPlayerAddOutfit(cid, outfity.outfitmale, outfity.addon)
doCreatureSay(cid, 'Zdobyles addon numer ' .. outfity.addon .. ' do ' .. outfity.nazwamale .. ' outfit.', TALKTYPE_MONSTER)
doPlayerSetStorageValue(cid, outfity.uniqueid, 1)
else
doPlayerAddOutfit(cid, outfity.outfitfemale, outfity.addon)
doCreatureSay(cid, 'Zdobylas addon numer ' .. outfity.addon .. ' do ' .. outfity.nazwafemale .. ' outfit.', TALKTYPE_MONSTER)
doPlayerSetStorageValue(cid, outfity.uniqueid, 1)
end
else
doCreatureSay(cid, 'Posiadasz juz ' .. outfity.addon .. ' addon do ' .. outfity.nazwamale .. ' outfit.', TALKTYPE_MONSTER)
end
else
-- ERROR --
end
end
return true
end
THANKS!!