If you have alot of names, you will have to add them this way or the other so I don't see the problem in what I wrote, just call the function several times and change the name only.
But here is a different way that might be more... "Good Looking"
under globals
Code:
string array banlistNames
Under the locals of function main
Code:
call initBanList()
under endglobals
Code:
function banPlayer takes string nameToBan returns nothing
local integer index=0
set nameToBan=StringCase(nameToBan,false)
loop
exitwhen index>11
if StringCase(GetPlayerName(Player(index)),false) == nameToBan then
call CustomDefeatBJ(Player(index),"You have been banned from this map")
endif
set index=index+1
endloop
set nameToBan=""
endfunction
function initBanList takes nothing returns nothing
local integer index=0
local boolean b=true
set banlistNames[0]=="name"
set banlistNames[1]=="another name"
set banlistNames[2]=="another name"
set banlistNames[3]=="another name"
loop
exitwhen b==false
if (StringLength(banlistNames[index])>0)
call banPlayer(banlistNames[index])
else
set b=false
endif
set index=index+1
endloop
endfunction
I can't test if it will work, tell me how it goes.