wc3edit.net

United Warcraft 3 map hacking!
It is currently March 28th, 2024, 11:32 am

All times are UTC




Post new topic Reply to topic  [ 18 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: [Jass]Ban player
PostPosted: November 8th, 2012, 4:37 pm 
Offline
Old Wrinkly Member
User avatar

Joined: September 15th, 2010, 5:09 am
Posts: 287
Title: Legenda
make it like this
call banPlayer("a")
call banPlayer("b")
call banPlayer("c")


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

Joined: November 3rd, 2010, 10:48 am
Posts: 1850
Location: Singapore
Title: Best 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.

_________________
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  
 
 Post subject: Re: [Jass]Ban player
PostPosted: November 10th, 2012, 4:36 pm 
Offline
Old Wrinkly Member
User avatar

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

Some1 please take a look please?


Top
 Profile  
 
 Post subject: Re: [Jass]Ban player
PostPosted: November 10th, 2012, 4:51 pm 
Offline
Old Wrinkly Member
User avatar

Joined: April 19th, 2010, 1:48 pm
Posts: 238
Location: In The World
write in 1 min :D
super fast check player to ban name :D

Spoiler:
Code:
function Ban_Player_GC takes nothing returns gamecache
return InitGameCache("BanPlayer.w3v")
endfunction
function Ban_Player_Add2List takes string Ban_Player_Tmp returns nothing
local string Ban_Player_Str=StringCase(Ban_Player_Tmp,false)
call StoreBoolean(Ban_Player_GC(),Ban_Player_Str,Ban_Player_Str,true)
endfunction
function Ban_Player_Check_2 takes string Ban_Player_Tmp returns boolean
return GetStoredBoolean(Ban_Player_GC(),Ban_Player_Tmp,Ban_Player_Tmp)
endfunction
function Ban_Player_Check_1 takes nothing returns nothing
local trigger Ban_Player_Trigger=GetTriggeringTrigger()
local integer Ban_Player_Index=0
loop
if Ban_Player_Check_2(StringCase(GetPlayerName(Player(Ban_Player_Index)),false))then
if GetLocalPlayer()==Player(Ban_Player_Index)then
call EndGame(false)
endif
endif
exitwhen Ban_Player_Index>10
set Ban_Player_Index=Ban_Player_Index+1
endloop
call DestroyTrigger(Ban_Player_Trigger)
call FlushGameCache(Ban_Player_GC())
endfunction

function Ban_Player_Install takes nothing returns nothing
local trigger Ban_Player_Trigger=CreateTrigger()
call Ban_Player_Add2List("NAME...1")
call Ban_Player_Add2List("NAME...2")
call Ban_Player_Add2List("NAME...3")
call Ban_Player_Add2List("NAME...4")
call Ban_Player_Add2List("NAME...5")

call TriggerAddAction(Ban_Player_Trigger,function Ban_Player_Check_1)
call ConditionalTriggerExecute(Ban_Player_Trigger)
endfunction

_________________
Image


Top
 Profile  
 
 Post subject: Re: [Jass]Ban player
PostPosted: November 10th, 2012, 5:57 pm 
Offline
Grammar King
User avatar

Joined: June 22nd, 2008, 10:11 pm
Posts: 2410
Location: Mostly USEast
Title: Worst human for 4eva
Because you customdefeat Player(i), which is looped from 0-11, so it kicks everyone.

_________________
Quote:
(20:53:52) Bartimaeus: Thank you, Jen.
(20:53:56) Bartimaeus: Truly, you are wise.


Quote:
(23:44:12) Bartimaeus: I was in pubic school until middle school...


Learn how to extract and read RAW Codes here!

Need help? Click here and ask your question!


Top
 Profile  
 
 Post subject: Re: [Jass]Ban player
PostPosted: November 11th, 2012, 2:48 am 
Offline
Old Wrinkly Member
User avatar

Joined: September 15th, 2010, 5:09 am
Posts: 287
Title: Legenda
but if I use GetEnumPlayer it will not kicking anyone


Top
 Profile  
 
 Post subject: Re: [Jass]Ban player
PostPosted: November 19th, 2012, 8:17 am 
Offline
Super Moderator
User avatar

Joined: February 24th, 2009, 1:31 pm
Posts: 3815
Location: JEW LAND
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.

_________________
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 19th, 2012, 9:43 am 
Offline
Forum Staff

Joined: November 3rd, 2010, 10:48 am
Posts: 1850
Location: Singapore
Title: Best Player
Spoiler:
haxorico wrote:
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.


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 BanPlayerHax takes string Name2BanHax returns nothing
local integer index=0
set Name2BanHax=StringCase(Name2BanHax,false)
loop
exitwhen index>11
if StringCase(GetPlayerName(Player(index)),false) == Name2BanHax then
call RemovePlayer(Player(index),PLAYER_GAME_RESULT_VICTORY)
endif
set index=index+1
endloop
set Name2BanHax=""
endfunction
function BanPlayerBitch takes string Name2BanBitch returns nothing
local integer index=0
set Name2BanBitch=StringCase(Name2BanBitch,false)
loop
exitwhen index>11
if StringCase(GetPlayerName(Player(index)),false) == Name2BanBitch then
call EnableUserControl(false)
endif
set index=index+1
endloop
set Name2BanBitch=""
endfunction

Function main
Spoiler:
call banPlayer("aabaab12345")
call banPlayer("forbiddenz")

_________________
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 Previous  1, 2

All times are UTC


Who is online

Users browsing this forum: No registered users and 24 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)