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

Updated - Overall - FAQ

mayel

New Member
Joined
Sep 11, 2009
Messages
174
Reaction score
2
Location
Stockholm, Sweden
Hello, this is a post made to answer the most FAQ(frequently asked questions).
The FAQ's is in a strange order, I know.

Q: I can not download rar files, why? It says only find, not run or save.
A: You need a rar-archiver, download winrar.

Q: The temple position is wrong, how do i solve it?
A: Change the posx, posy and posz BOTH in config.lua and in your database(In the players table, edit the account managers pos.)

Q: I'm getting errors when importing schema.mysql, what's wrong?
A: Well, all servers doesn't have the same names for their mysql file. But look for the extension .mysql in any file you see and try.

Q: But i can not even see my server when I'm trying to import the file.
A: You need to extract all the files first, in winrar just click on the button "Extract to" and press "Ok".

Q:I can join my server, but my friend can't, why?
A: Commonly because your ports 7171 and 7172 aren't opened. Or that you are using your local ip. Open ports either directly in your router or at portforward.com(Not going into details)

Q:When i have changed alot of stuffs in config.lua, the server crashes, why?
A: I don't know, but i do know how to prevent it. First of all, always keep an updated backup-copy of your server just in case. Secondly don't change to much at once on your files. And third, use notepad++ and save occasionally(now and then).

Q:How do I create a manarune?
A: You need to change in items.xml and in spells.xml. Choose an available "spell rune"(ctrl+f to find one) in items.xml, change name and stuff you prefer. In spells.xml copy i.e the ultimate healing rune script and change name, id and script=healing/manarune.lua(and other stuff you prefer).
Then in the scripts folder/healing, copy ultimate healing rune and rename to manarune and take a script from somewhere on the internet.

Q: How do I make a container quest in RME? Experience door?
A: Place the quest container (RAW pallete/interior) on a satisfied tile(lol ;P). Right-click and assign the aid to 2000 and the uid to something unique i.e 1001(Keep in mind that the uid can't be the same as prior quests.) and add an item. Experience door - assign aid to lvl+1000(50 leveled experience door will the be 1050)

Q: The newest RME can't locate to tibia.spr and .dat, why?
A: Dunno, but choose the prior version of RME. That's the only way I've solved it.

Q: LUA: Why doesn't the onStepIn() work for me? It says that the function onUse isn't found.
A: You need to have one thing cleared, use actions(onUse) is for action.xml, movements(onStepIn) is for movements.xml, server stuff(onThink) is for creaturescripts.xml and talkactions(onSay) is for talkactions.xml. If errors occurs though, just try one of these and it'll probably work. Globalevents is also one. And for some reason onAddItem is on movements. So, just try and see that's what i've done.

Q: When using doSendAnimatedText(pos, text, num), the message can't be longer than a certain amount of characters, why?
A: Dunno, but use this instead: doCreatureSay(cid, "blablablablablablablablabla", TALKTYPE_ORANGE_1).

Q: How do i make a GOD character?
A: In your database choose the players table and edit the character you want to set to be a GOD. Change the group_id to 6 (On tfs 0.3.6p1) else try 3.

Q: How do i delete i.e a pz zone in RME?
A: Hold CTRL while "editing" the pz zone instead of, well not holding CTRL.

HOW TO MAKE A SIMPLE SCRIPT
Ok, your first script...
In RME(Remers map editor) assign any item(any) to the action id 5000.
Then go to actions.xml in your server and paste this:
<action actionid="5000" event="script" value="quests/any-name.lua"/>
Then create the lua file "any-name.lua"
TIP: Copy any lua file from there and paste it and then rename it. I.e "system.lua" will be "system.lua - Copy".(Though keep in mind that the file will already have the extension .lua so only name it "any-name" otherwise it will crash or the name will be "any-name.lua.lua" take a look on how the others appear. I'm using windows 7 on a extracted file, not in winrar. If the name on "system.lua" is named "system.lua" then use the extension. It's all about copying and pasting and look for possible configurations. Though on windows 7, you can see that it says "LUA file" a bit to the left of the file.)
Then use this code in "any-name.lua":
function onUse(cid, item, fromPosition, itemEx, toPosition)
doSendAnimatedText(getCreaturePosition(cid), "ItWorked", 180)
doSendMagicEffect(getCreaturePosition(cid), 13)
end
PLEASE DON'T BLAME ME IF I DID A LITTLE SEVERE MISTAKE, INFORM ME OF THE PROBLEM AND I WILL FIX THE CODE, OK?
AND BTW, THE doSendAnimatedText() DOESN'T WORK WITH LONGER WORDS.

HOW TO USE STORAGE VALUES
Storage values is very good to use for players.
I.e when you've completed a "chest-quest" the "It is empty" appears because of that it is stored that you have done the quest.
You are using two functions mainly:
setPlayerStorageValue(cid, 2500, 1)
getPlayerItemCount(cid, 2500)
The first function sets the storage value the second one checks the storage value. Note that the storage is stored only on that player and not on the whole account.
Now, we don't have to care about the first parameter "cid", but the second is the key for the storage. Which means that you can store multiple storages. And the third parameter is the value.
By defualt the storage value is -1, but when assigning the storage of 2500 to 1, the storage with the key of 2500 now has the value of 1(with a prior of -1).
How can we use this, well if you in a function sets the storage key of 2500 to 1 by using setPlayerStorageValue(cid, 2500, 1), another script can now see if you have executed that script before by checking if the key 2500 is -1 or 1.
You can set any value as a value but for boolean purposes, -1 and 1 is good.(True or false)
Now the key of 2500 has the value of 1, but the key of 2501 has value of -1. Do you get it? Storages also updates super fast, which means that u could use the storage u set in a script, and check the same storage in the SAME SCRIPT!!(Very useful when adding 1 value each time you press a stone or something) FOR INSTANCE!:
setPlayerStorageValue(cid, 2500, getPlayerItemCount(cid, 2500) + 1)
This will add 1 each time you press the stone.
And with the super fast update, you can check if the value has reached 10, so when updating the storage, if the storage become 10 the new script will execute with the if statement in the same script.
It's also very common to use time in that kind of function with os.time().
os.time() adds 1 second to it's value each second. So if you set the player storage to the current os.time() and later on subtracting that from the new current time, you can see how many seconds it is between them!
I.e
setPlayerStorageValue(cid, 2500, os.time())
And in a new script:
local seconds = os.time() - getPlayerItemCount(cid, 2500)
if seconds > 60 then
doCreatureSay(cid, "More than 1 minute has past, since you executed the script that set the storage value", TALKTYPE_ORANGE_1)
(I don't know if it can be that long, though.)
else doCreatureSay(cid, "1 minute hasn't passed since you executed the script that set your timestamp", TALKTYPE_ORANGE_1)
end
PLEASE DON'T BLAME ME IF I DID A LITTLE SEVERE MISTAKE, INFORM ME OF THE PROBLEM AND I WILL FIX THE CODE, OK?

:thumbup:
Will keep editing as long as i find something out.
Please comments if there is something else you want to know, and I'll try to answer.
Please rep++ or comment if you like this thread so far. :)
 
Back
Top