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

TalkAction Noob char in war or blocking spawn?

Belthazor

New Member
Joined
Sep 20, 2008
Messages
528
Reaction score
4
Hello,

manny players in my ot complain about noob chars in war or they are blocking some spawn way so i made this command.

The command can be used 1 time in 30 Seconds so they wont spamm
and the player most be lower then lvl 50 caus thats the protection lvl in my server.

You can set for you server the temple spawn and the lvl the storage and the time between use of the command.

PHP:
local waittime = 30 -- Waiting time between the command
local storage = 50 -- The storage
if getPlayerLevel(pid) < 50 then -- The lvl of Protected Players
nPos = {x=32369, y=32241, z=7} -- The temple Position.


PHP:
	local waittime = 30 --Default (30 seconds)
	local storage = 50
function onSay(cid, words, param, channel)
	if(param == "") then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
		return TRUE
	end

	local pid = getPlayerByNameWildcard(param)
	if(pid == 0 or (isPlayerGhost(pid) == TRUE and getPlayerAccess(pid) > getPlayerAccess(cid))) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " is not currently online.")
		return TRUE
	end

	if getPlayerLevel(pid) < 50 then
	if exhaustion.get(cid, storage) == FALSE then
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getCreatureName(pid) .. " has been sent to temple.")
	nPos = {x=32369, y=32241, z=7}
	doTeleportThing(pid, nPos)
	exhaustion.set(cid, storage, waittime)
	        else
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You must wait another " .. exhaustion.get(cid, storage) .. " seconds.")
        end   
		else
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "The player is higer then lvl 50.")
	end
	return TRUE
end
 
You can teleport players under the protection level to the tempel, I am right?
 
ye or to jail what ever you want just change the location poss.
 
Or, you could do what sync created and make a script that if under a certain level instead of killing the person teleport them to their town temples.
Example:
Level 100 Elite Knight uses Fierce Berserk on a level 8, the level 8 does not die, but is teleported to the temple.
 
Or, you could do what sync created and make a script that if under a certain level instead of killing the person teleport them to their town temples.
Example:
Level 100 Elite Knight uses Fierce Berserk on a level 8, the level 8 does not die, but is teleported to the temple.

I like it :D
 
Or, you could do what sync created and make a script that if under a certain level instead of killing the person teleport them to their town temples.
Example:
Level 100 Elite Knight uses Fierce Berserk on a level 8, the level 8 does not die, but is teleported to the temple.

and you tell me that now? :p
i did't know about that and i needed this kind of script so slawkens on donator bord was't workign for me so i made this.
 
Or, you could do what sync created and make a script that if under a certain level instead of killing the person teleport them to their town temples.
Example:
Level 100 Elite Knight uses Fierce Berserk on a level 8, the level 8 does not die, but is teleported to the temple.


Intersting , could you please give me a like to the topic?

Becuase I tried to look for it and couldn't find it.

Thanks.!
 
But you can kick all players..
also in my server the ppls playing with that shit :S
they kick all ppls!
 
Last edited:
Or, you could do what sync created and make a script that if under a certain level instead of killing the person teleport them to their town temples.
Example:
Level 100 Elite Knight uses Fierce Berserk on a level 8, the level 8 does not die, but is teleported to the temple.
With this script players on level under protection level can fight, but cant die (teleport to temple on death, do not lose exp/skill/mlvl/eq).
If you have many players on server you should add counter (save in player storage number of killed low levels by hlvl) and ban (1-2 hours)/jail/broadcast nicks of players that kill more then X low levels/hour (add 1 'point' to storage when someone kill low level and add globalevent that remove one point every online player every X minutes).
in config.lua set protectionlevel = 0
in data/creaturescripts/scripts/login.lua add IN function (before return true):
PHP:
registerCreatureEvent(cid, "NonPvpLowLevel")
in data/creaturescripts/creaturescripts.xml add line:
PHP:
<event type="preparedeath" name="NonPvpLowLevel" event="script" value="lowlevelprotection.lua"/>
make file data/creaturescripts/scripts/lowlevelprotection.lua and paste:
TFS 0.3.4.x:
PHP:
protectionLevel = 50

function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
	if(isPlayer(cid) == true and isPlayer(lastHitKiller) == true and getPlayerLevel(cid) <= protectionLevel) then
		doCreatureAddHealth(cid, getCreatureMaxHealth(cid)-getCreatureHealth(cid))
		doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), 1)
		return false
	end
	return true
end
TFS 0.3.5.x:
PHP:
protectionLevel = 50

function onPrepareDeath(cid, deathList)
	if(isPlayer(cid) == true and isPlayer(deathList[1]) == true and getPlayerLevel(cid) <= protectionLevel) then
		doCreatureAddHealth(cid, getCreatureMaxHealth(cid)-getCreatureHealth(cid))
		doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), 1)
		return false
	end
	return true
end
I did not test code on any TFS. I hope it work.
POST IN THIS THREAD IF SCRIPT WORK
 
Last edited:
i ill test this script for ya and report back if it works

Edited:
The script works only when the players teleported to temple his health is 0 and cant move so the noob char need to relog before he can move again.
 
Last edited:
i ill test this script for ya and report back if it works

Edited:
The script works only when the players teleported to temple his health is 0 and cant move so the noob char need to relog before he can move again.
Aaaa.. we must heal player (player with 0 hp cant move/attack).
above:
PHP:
 doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), 1)
add:
PHP:
doCreatureAddHealth(cid, getCreatureMaxHealth(cid)-getCreatureHealth(cid))
Test it and post is it work. Maybe it must be 'addEvent' with addhealth.
 
Aaaa.. we must heal player (player with 0 hp cant move/attack).
above:
PHP:
 doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), 1)
add:
PHP:
doCreatureAddHealth(cid, getCreatureMaxHealth(cid)-getCreatureHealth(cid))
Test it and post is it work. Maybe it must be 'addEvent' with addhealth.

still the same and i tryed difrent ways to give the health but non worked
i tryed this to
PHP:
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
 
Gesior :S I do not like to attack the low level

lvlbajo.jpg
 
Woop.. did not work for me gesior.. Same error as balthier.. I go to temple with 0 hp but im not dead, I die when the player that killed me logged out.
 
Back
Top