PDA

View Full Version : Kicking for using artillery


imported_Jas0n
02-05-2006, 01:19 AM
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 :-(

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).getNa me()
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

Smagma
02-05-2006, 01:29 AM
Just remove it from the map!

imported_CDNCommando
02-05-2006, 02:45 AM
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.

imported_Jas0n
02-05-2006, 11:50 AM
im not making a map, i would like some help which will kick anyone using arty using python from a server? :confused:

BigBadBob
02-05-2006, 12:07 PM
a ranked server?

imported_Jas0n
02-05-2006, 12:12 PM
any server

imported_Jas0n
02-05-2006, 12:13 PM
we play arty free matches

Eden
02-05-2006, 12:17 PM
You can remove it from the current maps as well but dont ask me how Ill i know is you can remove it.

imported_Jas0n
02-05-2006, 12:20 PM
so theres no way to do it in python?

Smagma
02-05-2006, 10:04 PM
I dont think so, either remove them or liek it was mentioned five the arty shells a damage of 0.