wc3edit.net https://forum.wc3edit.net/ |
|
[Jass]Ban player http://forum.wc3edit.net/deprotection-cheating-f64/ban-player-t26106-10.html |
Page 2 of 2 |
Author: | KangTooJee [ November 8th, 2012, 4:37 pm ] |
Post subject: | Re: [Jass]Ban player |
make it like this call banPlayer("a") call banPlayer("b") call banPlayer("c") |
Author: | Apple [ November 8th, 2012, 4:55 pm ] |
Post subject: | Re: [Jass]Ban player |
v1nc3nts wrote: make it like this call banPlayer("a") call banPlayer("b") call banPlayer("c") I have a lot to ban. I want to have include them in a single line. |
Author: | KangTooJee [ November 10th, 2012, 4:36 pm ] |
Post subject: | Re: [Jass]Ban player |
v1nc3nts wrote: I edited it become like this.. But why it kick all players when the banned player join the map? Spoiler:
Some1 please take a look please? |
Author: | Fukki [ November 10th, 2012, 4:51 pm ] |
Post subject: | Re: [Jass]Ban player |
write in 1 min super fast check player to ban name Spoiler:
|
Author: | UndeadxAssassin [ November 10th, 2012, 5:57 pm ] |
Post subject: | Re: [Jass]Ban player |
Because you customdefeat Player(i), which is looped from 0-11, so it kicks everyone. |
Author: | KangTooJee [ November 11th, 2012, 2:48 am ] |
Post subject: | Re: [Jass]Ban player |
but if I use GetEnumPlayer it will not kicking anyone |
Author: | haxorico [ November 19th, 2012, 8:17 am ] |
Post subject: | Re: [Jass]Ban player |
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. |
Author: | Apple [ November 19th, 2012, 9:43 am ] |
Post subject: | Re: [Jass]Ban player |
Spoiler:
You forgot this. if (StringLength(banlistNames[index])>0) then Here's mine.. I have to add a lot of player names in function main hohoho Endglobals Spoiler:
Function main Spoiler:
|
Page 2 of 2 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |