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

First Login

renancs

New Member
Joined
Jul 8, 2008
Messages
252
Reaction score
3
Well, i already see this one server...
When the player have login your first time, go open one ''letter'' or other thing with one text written,
normally one tutorial of first steps on the ot...

Thanks,
repp..
 
That when a character is created, it comes with a letter saying "WELCOME TO X OT MISTER [NAME] in this letter u will find out how to blablablabla"
 
no tested!
put it:
Lua:
local c = {
	text = "WELCOME TO X OT MISTER [NAME] in this letter u will find out how to blablablabla",
	writer = "Arnold",
	date = os.date("%d/%m/%Y %H:%M:%S")
	}
	item = doCreateItemEx(2598, 1)
	doSetItemText(item.uid, c.text, c.writer, c.date)
	doPlayerAddItemEx(cid, item, true)

in mods/firstitems.xml

or in creaturescripts/scripts/login.lua but here with if storage 1111 < 1 than ... else..

is it you want?
 
help-me, i add on firstitems and not give itens and not msg, no erro.

my firstitems

PHP:
  local commonItems = {
  -- ITEMS ALL VOCS RECEIVE
  {itemid=2120, count=1}, -- rope
  {itemid=2789, count=100}, -- brown mushrooms
  {itemid=2305, count=1}, -- fire bomb rune
  {itemid=2261, count=1}, -- destroy field rune
  {itemid=2274, count=1}, -- avalanche rune
}

local firstItems = {
  { -- SORC ITEMS
    {itemid=2323, count=1}, -- hat of the mad
    {itemid=8871, count=1}, -- focus cape
    {itemid=7730, count=1}, -- blue legs
    {itemid=2195, count=1}, -- boots of haste
    {itemid=8902, count=1}, -- spellbook of mind control
    {itemid=2187, count=1}, -- wand of inferno  

    {itemid=2268, count=1}, -- sd
    {itemid=2273, count=1}, -- uh
    {itemid=7590, count=1}, -- gmp
    {itemid=2293, count=1}, -- mw
  },
  { -- DRUID ITEMS
    {itemid=2323, count=1}, -- hat of the mad
    {itemid=8871, count=1}, -- focus cape
    {itemid=7730, count=1}, -- blue legs
    {itemid=2195, count=1}, -- boots of haste
    {itemid=8902, count=1}, -- spellbook of mind control
    {itemid=2183, count=1}, -- hailstorm rod  

    {itemid=2268, count=1}, -- sd
    {itemid=2273, count=1}, -- uh
    {itemid=7590, count=1}, -- gmp
    {itemid=2293, count=1}, -- mw
    {itemid=2269, count=1}, -- wg
    {itemid=2278, count=1}, -- para
  },
  { -- PALADIN ITEMS
    {itemid=2493, count=1}, -- demon helmet
    {itemid=8891, count=1}, -- paladin armor
    {itemid=7730, count=1}, -- blue legs
    {itemid=2195, count=1}, -- boots of haste
    {itemid=2514, count=1}, -- mastermind shield
    {itemid=7368, count=10}, -- assassin stars

    {itemid=2268, count=1}, -- sd
    {itemid=2273, count=1}, -- uh
    {itemid=8472, count=1}, -- gsp
    {itemid=7589, count=1}, -- smp
    {itemid=7588, count=1}, -- shp
    {itemid=2293, count=1}, -- mw
  },
  { -- KNIGHT ITEMS
    {itemid=2493, count=1}, -- demon helmet
    {itemid=2472, count=1}, -- magic plate armor
    {itemid=2470, count=1}, -- golden legs
    {itemid=2195, count=1}, -- boots of haste
    {itemid=2514, count=1}, -- mastermind shield

    {itemid=2400, count=1}, -- magic sword
    {itemid=2431, count=1}, -- Stonecutter Axe
    {itemid=7620, count=1}, -- mp
    {itemid=8473, count=1}, -- uhp
    {itemid=2313, count=1}, -- explosion
    {itemid=2293, count=1}, -- mw
  }
}

for _, items in ipairs(firstItems) do
  for _, item in ipairs(commonItems) do
    table.insert(items, item)
  end
end

function onLogin(cid)
  if getPlayerGroupId(cid) < 2 then
    local hasReceivedFirstItems = getPlayerStorageValue(cid, 67708)

    if hasReceivedFirstItems == -1 then
      --[[local backpack = ]]doPlayerAddItem(cid, 1988, 1)

      local giveItems = firstItems[getPlayerVocation(cid)]

      if giveItems ~= nil then
        for _, v in ipairs(giveItems) do
          --doAddContainerItem(backpack, v.itemid, v.count or 1)
          doPlayerAddItem(cid, v.itemid, v.count or 1)
        end

        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have recieved your equipment")
        setPlayerStorageValue(cid, 67708, 1)  
      end
    end
  end
  return TRUE
