import es import playerlib import popuplib # Save as ..\cstrike\addons\eventscripts\colourmod\colourmod.py # And put es_load colourmod in your autoexec.cfg in your cfg folder #============================================== # Change here #============================================== # Text in chat to send popup menu colour_command = '!colour' # Text in console to send popup menu colour_client = 'colour' # Add admins here so they can change colour colour_admin = ['STEAM_ID_LAN', 'STEAM_ID_LAN'] #============================================== # Stop here #============================================== def load(): global mypopup mypopup = popuplib.easymenu('playrank', none, rank_chosen) mypopup.settitle('Choose Your Color:') mypopup.c_beginsep mypopup.addoption('red', 'Red') mypopup.addoption('blue', 'Blue') mypopup.addoption('green', 'Green') mypopup.addoption('pink', 'Pink') mypopup.addoption('orange', 'Orange') mypopup.addoption('purple', 'Purple') mypopup.addoption('white', 'White') mypopup.addoption('black', 'Black') mypopup.addoption('brown', 'Brown') mypopup.c_endsep es.msg("#multi", "#green[PlayedRank] #lightgreenHas Been Loaded") def unload(): es.msg("#multi", "#green[PlayedRank] #lightgreenHas Been Unloaded") def rank_chosen(userid, choice, popupname): myplayer = playerlib.getplayerlib(ev['userid'] if (choice == 'red'): myplayer.setColor(255,0,0) if (choice == 'blue'): myplayer.setColor(0,0,255) if (choice == 'green'): myplayer.setColor(0,255,0) if (choice == 'pink'): myplayer.setColor(255,0,255) if (choice == 'orange'): myplayer.setColor(255,128,0) if (choice == 'purple'): myplayer.setColor(128,0,255) if (choice == 'white'): myplayer.setColor(255,255,255) if (choice == 'black'): myplayer.setColor(0,0,0) if (choice == 'brown'): myplayer.setColor(150,50,0) def player_say(ev): if (ev['es_steamid'] in colour_admin): if (ev['text'] == colour_command): mypopup.send(ev['userid']) def es_client_command(ev): if (ev['es_steamid'] in colour_admin): if (ev['command'] == colour_client): mypopup.send(ev['userid'])