local string PlayerName="<REPLACE THIS WITH THE PLAYER NAME>" //Entirely lowercase!
local integer i=0
loop
exitwhen i>11
if GetPlayerName(Player(i))==StringCase(PlayerName,false)then
call CustomDefeatBJ(Player(i),"You are banned.")
endif
set i=i+1
endloop
But i was wondering if anyone could "upgrade" it so instead of entering manually the banned persons there would be a command like:
-ban x JohnDoe or -unban JohnDoe
Those two commands would add or remove the desired name from a list which is checked everytime in the auto ban function on map startup.In C++ i would have an ideea how to do this using a text vector but in JASS i dont have any clue about how to store the multiple names(maybe using a string array but i still don't know how to put it together ).
Thank you very much and I hope someone will answer (even if its a not possible answer).
It would not be possible because it would have to edit the actual jass file itself.
This can result in two things (assuming that it is able to actually edit the file permanently, which it isn't):
One, it'll only affect those in the current game right now and you will have to redownload a map (whereby resetting it to the JASS file which the host is using)
or two, it'll desync every game and everyone will get kicked out (if the downloading doesn't actually happen).
(20:53:52) Bartimaeus: Thank you, Jen.
(20:53:56) Bartimaeus: Truly, you are wise.
(23:44:12) Bartimaeus: I was in pubic school until middle school...
Thanks for the quick reply and I'm glad (even if it doesnt work) that actually i understood this.
Anyways the manual input isnt bad either I will just make a list and update it every version with the banned people.