• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

What im doing worng? Variable lists

maikons

Member
Joined
Aug 1, 2015
Messages
227
Reaction score
17
Code:
function onSay(cid, words, param)
local outfits = {
   ["pirate"]={40000},{50000},
   ["assassin"]={40001},{50001},
   ["beggar"]={40002},{50002},
   ["shaman"]={40003},{50003},
   ["norsewoman"]={40004},{50004},
   ["norseman"]={40004},{50004},
   ["nightmare"]={40005},{50005},
   ["jester"]={40006},{50006},
   ["brotherhood"]={40007},{50007},
   ["demonhunter"]={40008},{50008},
   ["yalaharian"]={40009},{50009}
}
local msg = {"Digite o nome correto!", "Voce não possui Addon Doll!", "Bad param!", "Você recebeu seu outifit!"}
local param = string.lower(param)
if (not isPremium(cid)) then
   doPlayerSendCancel(cid, "You need VIP to use this command!")
   return TRUE
end
if(getPlayerItemCount(cid, 8982) > 0) then
if(param ~= "" and outfits[param]) then
   doPlayerRemoveItem(cid, 8982, 1)
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg[4])
   doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
   setPlayerStorageValue(cid, outfits[param][1], 1)
   setPlayerStorageValue(cid, outfits[param][2], 1)
else
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg[1])
end
else
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg[2])
end
end

Code:
function onSay(cid, words, param)
local femaleOutfits = {
   ["citizen"]={136},{1},
   ["hunter"]={137},{2},
   ["mage"]={138},{3},
   ["knight"]={139},{2},
   ["nobleman"]={140},{1},
   ["summoner"]={141},{2},
   ["warrior"]={142},{3},
   ["barbarian"]={147},{2},
   ["druid"]={148},{2},{2},
   ["wizard"]={149},{2},
   ["oriental"]={150},{1},
   ["pirate"]={155},{1},
   ["assassin"]={156},{3},
   ["beggar"]={157},{1},
   ["shaman"]={158},{3},
   ["norsewoman"]={252},{1},
   ["nightmare"]={269},{2},
   ["jester"]={270},{1},
   ["brotherhood"]={279},{2},
   ["demonhunter"]={288},{1},
   ["yalaharian"]={324},{3},
   ["warmaster"]={335},{3}
}
local maleOutfits = {
   ["citizen"]={128},{1},
   ["hunter"]={129},{2},
   ["mage"]={130},{3},
   ["knight"]={131},{2},
   ["nobleman"]={132},{1},
   ["summoner"]={133},{2},
   ["warrior"]={134},{3},
   ["barbarian"]={143},{2},
   ["druid"]={144},{2},
   ["wizard"]={145},{2},
   ["oriental"]={146},{1},
   ["pirate"]={151},{1},
   ["assassin"]={152},{3},
   ["beggar"]={153},{1},
   ["shaman"]={154},{3},
   ["norsewoman"]={251},{1},
   ["nightmare"]={268},{2},
   ["jester"]={273},{1},
   ["brotherhood"]={278},{2},
   ["demonhunter"]={289},{1},
   ["yalaharian"]={325},{3},
   ["warmaster"]={336},{3}
}
local msg = {"Digite o nome correto!", "Voce não possui Addon Doll!", "Bad param!", "Você recebeu seu addons!"}
local param = string.lower(param)
if (not isPremium(cid)) then
   doPlayerSendCancel(cid, "You need VIP to use this command!")
   return TRUE
end
if(getPlayerItemCount(cid, 9693) > 0) then
if(param ~= "" and maleOutfits[param] and femaleOutfits[param]) then
   if(getPlayerSex(cid) == 0)then
     if(getPlayerItemCount(cid, 9693) < femaleOutfits[param][2]) then
       doShowTextDialog(cid, 2175, "Addon Dolls table per outfit\n\nCitizen: 1\nHunter: 2\nMage: 3\nKnight: 2\nNobleman: 1\nSummoner: 2\nWarrior: 3\nBarbarian: 2\nDruid: 2\nWizard: 2\nOriental: 1\nPirate: 1\nAssassin: 3\nBeggar: 1\nShaman: 3\nNorseman/norsewoman: 1\nNightmare: 2\nJester: 1\nBrotherhood: 2\nDemonhunter: 1\nYalaharian: 3\nWarmaster: 3")
       return true
     end
   else
     if(getPlayerItemCount(cid, 9693) < maleOutfits[param][2]) then
       doShowTextDialog(cid, 2175, "Addon Dolls table per outfit\n\nCitizen: 1\nHunter: 2\nMage: 3\nKnight: 2\nNobleman: 1\nSummoner: 2\nWarrior: 3\nBarbarian: 2\nDruid: 2\nWizard: 2\nOriental: 1\nPirate: 1\nAssassin: 3\nBeggar: 1\nShaman: 3\nNorseman/norsewoman: 1\nNightmare: 2\nJester: 1\nBrotherhood: 2\nDemonhunter: 1\nYalaharian: 3\nWarmaster: 3")
       return true
     end
   end
   doPlayerRemoveItem(cid, 9693, 1)
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg[4])
   doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
   if(getPlayerSex(cid) == 0)then
     doPlayerAddOutfit(cid, femaleOutfits[param][1], 3)
   else
     doPlayerAddOutfit(cid, maleOutfits[param][1], 3)
   end
else
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg[1])
end
else
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg[2])
end
end
 
"["pirate"]={40000},{50000},"
That's the same as:
Code:
["pirate"]={40000},
[1] = {50000},

You should use:
"["pirate"]={40000, 50000},"
 
Back
Top