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

Winning all addons

JonatasLucas

New Member
Joined
Jun 12, 2013
Messages
116
Reaction score
3
I wanted when the player log into the server he won all addons

excuse if you are in the wrong area
 
Either make an onLogin script to add player outfits + addons, or change the playerFlags to allow players access to all addons.

If it's a quest, check for storageValue in the onLogin script.

Code:
function onLogin(cid)
   if getPlayerStorageValue(cid,45001) < 1 then
      doPlayerAddOutfit(cid, 279, 1)
      doPlayerAddOutfit(cid, 279, 2) -- Server version 0.3.7
      setPlayerStorageValue(cid,45001,1)
   end
return true
end
 
Last edited:
hey buddy i have a script that will give all the addons to the player when he clicks on an x item ;) you can give the item to the player when he logs in no problem and when he uses the item the outfit screen will pop up :) heres the script:
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == IDOFITEM then
doRemoveItem(item.uid,item.type)
if getPlayerStorageValue(cid,525250) == -1 then
doPlayerSetStorageValue(cid,525250,1)
doPlayerAddOutfit(cid,335,2)
doPlayerAddOutfit(cid,335,2)
doPlayerAddOutfit(cid,136,2)
doPlayerAddOutfit(cid,128,2)
doPlayerAddOutfit(cid,128,2)
doPlayerAddOutfit(cid,137,2)
doPlayerAddOutfit(cid,129,2)
doPlayerAddOutfit(cid,138,2)
doPlayerAddOutfit(cid,130,2)
doPlayerAddOutfit(cid,139,2)
doPlayerAddOutfit(cid,131,2)
doPlayerAddOutfit(cid,140,2)
doPlayerAddOutfit(cid,141,2)
doPlayerAddOutfit(cid,133,2)
doPlayerAddOutfit(cid,142,2)
doPlayerAddOutfit(cid,147,2)
doPlayerAddOutfit(cid,146,2)
doPlayerAddOutfit(cid,143,2)
doPlayerAddOutfit(cid,148,2)
doPlayerAddOutfit(cid,144,2)
doPlayerAddOutfit(cid,149,2)
doPlayerAddOutfit(cid,150,2)
doPlayerAddOutfit(cid,145,2)
doPlayerAddOutfit(cid,157,2)
doPlayerAddOutfit(cid,153,2)
doPlayerAddOutfit(cid,158,2)
doPlayerAddOutfit(cid,154,2)
doPlayerAddOutfit(cid,152,2)
doPlayerAddOutfit(cid,156,2)
doPlayerAddOutfit(cid,155,2)
doPlayerAddOutfit(cid,251,2)
doPlayerAddOutfit(cid,252,2)
doPlayerAddOutfit(cid,268,2)
doPlayerAddOutfit(cid,269,2)
doPlayerAddOutfit(cid,270,2)
doPlayerAddOutfit(cid,273,2)
doPlayerAddOutfit(cid,279,2)
doPlayerAddOutfit(cid,278,2)
doPlayerAddOutfit(cid,288,2)
doPlayerAddOutfit(cid,289,2)
doPlayerAddOutfit(cid,324,2)
doPlayerAddOutfit(cid,325,2)
doPlayerAddOutfit(cid,329,2)
doPlayerAddOutfit(cid,366,2)
doPlayerAddOutfit(cid,367,2)
doPlayerAddOutfit(cid,335,1)
doPlayerAddOutfit(cid,335,1)
doPlayerAddOutfit(cid,136,1)
doPlayerAddOutfit(cid,128,1)
doPlayerAddOutfit(cid,128,1)
doPlayerAddOutfit(cid,137,1)
doPlayerAddOutfit(cid,129,1)
doPlayerAddOutfit(cid,138,1)
doPlayerAddOutfit(cid,130,1)
doPlayerAddOutfit(cid,139,1)
doPlayerAddOutfit(cid,131,1)
doPlayerAddOutfit(cid,140,1)
doPlayerAddOutfit(cid,141,1)
doPlayerAddOutfit(cid,133,1)
doPlayerAddOutfit(cid,142,1)
doPlayerAddOutfit(cid,147,1)
doPlayerAddOutfit(cid,146,1)
doPlayerAddOutfit(cid,143,1)
doPlayerAddOutfit(cid,148,1)
doPlayerAddOutfit(cid,144,1)
doPlayerAddOutfit(cid,149,1)
doPlayerAddOutfit(cid,150,1)
doPlayerAddOutfit(cid,145,1)
doPlayerAddOutfit(cid,157,1)
doPlayerAddOutfit(cid,153,1)
doPlayerAddOutfit(cid,158,1)
doPlayerAddOutfit(cid,154,1)
doPlayerAddOutfit(cid,152,1)
doPlayerAddOutfit(cid,156,1)
doPlayerAddOutfit(cid,155,1)
doPlayerAddOutfit(cid,251,1)
doPlayerAddOutfit(cid,252,1)
doPlayerAddOutfit(cid,268,1)
doPlayerAddOutfit(cid,269,1)
doPlayerAddOutfit(cid,270,1)
doPlayerAddOutfit(cid,273,1)
doPlayerAddOutfit(cid,279,1)
doPlayerAddOutfit(cid,278,1)
doPlayerAddOutfit(cid,288,1)
doPlayerAddOutfit(cid,289,1)
doPlayerAddOutfit(cid,324,1)
doPlayerAddOutfit(cid,325,1)
doPlayerAddOutfit(cid,329,1)
doPlayerAddOutfit(cid,366,1)
doPlayerAddOutfit(cid,367,1)
doCreatureSay(cid,"You have received the first & second addons, thanks for playing!",19)
doPlayerSendOutfitWindow(cid)
else
doCreatureSay(cid,"You already got all the addons.",19)
doPlayerAddItem(cid,6527,1)
end
end
return TRUE
end
:D and add this on actions.xml
Code:
  <action itemid="IDOFITEM" event="script" value="addon.lua"/>
