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

Requesting a pretty hard (?) script

Joined
Jun 19, 2009
Messages
1,852
Reaction score
5
Hello! Requestion a script for TFS 0.3.5

My request is, that instead of PKING to ban you get teleported to my jail until my frags is gone!

Example: I reach 20 frags, I get teleported automatically to my jail. When all of my frags (0 frags) is gone, I get teleported to the Temple automatically!

Thanks

Edit: When you get teleported to the jail, a message will appear in your Server Log saying "You have killed to many people. You are jailed until all of your frags are gone" and when you get teleported to temple; "You are now free!"
 
Last edited:
I don't know if players frags are updated while player is logging in... So what is a sense to doing non-log zone like a jail where players frags can't be decrased (looks above, when they are dleeting) o.O
 
What did u don't understood? If Player is not logged in, then frags aren't deleted. They are decrasing onlu when player is offline (exactly, while player is logging in.) So if player stay online in Jail When he gets 20 Frags (non-log zone) Then his frags won\t be decrased, what lead to infinite stay in jail :o

OK so my script is piece of shit :P
Thanks for info xD
 
Last edited:
What did u don't understood? If Player is not logged in, then frags aren't deleted. They are decrasing onlu when player is offline (exactly, while player is logging in.) So if player stay online in Jail When he gets 20 Frags (non-log zone) Then his frags won\t be decrased, what lead to infinite stay in jail :o
 
Just script(not tested)
PHP:
function onThink(cid, interval)
local pos = {x=1078,y=984,z=9} --change {x=1078,y=984,z=9} to your jail pos
local tem = getTownTemplePosition(getPlayerTown(cid))
	if getPlayerFrags(cid) == 20 and isPlayer(cid) == TRUE then
		doTeleportThing(cid, local.pos)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have killed to many people. You are jailed until all of your frags are gone.")
	elseif getPlayerFrags(cid) == 0 and isPlayer(cid) == TRUE then
		doTeleportThing(cid, local.tem)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are now free!")
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Error - Report at otland forum")
	end
end

If not work change:
Code:
local tem = getTownTemplePosition(getPlayerTown(cid))
To:
Code:
local tem = {x=1078,y=984,z=9} --change {x=1078,y=984,z=9} to your temple pos

Where should I put it? Creatureevents or global? o.o (creature?)
 
@Your Master:

I fixed your script incase anyone wants to use it ;p

LUA:
function onThink(cid, interval) 
local pos = {x=1078,y=984,z=9} 
local tem = getTownTemplePosition(getPlayerTown(cid)) 
    if getPlayerFrags(cid) >= 20 and isPlayer(cid) == TRUE then 
        doTeleportThing(cid, pos) 
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have killed to many people. You are jailed until all of your frags are gone.") 
    elseif getPlayerFrags(cid) == 0 and isPlayer(cid) == TRUE then 
        doTeleportThing(cid, tem) 
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are now free!") 
    else 
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Error - Report at otland forum") 
    end 
        return TRUE
               end
 
Last edited:
if getPlayerFrags(cid) >= 20

will be better because if someone makes an ue and has more frags he wont get jailed.
 
Here's how to do it the probably best way:
- Disable current ban system after x kills
- Use onKill to increase frags
** if 20 teleport to jail + set storage
** registerCreatureEvent to an onThink event
** check if frags == 0 and storage == true then tp out

Can make it when home!
 
Back
Top