wc3edit.net

United Warcraft 3 map hacking!
It is currently March 28th, 2024, 12:50 pm

All times are UTC




Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: [Jass]Ban player
PostPosted: September 3rd, 2012, 12:38 pm 
Offline
Old Wrinkly Member
User avatar

Joined: September 15th, 2010, 5:09 am
Posts: 287
Title: Legenda
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..


Top
 Profile  
 
 Post subject: Re: [Jass]Ban player
PostPosted: September 3rd, 2012, 12:41 pm 
Offline
Senior Member

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


Top
 Profile  
 
 Post subject: Re: [Jass]Ban player
PostPosted: September 3rd, 2012, 1:05 pm 
Offline
Old Wrinkly Member
User avatar

Joined: September 15th, 2010, 5:09 am
Posts: 287
Title: Legenda
no, the map will be spread cuz i am playing on my country bnet..
Well i just need the trigger... thx


Top
 Profile  
 
 Post subject: Re: [Jass]Ban player
PostPosted: September 3rd, 2012, 1:25 pm 
Offline
Old Wrinkly Member
User avatar

Joined: April 21st, 2009, 12:30 am
Posts: 246
Location: Việt Nam
The one at FAQ is work perfectly for me, may be you missing something.

Here what i did:

put this code in endglobals
Code:
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:
call kick_people()


Top
 Profile  
 
 Post subject: Re: [Jass]Ban player
PostPosted: September 4th, 2012, 5:46 am 
Offline
Old Wrinkly Member
User avatar

Joined: September 15th, 2010, 5:09 am
Posts: 287
Title: Legenda
k i will try again thx


Top
 Profile  
 
 Post subject: Re: [Jass]Ban player
PostPosted: September 4th, 2012, 8:46 pm 
Offline
Super Moderator

Joined: February 3rd, 2009, 11:28 pm
Posts: 2394
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.


Top
 Profile  
 
 Post subject: Re: [Jass]Ban player
PostPosted: September 5th, 2012, 4:07 am 
Offline
Old Wrinkly Member
User avatar

Joined: September 15th, 2010, 5:09 am
Posts: 287
Title: Legenda
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..


Top
 Profile  
 
 Post subject: Re: [Jass]Ban player
PostPosted: September 8th, 2012, 3:40 pm 
Offline
Super Moderator
User avatar

Joined: February 24th, 2009, 1:31 pm
Posts: 3815
Location: JEW LAND
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:
call banPlayer("Enter Name Here")

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


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:
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:

(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:
(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:
(15:42:51) Lanaya: can i suck , . . .

Code:
(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:
GeorgeMots: xplain what happens in SP. Why cant you save?
dast.-:i need play with 2 players

Code:
(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:
(10:08:02) Bartimaeus: you do know run I youtube channel for my favorite music, right?


Top
 Profile  
 
 Post subject: Re: [Jass]Ban player
PostPosted: November 8th, 2012, 2:52 pm 
Offline
Old Wrinkly Member
User avatar

Joined: September 15th, 2010, 5:09 am
Posts: 287
Title: Legenda
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


Top
 Profile  
 
 Post subject: Re: [Jass]Ban player
PostPosted: November 8th, 2012, 4:24 pm 
Offline
Forum Staff

Joined: November 3rd, 2010, 10:48 am
Posts: 1850
Location: Singapore
Title: Best Player
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:
call banPlayer("Enter Name Here")

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


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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 15 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

phpBB SEO


Privacy Policy Statement
Impressum (German)