slaw
Software Developer
This command will kick all players which you see on your screen. Personally it help me to kick boters from trainers.
You can also use parameters, to specify max range.
Example:
/masskick 3,3,0 - kick all players which are max 3 squares from you
/masskick 1,1,7 - kick all players which are max 3 squares from you, buy on all floors are included
This command work only in TFS 0.3
talkactions.xml
masskick.lua
You can also use parameters, to specify max range.
Example:
/masskick 3,3,0 - kick all players which are max 3 squares from you
/masskick 1,1,7 - kick all players which are max 3 squares from you, buy on all floors are included
This command work only in TFS 0.3
talkactions.xml
Code:
<talkaction access="5" log="yes" words="/masskick" script="masskick.lua"/>
masskick.lua
Code:
local config = {
maxRangeX = 5,
maxRangeY = 7,
}
function onSay(cid, words, param)
local playerPos = getCreaturePosition(cid)
local minPos = {x = playerPos.x - config.maxRangeX, y = playerPos.y - config.maxRangeY, z = playerPos.z}
local maxPos = {x = playerPos.x + config.maxRangeX, y = playerPos.y + config.maxRangeY, z = playerPos.z}
if(string.find(param, ",")) then
local params = string.explode(param, ",")
if(isNumber(params[1]) == TRUE and isNumber(params[2]) == TRUE and isNumber(params[3]) == TRUE) then
minPos.x = playerPos.x - params[1]
minPos.y = playerPos.y - params[2]
minPos.z = playerPos.z - params[3]
maxPos.x = playerPos.x + params[1]
maxPos.y = playerPos.y + params[2]
maxPos.z = playerPos.z + params[3]
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.")
return TRUE
end
end
local kicked = 0
local players = getPlayersOnline()
for i, pid in ipairs(players) do
local tmpPos = getCreaturePosition(pid)
if(isInArea(tmpPos, minPos, maxPos) == TRUE) then
if(cid ~= pid) then
doRemoveCreature(pid)
kicked = kicked + 1
end
end
end
if(kicked > 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Succesfully kicked " .. kicked .. " players.")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "There are no players to kick.")
end
return TRUE
end
Last edited: