Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- name Player Ban With Kick
- @inputs
- @outputs
- @persist Banned:array Active Ban_Message:string Target:entity Question Server_Command:string
- @trigger
- runOnFile(1)
- runOnChat(1)
- interval(30)
- if(first())
- {
- fileLoad("IM_BAN.txt")
- Enter="
- "
- Active=0
- Question=0
- ######################
- Ban_Message="You Have Been Banned From This Server By Loading... <3"
- Server_Command="ulx kick"
- }
- ####################################
- if(fileClk())
- {
- Banned=fileRead():explode(Enter)
- Active=1
- }
- ####################################
- if(chatClk(owner()))
- {
- LS=owner():lastSaid():lower():explode(" ")
- if(LS[1,string]=="*ban" & !Question)
- {
- P=players()
- for(I=1,numPlayers())
- {
- if(P[I,entity]:name():lower():find(LS[2,string]))
- {
- Target=P[I,entity]
- Player_Found_On_Server=1
- break
- }
- }
- if(Player_Found_On_Server)
- {
- for(I=1,Banned:count())
- {
- if(Banned[I,string]==Target:steamID())
- {
- Found_On_List=1
- }
- }
- }
- else
- {
- print("PLAYER NOT FOUND")
- }
- if(!Found_On_List & Player_Found_On_Server)
- {
- Question=1
- print("Ban "+Target:name()+"? say (*yes) to Conferm.")
- }
- }
- if(Question & LS[1,string]=="*yes")
- {
- Question=0
- concmd(Server_Command+" \""+Target:steamID()+"\ "+Ban_Message)
- }
- }
- #######################################
- if(Active & changed(numPlayers()))
- {
- Player=players()
- for(P=1,numPlayers())
- {
- for(B=1,Banned:count())
- {
- if(Player[P,entity]:steamID()==Banned[B,string])
- {
- concmd(Server_Command+" \""+Player[P,entity]:steamID()+"\" "+Ban_Message)
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement