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

Action Minimap locations

GhostX

Mapping Board Moderator
Staff member
Board Moderator
Joined
Nov 2, 2011
Messages
6,049
Reaction score
1,802
Location
UK
Twitch
ghostxpr0
Okay, so this is my first serious script i have ever made.

It's function: When you use "x" item (i use the hangable minimap or the writable map) You receive x marks/locations on your minimap.

Insert this into actions -> scripts -> chosen location

Lua:
  --[[ Script by Ghostx... 
  Use a map recieve map marks/locations on minimap
  Any issues and/or questions do contact me on otland.
]]--
 function onUse(cid, item, fromPosition, itemEx, toPosition)
 
 local Mark = {
  [1]={{x=0000,y=0000,z=7},"name",MAPMARK_TEMPLE}, -- Edit the locations to the position to mark
  [2]={{x=0000,y=0000,z=7},"name",MAPMARK_LOCK},  -- Where it says 'name' change it to the place
  [3]={{x=0000,y=0000,z=7},"name",MAPMARK_SWORD},  -- You can change the icon after the mapmark_
  [4]={{x=0000,y=0000,z=7},"name",MAPMARK_STAR},  -- You can add or reduce locations just by
  [5]={{x=0000,y=0000,z=7},"name",MAPMARK_FLAG},  -- adding/deleteing a line
  [6]={{x=0000,y=0000,z=7},"name",MAPMARK_TICK},  -- Make sure to follow the [1], [2] order rule.
  [7]={{x=0000,y=0000,z=7},"name",MAPMARK_REDWEST},
  [8]={{x=0000,y=0000,z=7},"name",MAPMARK_BAG}
}
  for i = 1, #mark do
            doPlayerAddMark(cid, Mark[i][1], Mark[i][3], Mark[i][2]) 
     end
  doPlayerSendTextMessage(cid, 21, "You now have locations marked on your map")
 return true
end


if you're using 0.2, use this function instead:
Lua:
doAddMapMark(cid, pos, type, <optional> description)



Useful information -> Different marks you can add for the icons
XML:
MAPMARK_TICK
MAPMARK_QUESTION
MAPMARK_EXCLAMATION
MAPMARK_STAR
MAPMARK_CROSS
MAPMARK_TEMPLE
MAPMARK_KISS
MAPMARK_SHOVEL
MAPMARK_SWORD
MAPMARK_FLAG
MAPMARK_LOCK
MAPMARK_BAG
MAPMARK_SKULL
MAPMARK_DOLLAR
MAPMARK_REDNORTH
MAPMARK_REDSOUTH
MAPMARK_REDEAST
MAPMARK_REDWEST
MAPMARK_GREENNORTH
MAPMARK_GREENSOUTH

You could probably edit it like this in order to make it compatible to both 0.2 and 0.3.
Also, you should use constants instead of 21 in text message.

Lua:
 --[[ Script by Ghostx... 
    Use a map recieve map marks/locations on minimap
    Any issues and/or questions do contact me on otland.
]]--

local marks = {
    [1]={{x=0000,y=0000,z=7}, "name", MAPMARK_TEMPLE}, -- Edit the locations to the position to mark
    [2]={{x=0000,y=0000,z=7}, "name", MAPMARK_LOCK}, -- Where it says 'name' change it to the place
    [3]={{x=0000,y=0000,z=7}, "name", MAPMARK_SWORD}, -- You can change the icon after the mapmark_
    [4]={{x=0000,y=0000,z=7}, "name", MAPMARK_STAR}, -- You can add or reduce locations just by
    [5]={{x=0000,y=0000,z=7}, "name", MAPMARK_FLAG}, -- adding/deleteing a line
    [6]={{x=0000,y=0000,z=7}, "name", MAPMARK_TICK}, -- Make sure to follow the [1], [2] order rule.
    [7]={{x=0000,y=0000,z=7}, "name", MAPMARK_REDWEST},
    [8]={{x=0000,y=0000,z=7}, "name", MAPMARK_BAG}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    for i = 1, #marks do
        if doAddMapMark then
            doAddMapMark(cid, marks[i][1], marks[i][3], marks[i][2])
        else
            doPlayerAddMark(cid, marks[i][1], marks[i][3], marks[i][2]) 
        end
    end
    doPlayerSendTextMessage(cid, 21, "You now have locations marked on your map")
    return true
end


Regards
 
Last edited:
Very nice!

Remember, if you're using 0.2, use this function instead:
Lua:
doAddMapMark(cid, pos, type, <optional> description)
 
Thanks guys, main reason why i am learning scripting is because it seems the only true way to provide "support". feedback to improve maps/sprites is purely subjective of the judging member. Scripting is generally a definate article, it is useful or it isn't.

Hopefully in the future when i am experienced i can provide script-wise support. I guess it's also a handy skill to learn in real life.

If anyone wishes to learn, check out lua.org (recommended to me by Fallen), aswell as otland tutorials to learn tibia's functions.
 
@Wavoz and your point is?

@Thread This script would be even better if you have made it an onLogin for newcomers to help them find places... However, A+ for learning scripting in 1 day and making this same day.
 
@Wavoz and your point is?

He had some trouble getting it to work earlier and i was trying to help him.

Btw now that it is working u can make it bit more advanced and make it usable only for once.
 
you should take out "doPlayerSendTextMessage(cid,21,"You now have locations marked on your map")" from the loop
other than that great work ;)
 
Last edited:
Wavoz, if it worked once and player removed marks and wanted back another day, he couldnt.. So i chose to directly make it looped each time. If you get me..

I only make scripts i need atm. So yh :) i'll release all i make tho


Thanks for feedback
 
Take the message from the loop.
Looks good :)
 
@Wavoz and your point is?

@Thread This script would be even better if you have made it an onLogin for newcomers to help them find places... However, A+ for learning scripting in 1 day and making this same day.
Lua:
function onLogin(cid)
 
 local Mark = {
  [1]={{x=1000,y=1000,z=7},"Temple",MAPMARK_TEMPLE}, -- Edit the locations to the position to mark
}
  for i = 1, #mark do
            doPlayerAddMark(cid, Mark[i][1], Mark[i][3], Mark[i][2]) 
     end
  doPlayerSendTextMessage(cid, 21, "Temple way is located on your map!")
 return true
end
would this work?
and add some storage to check if he got x storage, if he have x storage then it doesnt show ?
 
Back
Top