Announcement

Collapse
No announcement yet.

Kicking for using artillery

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Kicking for using artillery

    Hello,

    I was just wondering if there are any python scripts which will kick/ban anyone who uses artillery in a game?

    I have tried coding one, but no luck :-(

    Code:
    import bf2
    import host
    import time
    
    kickTime = 10
    
    # Register handlers to receive chat messages and player connections
    host.registerHandler('ChatMessage', onChatMessage, 1)
    host.registerHandler('PlayerConnect', onPlayerConnect, 1)
    
    
    def init():
            if g_debug: print "initializing tk-punish script"
    
    
    def onChatMessage(playerID, msgText, channel, flags):
      global kickTime
         
       if playerID < 0: return  # The server operator can be a potty-mouth if he wants
       if msgText.find("[ARTILLERY]") == -1: continue
       playerName = bf2.playerManager.getPlayerByIndex(playerID).getName()
       host.rcon_invoke('game.sayall "Player %s kicked for using arty"'% playerName)       
       host.rcon_invoke('pb_sv_kick "%s" %i "Using arty"'% (playerName, kickTime))
       print ( 'NO ARTY: Player %s kicked for using arty"%s" at %s'% (playerName, word, time.strftime("%a %d-%b-%Y %H:%M")) )
    Can anyone help me please?

    Thanks very much in adance!

    Jase

  • #2
    Re: Kicking for using artillery

    Just remove it from the map!

    Comment


    • #3
      Re: Kicking for using artillery

      Ya just remove it from the map. And if you can't then remove the arty effects and set its damage to zero. Arty could be called but it would appear that nothing happened.

      Comment


      • #4
        Re: Kicking for using artillery

        im not making a map, i would like some help which will kick anyone using arty using python from a server?

        Comment


        • #5
          Re: Kicking for using artillery

          a ranked server?

          Comment


          • #6
            Re: Kicking for using artillery

            any server

            Comment


            • #7
              Re: Kicking for using artillery

              we play arty free matches

              Comment


              • #8
                Re: Kicking for using artillery

                You can remove it from the current maps as well but dont ask me how Ill i know is you can remove it.

                Comment


                • #9
                  Re: Kicking for using artillery

                  so theres no way to do it in python?

                  Comment


                  • #10
                    Re: Kicking for using artillery

                    I dont think so, either remove them or liek it was mentioned five the arty shells a damage of 0.

                    Comment

                    Working...
                    X