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

Kicking Player

Paxton

Banned User
Joined
Feb 23, 2008
Messages
4,110
Reaction score
48
Location
London, UK
Hello, can someone write for me function that will kick player in globalevents? I tried many times.

So, the data will be taken from Data Base.

This is the SQL:
SELECT `player` FROM `pxkick` WHERE `player` = 'PLAYER NAME';

Then, if found player name in there, then it will kick him and remove his from this table.
 
#Zonet, nah don't think so ;P

I believe he want to have table in database ex. 'players_to_kick'.
He will be inserting names via website.
In-game there will be globalevent, ex every 5 minutes kick all players from table.

Thats what you mean paxton?
 
Yes.

My actuall script:

function onThink(interval, lastExecution)

local play = getPlayersOnline()

for i, pid in ipairs(play) do
local rows = db.getResult("SELECT `player` FROM `pxkick` WHERE `player` > '1';")

if(rows:getID() ~= -1) then
local name = rows:getDataInt("player")
doRemoveCreature(name)
end
end

return TRUE
end

Doesn't work.

If you help me with it, you will be in credits in a very big project, that will come on OTS light soon :). This is not a OTserv, it is a managment system. Thank you.
 
Last edited:
Back
Top