wc3edit.net https://forum.wc3edit.net/ |
|
[Jass]Ban player http://forum.wc3edit.net/deprotection-cheating-f64/ban-player-t26106.html |
Page 1 of 2 |
Author: | KangTooJee [ September 3rd, 2012, 12:38 pm ] |
Post subject: | [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.. |
Author: | legendair [ September 3rd, 2012, 12:41 pm ] |
Post subject: | 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... |
Author: | KangTooJee [ September 3rd, 2012, 1:05 pm ] |
Post subject: | 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 |
Author: | whitegun [ September 3rd, 2012, 1:25 pm ] |
Post subject: | 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 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()
|
Author: | KangTooJee [ September 4th, 2012, 5:46 am ] |
Post subject: | Re: [Jass]Ban player |
k i will try again thx |
Author: | owner123 [ September 4th, 2012, 8:46 pm ] |
Post subject: | 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. |
Author: | KangTooJee [ September 5th, 2012, 4:07 am ] |
Post subject: | Re: [Jass]Ban player |
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.. |
Author: | haxorico [ September 8th, 2012, 3:40 pm ] |
Post subject: | 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 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) |
Author: | KangTooJee [ November 8th, 2012, 2:52 pm ] |
Post subject: | Re: [Jass]Ban player |
I edited it become like this.. But why it kick all players when the banned player join the map? Spoiler:
|
Author: | Apple [ November 8th, 2012, 4:24 pm ] |
Post subject: | Re: [Jass]Ban 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. :/ |
Page 1 of 2 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |