Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2014
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. name Player Ban With Kick
  2. @inputs
  3. @outputs
  4. @persist Banned:array Active Ban_Message:string Target:entity Question Server_Command:string
  5. @trigger
  6.  
  7. runOnFile(1)
  8. runOnChat(1)
  9. interval(30)
  10.  
  11. if(first())
  12. {
  13. fileLoad("IM_BAN.txt")
  14. Enter="
  15. "
  16. Active=0
  17. Question=0
  18. ######################
  19. Ban_Message="You Have Been Banned From This Server By Loading... <3"
  20. Server_Command="ulx kick"
  21. }
  22. ####################################
  23. if(fileClk())
  24. {
  25. Banned=fileRead():explode(Enter)
  26. Active=1
  27. }
  28. ####################################
  29. if(chatClk(owner()))
  30. {
  31. LS=owner():lastSaid():lower():explode(" ")
  32. if(LS[1,string]=="*ban" & !Question)
  33. {
  34. P=players()
  35. for(I=1,numPlayers())
  36. {
  37. if(P[I,entity]:name():lower():find(LS[2,string]))
  38. {
  39. Target=P[I,entity]
  40. Player_Found_On_Server=1
  41. break
  42. }
  43. }
  44.  
  45. if(Player_Found_On_Server)
  46. {
  47. for(I=1,Banned:count())
  48. {
  49. if(Banned[I,string]==Target:steamID())
  50. {
  51. Found_On_List=1
  52. }
  53. }
  54. }
  55. else
  56. {
  57. print("PLAYER NOT FOUND")
  58. }
  59.  
  60. if(!Found_On_List & Player_Found_On_Server)
  61. {
  62. Question=1
  63. print("Ban "+Target:name()+"? say (*yes) to Conferm.")
  64. }
  65. }
  66.  
  67. if(Question & LS[1,string]=="*yes")
  68. {
  69. Question=0
  70. concmd(Server_Command+" \""+Target:steamID()+"\ "+Ban_Message)
  71. }
  72. }
  73. #######################################
  74. if(Active & changed(numPlayers()))
  75. {
  76. Player=players()
  77. for(P=1,numPlayers())
  78. {
  79. for(B=1,Banned:count())
  80. {
  81. if(Player[P,entity]:steamID()==Banned[B,string])
  82. {
  83. concmd(Server_Command+" \""+Player[P,entity]:steamID()+"\" "+Ban_Message)
  84. }
  85. }
  86. }
  87. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement