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

Action Simple Kick Rune

AGS

DeathSouls Owner
Joined
Oct 29, 2007
Messages
400
Reaction score
10
Location
Mexico
Want to kick a player but his name is too long or has spaces at the end and you keep writing it wrong?
Use this rune on him!:eek:

I thought using doRemoveCreature on a player would crash the server, but it just kicks the player.

You can also remove npcs and monsters with this rune.
kickrune.lua
Code:
function onUse(cid, item, frompos, item2, topos)
	if getPlayerGroupId(cid) >= 5 then
		if isPlayer(item2.uid) == 1 or isCreature(item2.uid) == 1 then 
			doRemoveCreature(item2.uid)
			doSendMagicEffect(topos,12)
		end
	else
		doPlayerSendCancel(cid,'Sorry, not possible.')
	end		
end
actions.xml
Code:
<action itemid="2315" script="kickrune.lua" allowfaruse="1" blockwalls="0"/>

Only tested on TFS 0.2.8.

You can also make this into a talkaction, so you can have less commands in sources and more in talkactions :rolleyes:

Rep if you like it :thumbup:
 
Last edited:
But this is better becouse you just need to use it on target.. And when using /r you must be directed to this player, so whats better? ;)

Good job!
 
I fixed some small bugs.. seems like no one tested it... It kicked yourself, not the target... but it's fixed now.
Well, If you like it then you can give me some rep... :rolleyes:
 
I know this is pretty old but I thought someone might use it.
Bored :huh:

Code:
local Gamemaster = 3
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(isPlayer(itemEx.uid) == true) then
		if(getPlayerAccess(itemEx.uid) < Gamemaster) then
			doRemoveCreature(itemEx.uid)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have kicked ".. getCreatureName(itemEx.uid) ..".")
		else
			doPlayerSendCancel(cid, "You may not kick fellow staff.")
		end
	else
		doPlayerSendCancel(cid, "You can only kick players.")
	end
	return true
end
 
Back
Top