enjoy and btw dont judge me xxD im sure thres a way to make this script shorter but im not a pro
 
hey buddy i have a script that will give all the addons to the player when he clicks on an x item ;) you can give the item to the player when he logs in no problem and when he uses the item the outfit screen will pop up :) heres the script:
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == IDOFITEM then
doRemoveItem(item.uid,item.type)
if getPlayerStorageValue(cid,525250) == -1 then
doPlayerSetStorageValue(cid,525250,1)
doPlayerAddOutfit(cid,335,2)
doPlayerAddOutfit(cid,335,2)
doPlayerAddOutfit(cid,136,2)
doPlayerAddOutfit(cid,128,2)
doPlayerAddOutfit(cid,128,2)
doPlayerAddOutfit(cid,137,2)
doPlayerAddOutfit(cid,129,2)
doPlayerAddOutfit(cid,138,2)
doPlayerAddOutfit(cid,130,2)
doPlayerAddOutfit(cid,139,2)
doPlayerAddOutfit(cid,131,2)
doPlayerAddOutfit(cid,140,2)
doPlayerAddOutfit(cid,141,2)
doPlayerAddOutfit(cid,133,2)
doPlayerAddOutfit(cid,142,2)
doPlayerAddOutfit(cid,147,2)
doPlayerAddOutfit(cid,146,2)
doPlayerAddOutfit(cid,143,2)
doPlayerAddOutfit(cid,148,2)
doPlayerAddOutfit(cid,144,2)
doPlayerAddOutfit(cid,149,2)
doPlayerAddOutfit(cid,150,2)
doPlayerAddOutfit(cid,145,2)
doPlayerAddOutfit(cid,157,2)
doPlayerAddOutfit(cid,153,2)
doPlayerAddOutfit(cid,158,2)
doPlayerAddOutfit(cid,154,2)
doPlayerAddOutfit(cid,152,2)
doPlayerAddOutfit(cid,156,2)
doPlayerAddOutfit(cid,155,2)
doPlayerAddOutfit(cid,251,2)
doPlayerAddOutfit(cid,252,2)
doPlayerAddOutfit(cid,268,2)
doPlayerAddOutfit(cid,269,2)
doPlayerAddOutfit(cid,270,2)
doPlayerAddOutfit(cid,273,2)
doPlayerAddOutfit(cid,279,2)
doPlayerAddOutfit(cid,278,2)
doPlayerAddOutfit(cid,288,2)
doPlayerAddOutfit(cid,289,2)
doPlayerAddOutfit(cid,324,2)
doPlayerAddOutfit(cid,325,2)
doPlayerAddOutfit(cid,329,2)
doPlayerAddOutfit(cid,366,2)
doPlayerAddOutfit(cid,367,2)
doPlayerAddOutfit(cid,335,1)
doPlayerAddOutfit(cid,335,1)
doPlayerAddOutfit(cid,136,1)
doPlayerAddOutfit(cid,128,1)
doPlayerAddOutfit(cid,128,1)
doPlayerAddOutfit(cid,137,1)
doPlayerAddOutfit(cid,129,1)
doPlayerAddOutfit(cid,138,1)
doPlayerAddOutfit(cid,130,1)
doPlayerAddOutfit(cid,139,1)
doPlayerAddOutfit(cid,131,1)
doPlayerAddOutfit(cid,140,1)
doPlayerAddOutfit(cid,141,1)
doPlayerAddOutfit(cid,133,1)
doPlayerAddOutfit(cid,142,1)
doPlayerAddOutfit(cid,147,1)
doPlayerAddOutfit(cid,146,1)
doPlayerAddOutfit(cid,143,1)
doPlayerAddOutfit(cid,148,1)
doPlayerAddOutfit(cid,144,1)
doPlayerAddOutfit(cid,149,1)
doPlayerAddOutfit(cid,150,1)
doPlayerAddOutfit(cid,145,1)
doPlayerAddOutfit(cid,157,1)
doPlayerAddOutfit(cid,153,1)
doPlayerAddOutfit(cid,158,1)
doPlayerAddOutfit(cid,154,1)
doPlayerAddOutfit(cid,152,1)
doPlayerAddOutfit(cid,156,1)
doPlayerAddOutfit(cid,155,1)
doPlayerAddOutfit(cid,251,1)
doPlayerAddOutfit(cid,252,1)
doPlayerAddOutfit(cid,268,1)
doPlayerAddOutfit(cid,269,1)
doPlayerAddOutfit(cid,270,1)
doPlayerAddOutfit(cid,273,1)
doPlayerAddOutfit(cid,279,1)
doPlayerAddOutfit(cid,278,1)
doPlayerAddOutfit(cid,288,1)
doPlayerAddOutfit(cid,289,1)
doPlayerAddOutfit(cid,324,1)
doPlayerAddOutfit(cid,325,1)
doPlayerAddOutfit(cid,329,1)
doPlayerAddOutfit(cid,366,1)
doPlayerAddOutfit(cid,367,1)
doCreatureSay(cid,"You have received the first & second addons, thanks for playing!",19)
doPlayerSendOutfitWindow(cid)
else
doCreatureSay(cid,"You already got all the addons.",19)
doPlayerAddItem(cid,6527,1)
end
end
return TRUE
end
:D and add this on actions.xml
Code:
  <action itemid="IDOFITEM" event="script" value="addon.lua"/>