end
 
Lua:
-- ver. 2 2011-12-01
-- author tfs, otland.net/members/andypsylon :)
-- with a welcome letter

local commonItems = { -- ITEMS ALL VOCS
	{2120}, -- rope
	{2789, 100}, -- brown mushrooms
	{2305}, -- fire bomb rune
	{2261}, -- destroy field rune
	{2274} -- avalanche rune
}
local firstItems = {
	{ -- SORC ITEMS
		{2323}, -- hat of the mad
		{8871}, -- focus cape
		{7730}, -- blue legs
		{2195}, -- boots of haste
		{8902}, -- spellbook of mind control
		{2187}, -- wand of inferno  

		{2268}, -- sd
		{2273}, -- uh
		{7590}, -- gmp
		{2293} -- mw
	},
	{ -- DRUID ITEMS
		{2323}, -- hat of the mad
		{8871}, -- focus cape
		{7730}, -- blue legs
		{2195}, -- boots of haste
		{8902}, -- spellbook of mind control
		{2183}, -- hailstorm rod  

		{2268}, -- sd
		{2273}, -- uh
		{7590}, -- gmp
		{2293}, -- mw
		{2269}, -- wg
		{2278} -- para
	},
	{ -- PALADIN ITEMS
		{2493}, -- demon helmet
		{8891}, -- paladin armor
		{7730}, -- blue legs
		{2195}, -- boots of haste
		{2514}, -- mastermind shield
		{7368, 10}, -- assassin stars

		{2268}, -- sd
		{2273}, -- uh
		{8472}, -- gsp
		{7589}, -- smp
		{7588}, -- shp
		{2293} -- mw
	},
	{ -- KNIGHT ITEMS
		{2493}, -- demon helmet
		{2472}, -- magic plate armor
		{2470}, -- golden legs
		{2195}, -- boots of haste
		{2514}, -- mastermind shield

		{2400}, -- magic sword
		{2431}, -- Stonecutter Axe
		{7620}, -- mp
		{8473}, -- uhp
		{2313}, -- explosion
		{2293} -- mw
	}
}

for _, fitems in ipairs(firstItems) do
	for _, citems in ipairs(commonItems) do
		table.insert(fitems, citems)
	end
end

function onLogin(cid)
	if getPlayerGroupId(cid) < 2 then
		local hasReceivedFirstItems = getPlayerStorageValue(cid, 30001)

		if hasReceivedFirstItems == -1 then
			-- letter
			local c = { 
				text = "WELCOME TO X OT MISTER ".. getPlayerName(cid) .." in this letter u will find out how to blablablabla", 
				writer = "Andy", 
				date = os.time() 
			} 
			local item = doCreateItemEx(2598, 1) 
			doSetItemText(item, c.text, c.writer, c.date) 
			doPlayerAddItemEx(cid, item, true)
			--/letter

			local backpack = doPlayerAddItem(cid, 2000, 1)
			local giveItems = firstItems[getPlayerVocation(cid)]

			if giveItems ~= nil then
				for _, v in ipairs(giveItems) do
					doAddContainerItem(backpack, v[1], v[2] or 1)
				end
			end

			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have recieved your first equipment")
			setPlayerStorageValue(cid, 30001, 1)  
		end
	end
	return true
end
 
Last edited:
not msg,
here msg
PHP:
local c = {
	text = "WELCOME TO X OT MISTER [NAME] in this letter u will find out how to blablablabla",
	writer = "Arnold",
	date = os.date("%d/%m/%Y %H:%M:%S")
	}
	item = doCreateItemEx(2598, 1)
	doSetItemText(item.uid, c.text, c.writer, c.date)
	doPlayerAddItemEx(cid, item, true)
 
add script on my firstitems man
PHP:
local c = {
	text = "WELCOME TO X OT MISTER [NAME] in this letter u will find out how to blablablabla",
	writer = "Arnold",
	date = os.date("%d/%m/%Y %H:%M:%S")
	}
	item = doCreateItemEx(2598, 1)
	doSetItemText(item.uid, c.text, c.writer, c.date)
	doPlayerAddItemEx(cid, item, true)
on my firstitems, not erro, not give itens
 
I am using in creaturescripts but not working

PHP:
function onLogin(cid)
	if(getPlayerLastLoginSaved(cid) == 0) then
		local c = { 
    			text = "WELCOME TO X OT MISTER [NAME] in this letter u will find out how to blablablabla", 
    			writer = "Arnold", 
    			date = os.date("%d/%m/%Y %H:%M:%S") 
    		} 
    		item = doCreateItemEx(2598, 1) 
    		doSetItemText(item.uid, c.text, c.writer, c.date) 
   		doPlayerAddItemEx(cid, item, true)
	end
	return true
end
 
Back
Top