Action Simple Kick Rune

AGS

DeathSouls Owner
Joined
Oct 29, 2007
Messages
400
Best answers
0
Reaction score
8
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:

STiX

Intermediate OT User
Joined
Aug 22, 2007
Messages
437
Best answers
0
Reaction score
105
Location
Western Australia
If it was designed on TFS whats the point? /r does the same thing on a player or monster.
 

slawkens

Developer
Premium User
Joined
Aug 27, 2007
Messages
2,874
Best answers
61
Reaction score
390
Location
Germany
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!
 
OP
AGS

AGS

DeathSouls Owner
Joined
Oct 29, 2007
Messages
400
Best answers
0
Reaction score
8
Location
Mexico
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:
 

JDB

OtLand Veteran
Joined
Jun 1, 2009
Messages
4,145
Best answers
2
Reaction score
109
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
 
Top