• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

[Advanced] Training System with anti-bot protection !

Status
Not open for further replies.
If you'll exit the game - your character will still train. And it really doesnt matter if you are really in game, or you have exited :)
 
But if you give exit, then character will be logout after x minutes I think :p.
 
Ye, he will logout, and what than?

Update. More info in first post. :P

#Edit

Ahh, I understand what you mean. To be not kicked, you must also turn. You can also use doPlayerResetIdleTime(cid) to be there was only code needed without turning.
 
Last edited:
I mean that, player entering training room, he exit the game and after 10 minutes try to login.. what happends? Player login to training room and he can train how long he want (with bot too).
 
I mean that, player entering training room, he exit the game and after 10 minutes try to login.. what happends? Player login to training room and he can train how long he want (with bot too).

make it so the player is teleported out of the room onlog in? if player has storage value X then teleport payer to X,Y,Z and remove storage value so they can enter again

or i guess it can be made on log out to?
 
make it so the player is teleported out of the room onlog in? if player has storage value X then teleport payer to X,Y,Z and remove storage value so they can enter again

or i guess it can be made on log out to?

I know that, lol I just wrote what I've noticed. :)
 
Its in Trunk, TAGS have only global.lua :P
 
Yea, should be fine, paste the functions at global.lua
 
What if someone has a bot with an auto talk? because MANY bots come with that feature...

Mean one :wub:

#edit

k, working on it ;-) already I get only one error at the console sometimes..

[25/07/2008 18:58:08] Lua Script Error: [Action Interface]
[25/07/2008 18:58:08] in a timer event called from:
[25/07/2008 18:58:08] data/actions/scripts/tools/training.lua:onUse

[25/07/2008 18:58:08] luaGetPlayerStorageValue(). Player not found

why? :mad:
 
Last edited:
I cant find: functions.lua
:S:S:S

This script is for TFS 0.3 pre-alpha.


0.2 rc13 doesn't got this, and I don't think other distributions got it.

Correct me if im wrong.
 
He can paste the functions at global.lua and he'll be fine.
 
Maybe making another version (suggestion) that is basic math. Will help with a lot of the ways to exploit this code.
 
@Ronaldino

I'm getting the same error

@Slawkens

There's one tiny bug though.
Code:
function doPlayerExtendTraining(cid)
	addEvent(setPlayerTrainCode, TRAIN_TIME * 1000 * 30, cid)
	addEvent(isItEndOfTraining, (TRAIN_TIME * 1000 * 30) + 20000, cid)
end
[COLOR="Red"]* 30 should be really * 60 to make it count TRAIN_TIME in minutes[/COLOR]

And another bug, quite big actually:

When a player enters the training room, then exits, let's say after 5 minutes, and goes there again he gets multiple events and that means he has to rewrite the !train codes as many times as he stopped/started trainings, during that (default) 15 mins time. There's stopEvent missing somewhere.


Oh and thanks for sharing!
 
@Ronaldino

I'm getting the same error

@Slawkens

There's one tiny bug though.
Code:
function doPlayerExtendTraining(cid)
	addEvent(setPlayerTrainCode, TRAIN_TIME * 1000 * 30, cid)
	addEvent(isItEndOfTraining, (TRAIN_TIME * 1000 * 30) + 20000, cid)
end
[COLOR="Red"]* 30 should be really * 60 to make it count TRAIN_TIME in minutes[/COLOR]

And another bug, quite big actually:

When a player enters the training room, then exits, let's say after 5 minutes, and goes there again he gets multiple events and that means he has to rewrite the !train codes as many times as he stopped/started trainings, during that (default) 15 mins time. There's stopEvent missing somewhere.


Oh and thanks for sharing!

About first, I used it for testing, and I really forgot about changing it :)

Second, actually there is no 1 AddEvent, but AddEvent for each player, so I dont know how to stop them by stopEvent. Maybe storages to identify. I'll try later.
 
Hey Man have to you make this on all square of otserver??? player make bot with mages to train ML, and don't use training room, have to your TIME count for all players AFK????
 
Status
Not open for further replies.
Back
Top