[Jass]Ban player
Moderator: Cheaters
-
- Old Wrinkly Member
- Posts: 202
- Joined: September 15th, 2010, 5:09 am
- Title: Legenda
[Jass]Ban player
Can some1 make me a simple jass that autokick a specific name?
I already tried the one at FAQ but it doesnt work...
Thx in advanced..
I already tried the one at FAQ but it doesnt work...
Thx in advanced..
-
- Senior Member
- Posts: 111
- Joined: July 12th, 2012, 8:04 pm
Re: [Jass]Ban player
you can use the banlist for banning the ppl to all the game you'll host (used in dota) i think is better because the map you'll edit will not be spread a lot so the guy can still play on other version...
-
- Old Wrinkly Member
- Posts: 202
- Joined: September 15th, 2010, 5:09 am
- Title: Legenda
Re: [Jass]Ban player
no, the map will be spread cuz i am playing on my country bnet..
Well i just need the trigger... thx
Well i just need the trigger... thx
-
- Old Wrinkly Member
- Posts: 219
- Joined: April 21st, 2009, 12:30 am
- Location: Việt Nam
Re: [Jass]Ban player
The one at FAQ is work perfectly for me, may be you missing something.
Here what i did:
put this code in endglobals
then i put this code in function main
Here what i did:
put this code in endglobals
Code: Select all
function kick_people takes nothing returns nothing
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
endfunction
Code: Select all
call kick_people()
-
- Old Wrinkly Member
- Posts: 202
- Joined: September 15th, 2010, 5:09 am
- Title: Legenda
-
- Super Moderator
- Posts: 1943
- Joined: February 3rd, 2009, 11:28 pm
- Been thanked: 1 time
Re: [Jass]Ban player
There's no true way to ban them, as this can be avoided with a new account.
If you truly want to ban someone forever, set up a hostbot and get it popular, then set up IP ban functionality.
If you truly want to ban someone forever, set up a hostbot and get it popular, then set up IP ban functionality.
-
- Old Wrinkly Member
- Posts: 202
- Joined: September 15th, 2010, 5:09 am
- Title: Legenda
Re: [Jass]Ban player
I know but in my country BN its hard to make new account..owner123 wrote:There's no true way to ban them, as this can be avoided with a new account.
If you truly want to ban someone forever, set up a hostbot and get it popular, then set up IP ban functionality.
Well i just managed to make it work...U can close the thread..
-
- Super Moderator
- Posts: 3197
- Joined: February 24th, 2009, 1:31 pm
- Location: JEW LAND
- Been thanked: 1 time
Re: [Jass]Ban player
Banning a specific player is a real easy job on jass.
Try this and tell me how it works for you.
Under the locals of function main
under endglobals
I wrote that on the spot using my mobile so it might have a few syntax errors, so just paste this on JassCraft and press F9 and tell me the errors it gave you.
All in all it should work, if you want several people banned you can just call the function again witha a different name each time.
The function is NOT case sensitive (makes it more helpfull)
Try this and tell me how it works for you.
Under the locals of function main
Code: Select all
call banPlayer("Enter Name Here")
Code: Select all
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
All in all it should work, if you want several people banned you can just call the function again witha a different name each time.
The function is NOT case sensitive (makes it more helpfull)
-
- Old Wrinkly Member
- Posts: 202
- Joined: September 15th, 2010, 5:09 am
- Title: Legenda
Re: [Jass]Ban player
I edited it become like this..
But why it kick all players when the banned player join the map?
But why it kick all players when the banned player join the map?
Spoiler:
-
- Forum Staff
- Posts: 1471
- Joined: November 3rd, 2010, 10:48 am
- Title: Not cool
- Location: Singapore
Re: [Jass]Ban player
I tried it. worked. However how do I add multiple names? cannot convert string to boolean. :/haxorico wrote:Banning a specific player is a real easy job on jass.
Try this and tell me how it works for you.
Under the locals of function mainunder endglobalsCode: Select all
call banPlayer("Enter Name Here")
I wrote that on the spot using my mobile so it might have a few syntax errors, so just paste this on JassCraft and press F9 and tell me the errors it gave you.Code: Select all
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
All in all it should work, if you want several people banned you can just call the function again witha a different name each time.
The function is NOT case sensitive (makes it more helpfull)