ETMods.net

N!tmod, a Wolfenstein: Enemy Territory Modification!

You are not logged in.

Announcement

You can donate to help us keeping services online.

#1 25-Jan-14 13:09:55

Doc
BETA Tester
Registered: 23-Feb-11
Posts: 24
Website

Help with script lua Ban/unban.

Hello guys !

I have a lua script that allows me to have commands like:
  - Mute / unmute
  - Ban
  - Help
  - SetLevel
  - Lev
  - Ref
  - Unref
  - Kick
  - Splat

I can ban for a period of x minutes, but I can not make a unban commands... It is a friend who create this lua, and it is rather difficult to understand (for me).

All works in relation to cl_guid.

If needed I can join the lua script by mp.

This Function which allows ban:

 function	ban_pl(client, id, ban_time)
	if (ban_time == nil) then
		ban_time = 6000000
	end
	if (type(ban_time) ~= 'number') then
		et.trap_SendServerCommand(client, "chat \"ban time must be a number\"")
		return 1
	end
	et.trap_DropClient(id, "Banned by admin", ban_time) 
 end
 

and

	elseif (bits[8] == 1 and arg[2] == "!ban") then
			if (check_levels(client, id) == -1) then return -1 end -- !ban
			ban_pl(client, id, tonumber(arg[4]))
			return 1

And function for unban :

  function	unban_pl(id, client)
	et.trap_DropClient(id, "Unbanned by admin") 
 end
	if (bits[9] == 1 and arg[2] == "!unban") then
			if (check_levels(client, id) == -1) then return -1 end -- !unban
			unban_pl(client, id)
			return 1

If someone can give me a little help, Thank you in advance cordially Doc!

Offline

#2 25-Jan-14 18:52:19

Micha
Member
From: Germany
Registered: 11-Feb-13
Posts: 38
Website

Re: Help with script lua Ban/unban.

You need to use another function then et.trap_DropClient(id, "Banned by admin", ban_time)
You can't unban this as far as I know. Also the unban command would drop the player again.
Kmod uses pb_sv_ban and unban to do this.

Offline

#3 25-Jan-14 20:37:32

Doc
BETA Tester
Registered: 23-Feb-11
Posts: 24
Website

Re: Help with script lua Ban/unban.

This is what I saw for the kmod, but I find it a pity to activate punkbuster. It is unfortunate that there is no function for unban.
I'll think about it, whether I activate or not punkbuster and i use or not the file unban  kmod.

Again thank you for the quick reply!

Offline

Board footer

Powered by FluxBB