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

Exclusive access to cave (with time) - TFS 1.x

tev

Banned User
Joined
Apr 19, 2013
Messages
113
Reaction score
6
* Player 1 use X item.
** He got exclusive access to hunt in Y cave for 24 hours.
*** Only he can enter this Y cave.

If another player 2 use X item, he will have exclusive access to hunt in Z cave (another cave) for 24 hours.
Only player 2 can enter this Z cave.

If caves are occupied, appears a message: "You can't use this now. Try again later!"
When the 24h it's over, you will got teleported to temple.

Sorry if I wrote something wrong, try to understand, please :(
 
You will need to write 2 scripts, an action and a movement script for this, you will also need a storage value.. good luck :)
 
It's a request and not a support session but thank you
I know which forum I am in, just because it is requests, it doesn't mean I need to provide a script, giving a hint on how something can be accomplished is still providing a possible solution to a request. :)
 
You will need to write 2 scripts, an action and a movement script for this, you will also need a storage value.. good luck :)
Wont you need anything more? I mean, so the player just not can logout in the cave before hes time ends, idk, a login check?
 
Wont you need anything more? I mean, so the player just not can logout in the cave before hes time ends, idk, a login check?
Sure, i was providing a foundation :)
I think its better to give people a starting point rather a full layout, start small, get that working and then add in more functionality.
 
No you don't, but it will be easier to design dungeon if you do.
So, how do you solve that? If a player logout before hes time end, and then login again after. A addevent would have been canceled already?
 
Dunno if something similar to
Code:
 function onLogout(cid)
exists on tfs 1.x, but you could definitely make use of that in one way or another. At least that's my initial thought
 
Dunno if something similar to
Code:
 function onLogout(cid)
exists on tfs 1.x, but you could definitely make use of that in one way or another. At least that's my initial thought
Ye, but that isn't either a action or a movement, right?
 
Ye, but that isn't either a action or a movement, right?
ah, foolish me. Perhaps if you could store the time and/or put the person in a different place if you logout inside. Not sure how it'd be done exactly, but that's my theory. And I'm pretty sure you can still make use of the onLogout function, e.g if you're within an area and you logout, your time left is stored and you're teleported to some safe spot?
 
So, how do you solve that? If a player logout before hes time end, and then login again after. A addevent would have been canceled already?
When player logs back in he has different creature id. you compare dungeon location with player position when he moves (and if I'm not wrong, even logging in is considered as moving)

However I still think registering the function trough login.lua is more effective when it comes down the logic where should what happen.
 
When player logs back in he has different creature id. you compare dungeon location with player position when he moves (and if I'm not wrong, even logging in is considered as moving)

However I still think registering the function trough login.lua is more effective when it comes down the logic where should what happen.
Even if you check every move the player does you still will need a third script I think. How do you even track a players every move?
A short question, how do you track & compare the positions in one of the 2 scripts.
 
Even if you check every move the player does you still will need a third script I think. How do you even track a players every move?
A short question, how do you track & compare the positions in one of the 2 scripts.
Like I said. when player logs in if I'm not wrong the placement of putting character down is already a movement.

movement script got executed.
if not isInDungeonArea(playerPos) then return end
if not isInDungeon(pid) then return kickPlayerFromDungeon(player) end

to register movements script, write itemAID/ID or UID to movements.xml (i suggest AID)
 
Like I said. when player logs in if I'm not wrong the placement of putting character down is already a movement.

movement script got executed.
if not isInDungeonArea(playerPos) then return end
if not isInDungeon(pid) then return kickPlayerFromDungeon(player) end

to register movements script, write itemAID/ID or UID to movements.xml (i suggest AID)
That will require a AID/UID to every tile in the dungeon?
 
Good to see people debating solutions rather than just providing, of course the op should also be involved as well, planning is one of the most important aspect of writing a script.
 
isnt just better an storage and a time checker (also a player checker)? onlogin, onlogout, onstepin, onuse
We know how to do it properly, was just curious how it had to be done if you was gonna do it with those 2 scripts only, and not a third, wich should be the onlogin check.
 
We know how to do it properly, was just curious how it had to be done if you was gonna do it with those 2 scripts only, and not a third, wich should be the onlogin check.
maybe onlogin and onthink just to check the position of the player and if he's inside the pit, i dont really know (2 early 2 be high)
 
Back
Top