[Jass]Ban player

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

User avatar
KangTooJee
Old Wrinkly Member
Posts: 202
Joined: September 15th, 2010, 5:09 am
Title: Legenda

[Jass]Ban player

Post by KangTooJee »

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..
legendair
Senior Member
Posts: 111
Joined: July 12th, 2012, 8:04 pm

Re: [Jass]Ban player

Post by legendair »

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...
User avatar
KangTooJee
Old Wrinkly Member
Posts: 202
Joined: September 15th, 2010, 5:09 am
Title: Legenda

Re: [Jass]Ban player

Post by KangTooJee »

no, the map will be spread cuz i am playing on my country bnet..
Well i just need the trigger... thx
User avatar
whitegun
Old Wrinkly Member
Posts: 219
Joined: April 21st, 2009, 12:30 am
Location: Việt Nam

Re: [Jass]Ban player

Post by whitegun »

The one at FAQ is work perfectly for me, may be you missing something.

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

then i put this code in function main

Code: Select all

call kick_people()
User avatar
KangTooJee
Old Wrinkly Member
Posts: 202
Joined: September 15th, 2010, 5:09 am
Title: Legenda

Re: [Jass]Ban player

Post by KangTooJee »

k i will try again thx
owner123
Super Moderator
Posts: 1943
Joined: February 3rd, 2009, 11:28 pm

Re: [Jass]Ban player

Post by owner123 »

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.
User avatar
KangTooJee
Old Wrinkly Member
Posts: 202
Joined: September 15th, 2010, 5:09 am
Title: Legenda

Re: [Jass]Ban player

Post by KangTooJee »

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.

I know but in my country BN its hard to make new account..
Well i just managed to make it work...U can close the thread..
User avatar
haxorico
Super Moderator
Posts: 3190
Joined: February 24th, 2009, 1:31 pm
Location: JEW LAND

Re: [Jass]Ban player

Post by haxorico »

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

Code: Select all

call banPlayer("Enter Name Here")

under endglobals

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


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)
Image
Spoiler:
(02:24:09)

Code: Select all

ChatBot: FatherSpace logs into the Chat.
(02:24:28) Lanaya: Gtfo ken.
(02:24:33) ChatBot: FatherSpace logs out of the Chat.
(02:24:40) Lanaya: Thought so. bitch.
(02:24:44) ChatBot: FatherSpace logs into the Chat.
(02:24:48) FatherSpace: Can I come back yet?
(02:24:51) Lanaya: What'd i say earlier.
(02:24:51) Lanaya: No.
(02:24:58) FatherSpace: Let's try this...
(02:25:01) ChatBot: Lanaya has been logged out (Kicked).

Code: Select all


(14:33:51) 2Pac: Do you know what'S so funny?
(14:34:01) Lanaya: No, please show me.
(14:34:07) 2Pac: This.
(14:34:09) ChatBot: Lanaya has been logged out (Kicked).
(14:34:10) 2Pac:


Code: Select all

(14:35:59) haxorico: No one will belive me if I say "I got this song from 2pac on MSN" lolz ^^
(14:36:02) Lanaya: lolz.
(14:36:16) 2Pac: I AIN'T DEAD FFS.
(14:36:26) 2Pac: I'm a living legend, y'now.
(14:37:17) haxorico: why is 2Pac a legend?
(14:37:28) Lanaya: He's the worse rapper evar.

Code: Select all

(15:42:51) Lanaya: can i suck , . . .

Code: Select all

(13:55:21) ChatBot: 2Pac rolls 1d100 and gets 1.
(13:55:21) ChatBot: haxorico rolls 1d2 and gets 2.
(13:55:27) haxorico: owned?

Code: Select all

GeorgeMots: xplain what happens in SP. Why cant you save?
dast.-:i need play with 2 players

Code: Select all

(21:53:08) (673237): plzplzplz, im sorry about before.
(21:53:26) FatherSpace: I'm sorry you were born.
(21:53:31) ChatBot: (673237) has been logged out (Kicked).


Code: Select all

(10:08:02) Bartimaeus: you do know run I youtube channel for my favorite music, right?
User avatar
KangTooJee
Old Wrinkly Member
Posts: 202
Joined: September 15th, 2010, 5:09 am
Title: Legenda

Re: [Jass]Ban player

Post by KangTooJee »

I edited it become like this..
But why it kick all players when the banned player join the map?
Spoiler:
function kick_people takes nothing returns nothing
local string playerNames
local integer i=0
local boolean mampus=false
loop
exitwhen i>11
set playerNames=StringCase(GetPlayerName(Player(i)),false)
if playerNames=="mp3_alucard-"or playerNames=="bbtb999"or playerNames=="focs-momo_"or playerNames=="mp4_victoria-"or playerNames=="mental_kroco"or playerNames=="lastroze"or playerNames=="mechq"or playerNames=="focs_newbie"or playerNames=="kadaphi"or playerNames=="dreyan"or playerNames=="eralisasi"or playerNames=="siegrain"or playerNames=="shikkoku"or playerNames=="absolutelies"or playerNames=="nobodysign~"or playerNames=="focs-deidara_"or playerNames=="[c]ross_[l]ife" then
set mampus=true
elseif playerNames=="rynchibii"or playerNames=="nasos_gagak"or playerNames=="minato~namikaze"or playerNames=="[madara_tobi]"or playerNames=="kampretforever"then
set mampus=true
endif
if mampus then
call CustomDefeatBJ(Player(i),"Mamak lu lacur, beli 3 gratis 1... ")
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,15.,("|cffff0000"+(GetPlayerName(Player(i))+" has been BANNED from this map because Cari masalah dengan KangTooJee, bagi yg berteman dengan dia akan ku ban")))
endif
set i=i+1
endloop
endfunction
Apple
Forum Staff
Posts: 1470
Joined: November 3rd, 2010, 10:48 am
Title: Best Player
Location: Singapore

Re: [Jass]Ban player

Post by Apple »

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 main

Code: Select all

call banPlayer("Enter Name Here")

under endglobals

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


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)


I tried it. worked. However how do I add multiple names? cannot convert string to boolean. :/
Request a map? Follow the rulesHERE
Request templateHERE
Please, do not PM me.
On the side note, I'm still playing vampirism speed on malaysia room, occasionally in Garena. Bcuz too lazy to find out where else I can play them.