enjoy and btw dont judge me xxD im sure thres a way to make this script shorter but im not a pro
I'm sure I missed some outfits, but you can easily add any I missed.
(I have it giving addon's for both genders to avoid issues in the future if/when they change gender)
Code:
<action itemid="111111111111" event="script" value="addon.lua"/>
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
   -- citizen, hunter, mage, knight, nobleman, summoner, warrior, barbarian, druid, wizard, oriental, pirate,
   -- assassin, beggar, shaman, norsewoman, nightmare, jester, brotherhood, demonhunter, yalaharian,- warmaster.
   local femaleOutfits = {136, 137, 138, 139, 140, 141, 142, 147, 148, 149, 150, 155, 156, 157, 158, 252, 269, 270, 279, 288, 324, 335}
   local maleOutfits = {128, 129, 130, 131, 132, 133, 134, 143, 144, 145, 146, 151, 152, 153, 154, 251, 268, 273, 278, 289, 325, 336}
   local storage = 525250

   if getPlayerStorageValue(cid,storage) == -1 then
     doRemoveItem(item.uid,item.type)
     doPlayerSetStorageValue(cid,storage,1)
     for _,f in ipairs(femaleOutfits) do
       doPlayerAddOutfit(cid, f, 3)
     end
     for _,m in ipairs(maleOutfits) do
       doPlayerAddOutfit(cid, m, 3)
     end
     doCreatureSay(cid,"You have received the first & second addons. Thanks for playing!",19)
     doPlayerSendOutfitWindow(cid)
   else
     doCreatureSay(cid,"You have already received all the addons.",19)
   end
   return true
end
 
Last edited:
Wouldn't it be easier to set those addons into vocation examples and then anytime you create an character you gain those addons?

Won't work if you want to gift addons to players in certain time, like for a day or so etc.

Depends on what do you require.
 
Wouldn't it be easier to set those addons into vocation examples and then anytime you create an character you gain those addons?

Won't work if you want to gift addons to players in certain time, like for a day or so etc.

Depends on what do you require.
Of course it does. There are always multiple ways to do things.
If it were for a day or a couple of days, you'd simply need to add a few more lines of code.
But for OP's purposes I think this is all he was looking for.
On the other hand, I was simply showing @Cris2387 how the code could look like if loops + tables were used.
Plus he had some janky work around because the item was being consumed everytime, so he re-added the item later in the script.
 
Of course it does. There are always multiple ways to do things.
If it were for a day or a couple of days, you'd simply need to add a few more lines of code.
But for OP's purposes I think this is all he was looking for.
On the other hand, I was simply showing @Cris2387 how the code could look like if loops + tables were used.
Plus he had some janky work around because the item was being consumed everytime, so he re-added the item later in the script.

Didn't say you aren't right, just saying a way to do it too, depending on his requirements.
If he doesn't want to mess with some scripts but he wants free addons since character creation then it's the easiest way.
 
Back
Top