import es import playerlib import random info = es.AddonInfo() info.version = "1.0" info.author = "Sit Down Son" info.name = "Sit Down Son ~ Sly Spy" info.url = "" info.date = "2013.06.01" # List of Terrorist Models. TerroristModels = ["models/player/t_guerilla", "models/player/t_leet", "models/player/t_arctic", "models/player/t_phoenix"] #List of CTerrorist Models. CTerroristModels = ["models/player/ct_gign", "models/player/ct_urban", "models/player/ct_gsg9", "models/player/ct_sas"] #Defines which player of each team becomes the Sly Spy. def round_start(event_var): #Make a list of all Terrorist and CTerrorist players. TerroristList = playerlib.getPlayerList("#t") CTerroristList = playerlib.getPlayerList("#ct") #If both lists are not empty we choose a Sly Spy for each team. if TerroristList and CTerroristList: #Shuffle the players and the models. random.shuffle(TerroristList) random.shuffle(CTerroristList) random.shuffle(TerroristModels) random.shuffle(CTerroristModels) #Choose a random Terrorist and CTerrorist. Terrorist = TerroristList[0] CTerrorist = CTerroristList[0] #Set the model of the chosen Sly Spies to a random enemy model. Terrorist.setModel(CTerroristModels[0]) CTerrorist.setModel(TerroristModels[0]) #Display in the center of the screen to each team who their Sly Spy is. for T in TerroristList: es.centertell(T.userid, Terrorist.name + " has been chosen to be your teams spy this round.") for CT in CTerroristList: es.centertell(CT.userid, CTerrorist.name + " has been chosen to be your teams spy this round.")