Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import es
- import popuplib
- import random
- import gamethread
- import cfglib
- import langlib
- import playerlib
- config = cfglib.AddonCFG(es.getAddonPath("starwars") + "/settings.cfg")
- config.text("**************************")
- config.text("Addon Settings")
- config.text("**************************")
- config.text(" ")
- config.text("*****************************************************************************")
- config.text("Configuration: General Settings\n//\n//Desc : Configure the general settings the mod uses")
- config.text("*****************************************************************************")
- sw_jediModeEnabled = config.cvar("sw_jediModeEnabled", 1, "1 Enable / 0 Disable Jedi Mod (Allows Users to use Yoda and Darth Vader)")
- sw_bobaJetsEnabled = config.cvar("bobaJetsEnabled", 1, "1 = Enable Boba Fetts Jetpack 0 = Disable it")
- sw_randomclasses = config.cvar("sw_randomclasses", 1, "1 = When The users have no classes selceted there will be set a random one/ 0 = Disable it")
- effecttype = config.cvar("effecttype", 'effects/laser1.vmt', "Here you can set the Laser model")
- sw_showmenuoneveryspawn = config.cvar("sw_showmenuoneveryspawn", 0, "1 = Shows the Class menu on every spawn/ 0 = Disable it")
- sw_bobaJetstime = config.cvar("sw_bobaJetstime", 5, "Set the Time how long the Jetpack can be used")
- sw_weaponSoundsEnabled = config.cvar("sw_weaponSoundsEnabled", 1, "1 = Enable Weapon Sounds 0 = Disable it")
- sw_charSoundsEnabled = config.cvar("sw_charSoundsEnabled", 1, " 1 = Allow Death Sounds / 0 = Disable it")
- sw_lasers_enabled = config.cvar("sw_lasers_enabled", 1, "1 = Allow Laser 0 = Disable it")
- sw_jabbaLaughEnabled = config.cvar("sw_jabbaLaughEnabled", 1, "1 = Allow Jabba to laught after Bomb explode / 0 Disable it")
- sw_more_damage_for_jedi = config.cvar("sw_more_damage_for_jedi", 1, "1 = Allows Jedis to do more damage by lightsaber (knife)")
- sw_jedi_damage_by_knife = config.cvar("sw_jedi_damage_by_knife", 10, "Set the Value of Damage when jedi is hitting a player with lightsaber(knife)")
- config.write()
- sw_admins = ["STEAM_0:1:11481373", "STEAM_0:1:12345678"]
- #####No EDIT HERE !
- rebelsoldiermodel = 'models/player/b4p/b4p_rebel/b4p_rebel.mdl'
- wookiemodel = 'models/player/b4p/b4p_chewbacca/b4p_chewbacca.mdl'
- jawamodel = 'models/player/b4p/b4p_jawa/b4p_jawa.mdl'
- tuskenmodel = 'models/player/b4p/b4p_tusken/b4p_tusken.mdl'
- c3pomodel = 'models/player/b4p/b4p_c3po/b4p_c3po.mdl'
- yodamodel = 'models/player/b4p/b4p_yoda/b4p_yoda.mdl'
- stormtroopermodel = 'models/player/b4p/b4p_stormt/b4p_stormt.mdl'
- snowtroopermodel = 'models/player/b4p/b4p_snowtrooper/b4p_snowtrooper.mdl'
- rodianmodel = 'models/player/b4p/b4p_rodian/b4p_rodian.mdl'
- officermodel = 'models/player/b4p/b4p_imperial/b4p_imperial.mdl'
- bobamodel = 'models/player/b4p/b4p_bobafett/b4p_bobafett.mdl'
- vadermodel = 'models/player/b4p/b4p_vader/b4p_vader.mdl'
- wanted_empire = {}
- empire_model_features = {}
- rebel_model_features = {}
- classname_dict = {}
- wanted_rebel = {}
- def load():
- global text
- download()
- es.doblock("corelib/noisy_on")
- config.execute()
- text = langlib.Strings(es.getAddonPath("starwars") + "/strings.ini")
- def unload():
- es.doblock("corelib/noisy_off")
- empire_model_features.clear()
- rebel_model_features.clear()
- wanted_empire.clear()
- wanted_empire.clear()
- classname_dict.clear()
- def es_map_start(ev):
- download()
- def rebelMenuShow(userid, steam):
- global rebelPopup
- if popuplib.exists('rebelPopup'):
- popuplib.delete('rebelPopup')
- rebelPopup = popuplib.create('rebelPopup')
- rebelPopup.addline('Choose a Class (Rebel):')
- rebelPopup.addline(' ')
- if rebel_model_features.has_key(steam):
- if rebel_model_features[steam] == 0:
- rebelPopup.addline('Your Current Class is: None')
- elif rebel_model_features[steam] == 1:
- rebelPopup.addline('Your Current Class is: Rebel Soldier')
- elif rebel_model_features[steam] == 2:
- rebelPopup.addline('Your Current Class is: Wookie')
- elif rebel_model_features[steam] == 3:
- rebelPopup.addline('Your Current Class is: Jawa')
- elif rebel_model_features[steam] == 4:
- rebelPopup.addline('Your Current Class is: Tusken Raider')
- elif rebel_model_features[steam] == 5:
- rebelPopup.addline('Your Current Class is: C3PO')
- if sw_jediModeEnabled == 1:
- if rebel_model_features[steam] == 6:
- rebelPopup.addline('Your Current Class is: Yoda')
- rebelPopup.addline(' ')
- rebelPopup.addline('->1. Rebel Soldier')
- rebelPopup.addline('->2. Wookie')
- rebelPopup.addline('->3. Jawa')
- rebelPopup.addline('->4. Tusken Raider')
- rebelPopup.addline('->5. C3PO')
- if sw_jediModeEnabled == 1:
- rebelPopup.addline('->6. Yoda')
- rebelPopup.addline(' ')
- rebelPopup.addline('0. Exit')
- rebelPopup.send(int(userid))
- rebelPopup.menuselect = rebelPopup_select
- def adminMenu(userid, steam):
- global check1, adminPopup,check2,check3,check4,check5,check6,check7,check8,sw_jediModeEnabled,sw_bobaJetsEnabled,sw_randomclasses,sw_showmenuoneveryspawn,sw_weaponSoundsEnabled,sw_charSoundsEnabled,sw_lasers_enabled,sw_jabbaLaughEnabled
- if popuplib.exists('adminPopup'):
- popuplib.delete('adminPopup')
- adminPopup = popuplib.create('adminPopup')
- adminPopup.addline('Admin Menu:')
- adminPopup.addline(' ')
- if sw_jediModeEnabled == 1:
- adminPopup.addline('->1. Disable Jedi Mode')
- check1 = 1
- else:
- check1 = 0
- adminPopup.addline('->1. Enable Jedi Mode')
- if sw_bobaJetsEnabled == 1:
- check2 = 1
- adminPopup.addline('->2. Disable Bobas Jet')
- else:
- check2 = 0
- adminPopup.addline('->2. Enable Bobas Jet')
- if sw_randomclasses == 1:
- check3 = 1
- adminPopup.addline('->3. Disable RandomClasses')
- else:
- check3 = 0
- adminPopup.addline('->3. Disable RandomClasses')
- if sw_showmenuoneveryspawn == 1:
- check4 = 1
- adminPopup.addline('->4. Disable Menu Show on Spawn')
- else:
- check4 = 0
- adminPopup.addline('->4. Disable Menu Show on Spawn')
- if sw_weaponSoundsEnabled == 1:
- check5 = 1
- adminPopup.addline('->5. Disable Weaponsounds')
- else:
- check5 = 0
- adminPopup.addline('->5. Enable Weaponsounds')
- if sw_charSoundsEnabled == 1:
- check6 = 1
- adminPopup.addline('->6. Disable Death Sounds')
- else:
- check6 = 0
- adminPopup.addline('->6. Enable Death Sounds')
- if sw_lasers_enabled == 1:
- check7 = 1
- adminPopup.addline('->7. Disable Laser')
- else:
- check7 = 0
- adminPopup.addline('->7. Enable Laser')
- if sw_jabbaLaughEnabled == 1:
- check8 = 1
- adminPopup.addline('->8. Disable Jabbas Laught')
- else:
- check8 = 0
- adminPopup.addline('->8. Enable Jabbas Laught')
- adminPopup.addline(' ')
- adminPopup.addline('0. Exit')
- adminPopup.send(userid)
- adminPopup.menuselect = adminPopup_select
- def adminPopup_select(userid, choice, popupid):
- global check1,check2,check3,check4,check5,check6,check7,check8,sw_jediModeEnabled,sw_bobaJetsEnabled,sw_randomclasses,sw_showmenuoneveryspawn,sw_weaponSoundsEnabled,sw_charSoundsEnabled,sw_lasers_enabled,sw_jabbaLaughEnabled
- player = playerlib.getPlayer(userid)
- if choice == 1:
- if check1 == 1:
- sw_jediModeEnabled = 0
- es.msg('#multi', text('admin1',{},player.get('lang')))
- else:
- sw_jediModeEnabled = 1
- es.msg('#multi', text('admin2',{},player.get('lang')))
- elif choice == 2:
- if check2 == 1:
- sw_bobaJetsEnabled = 0
- es.msg('#multi', text('admin3',{},player.get('lang')))
- else:
- sw_bobaJetsEnabled = 1
- es.msg('#multi', text('admin4',{},player.get('lang')))
- elif choice == 3:
- if check3 == 1:
- sw_randomclasses = 0
- es.msg('#multi', text('admin5',{},player.get('lang')))
- else:
- sw_randomclasses = 1
- es.msg('#multi', text('admin6',{},player.get('lang')))
- elif choice == 4:
- if check4 == 1:
- sw_showmenuoneveryspawn = 0
- es.msg('#multi', text('admin7',{},player.get('lang')))
- else:
- sw_showmenuoneveryspawn = 1
- es.msg('#multi', text('admin8',{},player.get('lang')))
- elif choice == 5:
- if check5 == 1:
- sw_weaponSoundsEnabled = 0
- es.msg('#multi', text('admin9',{},player.get('lang')))
- else:
- sw_weaponSoundsEnabled = 1
- es.msg('#multi', text('admin10',{},player.get('lang')))
- elif choice == 6:
- if check6 == 1:
- sw_charSoundsEnabled = 0
- es.msg('#multi', text('admin11',{},player.get('lang')))
- else:
- sw_charSoundsEnabled = 1
- es.msg('#multi', text('admin12',{},player.get('lang')))
- elif choice == 7:
- if check7 == 1:
- sw_lasers_enabled = 0
- es.msg('#multi', text('admin13',{},player.get('lang')))
- else:
- sw_lasers_enabled = 1
- es.msg('#multi', text('admin14',{},player.get('lang')))
- elif choice == 8:
- if check8 == 1:
- sw_jabbaLaughEnabled = 0
- es.msg('#multi', text('admin15',{},player.get('lang')))
- else:
- sw_jabbaLaughEnabled = 1
- es.msg('#multi', text('admin16',{},player.get('lang')))
- def empireMenuShow(userid, steam):
- global empirePopup
- if popuplib.exists('empirePopup'):
- popuplib.delete('empirePopup')
- empirePopup = popuplib.create('empirePopup')
- empirePopup.addline('Choose a Class (Empire):')
- empirePopup.addline(' ')
- if empire_model_features.has_key(steam):
- if empire_model_features[steam] == 0:
- empirePopup.addline('Your Current Class is: None')
- elif empire_model_features[steam] == 1:
- empirePopup.addline('Your Current Class is: Storm Trooper')
- elif empire_model_features[steam] == 2:
- empirePopup.addline('Your Current Class is: Snow Trooper')
- elif empire_model_features[steam] == 3:
- empirePopup.addline('Your Current Class is: Rodian')
- elif empire_model_features[steam] == 4:
- empirePopup.addline('Your Current Class is: Imperial Officer')
- elif empire_model_features[steam] == 5:
- empirePopup.addline('Your Current Class is: Boba Fett')
- if sw_jediModeEnabled == 1:
- if empire_model_features[steam] == 6:
- rebelPopup.addline('Your Current Class is: Darth Vader')
- empirePopup.addline(' ')
- empirePopup.addline('->1. Storm Trooper')
- empirePopup.addline('->2. Snow Trooper')
- empirePopup.addline('->3. Rodian')
- empirePopup.addline('->4. Imperial Officer')
- empirePopup.addline('->5. Boba Fett')
- if sw_jediModeEnabled == 1:
- empirePopup.addline('->6. Darth Vader')
- empirePopup.addline(' ')
- empirePopup.addline('0. Exit')
- empirePopup.send(int(userid))
- empirePopup.menuselect = empirePopup_select
- def rebelPopup_select(userid, choice, popupid):
- steam = es.getplayersteamid(userid)
- player = playerlib.getPlayer(userid)
- if not wanted_rebel.has_key(steam):
- wanted_rebel[steam] = 0
- if not rebel_model_features.has_key(steam):
- rebel_model_features[steam] = 0
- if choice == 1:
- wanted_rebel[steam] = rebelsoldiermodel
- classname_dict[userid] = 'Rebel'
- rebel_model_features[steam] = 1
- change_skin_rebel(userid,steam)
- es.tell(userid, '#multi', text('cho1',{'classn': classname_dict[userid]},player.get('lang')))
- elif choice == 2:
- wanted_rebel[steam] = wookiemodel
- classname_dict[userid] = 'Wookie'
- rebel_model_features[steam] = 2
- change_skin_rebel(userid,steam)
- es.tell(userid, '#multi', text('cho1',{'classn': classname_dict[userid]},player.get('lang')))
- elif choice == 3:
- wanted_rebel[steam] = jawamodel
- classname_dict[userid] = 'Jawa'
- rebel_model_features[steam] = 3
- change_skin_rebel(userid,steam)
- es.tell(userid, '#multi', text('cho1',{'classn': classname_dict[userid]},player.get('lang')))
- elif choice == 4:
- wanted_rebel[steam] = tuskenmodel
- classname_dict[userid] = 'Tuske'
- rebel_model_features[steam] = 4
- change_skin_rebel(userid,steam)
- es.tell(userid, '#multi', text('cho1',{'classn': classname_dict[userid]},player.get('lang')))
- elif choice == 5:
- wanted_rebel[steam] = c3pomodel
- classname_dict[userid] = 'C3PO'
- rebel_model_features[steam] = 5
- change_skin_rebel(userid,steam)
- es.tell(userid, '#multi', text('cho1',{'classn': classname_dict[userid]},player.get('lang')))
- elif choice == 6:
- if sw_jediModeEnabled == 1:
- wanted_rebel[steam] = yodamodel
- classname_dict[userid] = 'Yoda'
- rebel_model_features[steam] = 6
- change_skin_rebel(userid,steam)
- es.tell(userid, '#multi', text('cho1',{'classn': classname_dict[userid]},player.get('lang')))
- def empirePopup_select(userid, choice, popupid):
- player = playerlib.getPlayer(userid)
- steam = es.getplayersteamid(userid)
- if not wanted_empire.has_key(steam):
- wanted_empire[steam] = 0
- if not empire_model_features.has_key(steam):
- empire_model_features[steam] = 0
- if choice == 1:
- wanted_empire[steam] = stormtroopermodel
- classname_dict[userid] = 'Stormtrooper'
- empire_model_features[steam] = 1
- change_skin_empire(userid,steam)
- es.tell(userid, '#multi', text('cho1',{'classn': classname_dict[userid]},player.get('lang')))
- elif choice == 2:
- wanted_empire[steam] = snowtroopermodel
- classname_dict[userid] = 'Snowtrooper'
- empire_model_features[steam] = 2
- change_skin_empire(userid,steam)
- es.tell(userid, '#multi', text('cho1',{'classn': classname_dict[userid]},player.get('lang')))
- elif choice == 3:
- wanted_empire[steam] = rodianmodel
- classname_dict[userid] = 'Rodian'
- empire_model_features[steam] = 3
- change_skin_empire(userid,steam)
- es.tell(userid, '#multi', text('cho1',{'classn': classname_dict[userid]},player.get('lang')))
- elif choice == 4:
- wanted_empire[steam] = officermodel
- classname_dict[userid] = 'Officer'
- empire_model_features[steam] = 4
- change_skin_empire(userid,steam)
- es.tell(userid, '#multi', text('cho1',{'classn': classname_dict[userid]},player.get('lang')))
- elif choice == 5:
- wanted_empire[steam] = bobamodel
- classname_dict[userid] = 'Boba Fett'
- empire_model_features[steam] = 5
- change_skin_empire(userid,steam)
- es.tell(userid, '#multi', text('cho1',{'classn': classname_dict[userid]},player.get('lang')))
- elif choice == 6:
- if sw_jediModeEnabled == 1:
- wanted_empire[steam] = vadermodel
- classname_dict[userid] = 'Vader'
- empire_model_features[steam] = 6
- change_skin_empire(userid,steam)
- es.tell(userid, '#multi', text('cho1',{'classn': classname_dict[userid]},player.get('lang')))
- def change_skin_rebel(userid, steam):
- player = playerlib.getPlayer(userid)
- if rebel_model_features.has_key(steam):
- playerlib.getPlayer(userid).setModel(wanted_rebel[steam])
- if sw_jediModeEnabled == 0:
- if rebel_model_features.has_key(steam):
- if rebel_model_features[steam] == 6:
- randomclasshb = random.randint(1, 5)
- if randomclasshb == 1:
- rebel_model_features[steam] = 1
- wanted_rebel[steam] = rebelsoldiermodel
- classname_dict[userid] = 'Rebel'
- es.tell(userid, '#multi', text('crsw',{'classn': classname_dict[userid]},player.get('lang')))
- elif randomclasshb == 2:
- rebel_model_features[steam] = 2
- wanted_rebel[steam] = wookiemodel
- classname_dict[userid] = 'Wookie'
- es.tell(userid, '#multi', text('crsw',{'classn': classname_dict[userid]},player.get('lang')))
- elif randomclasshb == 3:
- rebel_model_features[steam] = 3
- wanted_rebel[steam] = jawamodel
- classname_dict[userid] = 'Jawa'
- es.tell(userid, '#multi', text('crsw',{'classn': classname_dict[userid]},player.get('lang')))
- elif randomclasshb == 4:
- rebel_model_features[steam] = 4
- wanted_rebel[steam] = tuskenmodel
- classname_dict[userid] = 'Tuske'
- es.tell(userid, '#multi', text('crsw',{'classn': classname_dict[userid]},player.get('lang')))
- elif randomclasshb == 5:
- rebel_model_features[steam] = 5
- wanted_rebel[steam] = c3pomodel
- classname_dict[userid] = 'C3PO'
- es.tell(userid, '#multi', text('crsw',{'classn': classname_dict[userid]},player.get('lang')))
- def player_hurt(ev):
- steam = ev['es_steamid']
- if sw_more_damage_for_jedi == 1:
- if ev['weapon'] == 'knife':
- if rebel_model_features.has_key(steam):
- if rebel_model_features[steam] == 6:
- playerlib.getPlayer(ev['userid']).health -= int(sw_jedi_damage_by_knife)
- if empire_model_features.has_key(steam):
- if empire_model_features[steam] == 6:
- playerlib.getPlayer(ev['userid']).health -= int(sw_jedi_damage_by_knife)
- def change_skin_empire(userid, steam):
- player = playerlib.getPlayer(userid)
- if empire_model_features.has_key(steam):
- playerlib.getPlayer(userid).setModel(wanted_empire[steam])
- if sw_jediModeEnabled == 0:
- if empire_model_features.has_key(steam):
- if empire_model_features[steam] == 6:
- randomclassch = random.randint(1, 5)
- if randomclassch == 1:
- empire_model_features[steam] = 1
- wanted_empire[steam] = stormtroopermodel
- classname_dict[userid] = 'Stormtrooper'
- es.tell(userid, '#multi', text('crsw',{'classn': classname_dict[userid]},player.get('lang')))
- elif randomclassch == 2:
- empire_model_features[steam] = 2
- wanted_empire[steam] = snowtroopermodel
- classname_dict[userid] = 'Snowtrooper'
- es.tell(userid, '#multi', text('crsw',{'classn': classname_dict[userid]},player.get('lang')))
- elif randomclassch == 3:
- empire_model_features[steam] = 3
- wanted_empire[steam] = rodianmodel
- classname_dict[userid] = 'Rodian'
- es.tell(userid, '#multi', text('crsw',{'classn': classname_dict[userid]},player.get('lang')))
- elif randomclassch == 4:
- empire_model_features[steam] = 4
- wanted_empire[steam] = officermodel
- classname_dict[userid] = 'Officer'
- es.tell(userid, '#multi', text('crsw',{'classn': classname_dict[userid]},player.get('lang')))
- elif randomclassch == 5:
- empire_model_features[steam] = 5
- wanted_empire[steam] = bobamodel
- classname_dict[userid] = 'Boba Fett'
- es.tell(userid, '#multi', text('crsw',{'classn': classname_dict[userid]},player.get('lang')))
- def player_disconnect(ev):
- steam = ev['networkid']
- userid = ev['userid']
- if empire_model_features.has_key(steam):
- del empire_model_features[steam]
- if rebel_model_features.has_key(steam):
- del rebel_model_features[steam]
- if wanted_empire.has_key(steam):
- del wanted_empire[steam]
- if wanted_empire.has_key(steam):
- del wanted_empire[steam]
- if classname_dict.has_key(userid):
- del classname_dict[userid]
- def player_jump(ev):
- userid = ev['userid']
- steam = ev['es_steamid']
- player = playerlib.getPlayer(userid)
- if sw_bobaJetsEnabled == 1:
- if empire_model_features.has_key(steam):
- if empire_model_features[steam] == 5:
- player.set('jetpack', 1)
- es.emitsound("player", userid, "sw/weapons/boba/bf_flame.mp3", 1.0, 0.5)
- gamethread.delayed(sw_bobaJetstime, player.set,('jetpack', 0))
- def weapon_fire(ev):
- global weaponvector
- userid = ev['userid']
- if ev['weapon'] == 'knife':
- if sw_weaponSoundsEnabled == 1:
- randomknifesound = random.randint(1, 4)
- if randomknifesound == 1:
- es.emitsound("player", userid, "sw/weapons/saber/saberhup1.mp3", 1.0, 0.5)
- elif randomknifesound == 2:
- es.emitsound("player", userid, "sw/weapons/saber/saberhup2.mp3", 1.0, 0.5)
- elif randomknifesound == 3:
- es.emitsound("player", userid, "sw/weapons/saber/saberhup3.mp3", 1.0, 0.5)
- elif randomknifesound == 4:
- es.emitsound("player", userid, "sw/weapons/saber/saberhup4.mp3", 1.0, 0.5)
- x,y,z = es.getplayerlocation(userid)
- z = z + 50
- weaponvector = es.createvectorstring(x,y,z)
- def player_death(ev):
- userid = ev['userid']
- steam = ev['es_steamid']
- if sw_charSoundsEnabled == 1:
- if rebel_model_features.has_key(steam):
- if rebel_model_features[steam] == 2:
- soundchew1 = random.randint(1, 3)
- if soundchew1 == 1:
- es.emitsound("player", userid, "sw/char/chewbacca/death1.mp3", 1.0, 0.5)
- elif soundchew1 == 2:
- es.emitsound("player", userid, "sw/char/chewbacca/death2.mp3", 1.0, 0.5)
- elif soundchew1 == 3:
- es.emitsound("player", userid, "sw/char/chewbacca/death3.mp3", 1.0, 0.5)
- elif rebel_model_features[steam] == 3:
- soundjawa1 = random.randint(1, 3)
- if soundjawa1 == 1:
- es.emitsound("player", userid, "sw/char/jawa/death1.mp3", 1.0, 0.5)
- elif soundjawa1 == 2:
- es.emitsound("player", userid, "sw/char/jawa/death2.mp3", 1.0, 0.5)
- elif soundjawa1 == 3:
- es.emitsound("player", userid, "sw/char/jawa/death3.mp3", 1.0, 0.5)
- elif rebel_model_features[steam] == 4:
- soundtus1 = random.randint(1, 2)
- if soundtus1 == 1:
- es.emitsound("player", userid, "sw/char/tusken/death1.mp3", 1.0, 0.5)
- elif soundtus1 == 2:
- es.emitsound("player", userid, "sw/char/tusken/death2.mp3", 1.0, 0.5)
- if int(ev['headshot']):
- if rebel_model_features.has_key(steam):
- if rebel_model_features[steam] == 2:
- soundchew2 = random.randint(1, 2)
- if soundchew2 == 1:
- es.emitsound("player", userid, "sw/char/chewbacca/taunt.mp3", 1.0, 0.5)
- elif soundchew2 == 2:
- es.emitsound("player", userid, "sw/char/chewbacca/victory1.mp3", 1.0, 0.5)
- elif rebel_model_features[steam] == 3:
- soundjawa2 = random.randint(1, 3)
- if soundjawa2 == 1:
- es.emitsound("player", userid, "sw/char/jawa/jawa1.wav", 1.0, 0.5)
- elif soundjawa2 == 2:
- es.emitsound("player", userid, "sw/char/jawa/victory2.mp3", 1.0, 0.5)
- elif rebel_model_features[steam] == 4:
- soundtus2 = random.randint(1, 2)
- if soundtus2 == 1:
- es.emitsound("player", userid, "sw/char/yoda/anger1.mp3", 1.0, 0.5)
- elif soundtus2 == 2:
- es.emitsound("player", userid, "sw/char/yoda/anger2.mp3", 1.0, 0.5)
- elif rebel_model_features[steam] == 6:
- soundjod = random.randint(1, 2)
- if soundjod == 1:
- es.emitsound("player", userid, "sw/char/yoda/laugh1.wav", 1.0, 0.5)
- elif soundjod == 2:
- es.emitsound("player", userid, "sw/char/yoda/laugh2.wav", 1.0, 0.5)
- def bullet_impact(ev):
- global SoundPlayed, weaponvector
- userid = ev['userid']
- team = es.getplayerteam(userid)
- steam = ev['es_steamid']
- SoundPlayed = 0
- if empire_model_features.has_key(steam):
- if sw_weaponSoundsEnabled == 1:
- if empire_model_features[steam] == 6:
- randomsound1 = random.randint(1, 4)
- if randomsound1 == 1:
- es.emitsound("player", userid, "sw/weapons/force/lightning.mp3", 1.0, 0.5)
- elif randomsound1 == 2:
- es.emitsound("player", userid, "sw/weapons/force/lightninghit1.mp3", 1.0, 0.5)
- elif randomsound1 == 3:
- es.emitsound("player", userid, "sw/weapons/force/lightninghit2.mp3", 1.0, 0.5)
- elif randomsound1 == 4:
- es.emitsound("player", userid, "sw/weapons/force/lightninghit3.mp3", 1.0, 0.5)
- SoundPlayed = 1
- if rebel_model_features.has_key(steam):
- if sw_weaponSoundsEnabled == 1:
- if rebel_model_features[steam] == 6:
- randomsound2 = random.randint(1, 4)
- if randomsound2 == 1:
- es.emitsound("player", userid, "sw/weapons/force/lightning.mp3", 1.0, 0.5)
- elif randomsound2 == 2:
- es.emitsound("player", userid, "sw/weapons/force/lightninghit1.mp3", 1.0, 0.5)
- elif randomsound2 == 3:
- es.emitsound("player", userid, "sw/weapons/force/lightninghit2.mp3", 1.0, 0.5)
- elif randomsound2 == 4:
- es.emitsound("player", userid, "sw/weapons/force/lightninghit3.mp3", 1.0, 0.5)
- SoundPlayed = 1
- if SoundPlayed != 1:
- if sw_weaponSoundsEnabled == 1:
- randomsound3 = random.randint(1, 4)
- if randomsound3 == 1:
- es.emitsound("player", userid, "sw/weapons/blaster/fire.mp3", 1.0, 0.5)
- elif randomsound3 != 1:
- es.emitsound("player", userid, "sw/weapons/blaster/alt_fire.mp3", 1.0, 0.5)
- weaponvector2 = es.createvectorstring(ev["x"],ev["y"],ev["z"])
- premodel = es.precachemodel(effecttype)
- if sw_lasers_enabled == 1:
- if team == 3:
- es.server.queuecmd("es_effect beam %s %s %s %s 0 0.2 0.1 6 6 0 0 0 0 255 255 100" % (weaponvector, weaponvector2, premodel, premodel))
- elif team == 2:
- es.server.queuecmd("es_effect beam %s %s %s %s 0 0.2 0.1 6 6 0 0 255 0 0 255 100" % (weaponvector, weaponvector2, premodel, premodel))
- def player_team(ev):
- userid = ev['userid']
- team = es.getplayerteam(int(userid))
- steam = es.getplayersteamid(userid)
- if team == 2:
- rebelMenuShow(userid, steam)
- if empire_model_features.has_key(steam):
- del empire_model_features[steam]
- if team == 3:
- empireMenuShow(userid, steam)
- if rebel_model_features.has_key(steam):
- del rebel_model_features[steam]
- def bomb_beginplant(ev):
- userid = ev['userid']
- steam = ev['es_steamid']
- if rebel_model_features.has_key(steam):
- if rebel_model_features[steam] == 2:
- es.emitsound("player", userid, "sw/char/chewbacca/chewbacca1.wav", 1.0, 0.5)
- elif rebel_model_features[steam] == 3:
- es.emitsound("player", userid, "sw/char/jawa/chatter2.mp3", 1.0, 0.5)
- elif rebel_model_features[steam] == 4:
- es.emitsound("player", userid, "sw/char/tusken/confuse1.mp3", 1.0, 0.5)
- def bomb_planted(ev):
- userid = ev['userid']
- steam = ev['es_steamid']
- if rebel_model_features.has_key(steam):
- if rebel_model_features[steam] == 2:
- es.emitsound("player", userid, "sw/char/chewbacca/taunt.mp3", 1.0, 0.5)
- elif rebel_model_features[steam] == 3:
- es.emitsound("player", userid, "sw/char/jawa/victory2.mp3", 1.0, 0.5)
- elif rebel_model_features[steam] == 4:
- es.emitsound("player", userid, "sw/char/tusken/taunt.mp3", 1.0, 0.5)
- elif rebel_model_features[steam] == 6:
- es.emitsound("player", userid, "sw/char/yoda/laugh1.wav", 1.0, 0.5)
- def bomb_explode(ev):
- if sw_jabbaLaughEnabled == 1:
- for userid in es.getUseridList():
- gamethread.delayed(1, es.playsound,(userid, 'sw/char/jabba/laugh1.wav', 1.0))
- def player_say(ev):
- userid = ev['userid']
- team = es.getplayerteam(userid)
- steam = es.getplayersteamid(userid)
- text = ev['text']
- player = playerlib.getPlayer(userid)
- if text == '!swmenu':
- if team == 2:
- rebelMenuShow(userid, steam)
- if team == 3:
- empireMenuShow(userid, steam)
- if text == '!swadmin':
- if steam in sw_admins:
- adminMenu(userid, steam)
- else:
- es.tell(userid, '#multi', text('notallowed',{},player.get('lang')))
- def player_spawn(ev):
- userid = ev['userid']
- steam = ev['es_steamid']
- team = es.getplayerteam(userid)
- player = playerlib.getPlayer(userid)
- if team == 2:
- if wanted_rebel.has_key(steam):
- change_skin_rebel(userid ,steam)
- if rebel_model_features.has_key(steam):
- if rebel_model_features[steam] == 1:
- classname_dict[userid] = 'Rebel'
- es.tell(userid, '#multi', text('cho1',{'classn': classname_dict[userid]},player.get('lang')))
- if rebel_model_features[steam] == 2:
- classname_dict[userid] = 'Wookie'
- es.tell(userid, '#multi', text('cho1',{'classn': classname_dict[userid]},player.get('lang')))
- if rebel_model_features[steam] == 3:
- classname_dict[userid] = 'Jawa'
- es.tell(userid, '#multi', text('cho1',{'classn': classname_dict[userid]},player.get('lang')))
- if rebel_model_features[steam] == 4:
- classname_dict[userid] = 'Tuske'
- es.tell(userid, '#multi', text('cho1',{'classn': classname_dict[userid]},player.get('lang')))
- if rebel_model_features[steam] == 5:
- classname_dict[userid] = 'C3PO'
- es.tell(userid, '#multi', text('cho1',{'classn': classname_dict[userid]},player.get('lang')))
- if sw_jediModeEnabled == 1:
- if rebel_model_features[steam] == 6:
- classname_dict[userid] = 'Yoda'
- es.tell(userid, '#multi', text('cho1',{'classn': classname_dict[userid]},player.get('lang')))
- else:
- if sw_randomclasses == 1:
- randomclass1 = random.randint(1, 6)
- if randomclass1 == 1:
- rebel_model_features[steam] = 1
- wanted_rebel[steam] = rebelsoldiermodel
- classname_dict[userid] = 'Rebel'
- es.tell(userid, '#multi', text('crsw',{'classn': classname_dict[userid]},player.get('lang')))
- elif randomclass1 == 2:
- rebel_model_features[steam] = 2
- wanted_rebel[steam] = wookiemodel
- classname_dict[userid] = 'Wookie'
- es.tell(userid, '#multi', text('crsw',{'classn': classname_dict[userid]},player.get('lang')))
- elif randomclass1 == 3:
- rebel_model_features[steam] = 3
- wanted_rebel[steam] = jawamodel
- classname_dict[userid] = 'Jawa'
- es.tell(userid, '#multi', text('crsw',{'classn': classname_dict[userid]},player.get('lang')))
- elif randomclass1 == 4:
- rebel_model_features[steam] = 4
- wanted_rebel[steam] = tuskenmodel
- classname_dict[userid] = 'Tuske'
- es.tell(userid, '#multi', text('crsw',{'classn': classname_dict[userid]},player.get('lang')))
- elif randomclass1 == 5:
- rebel_model_features[steam] = 5
- wanted_rebel[steam] = c3pomodel
- classname_dict[userid] = 'C3PO'
- es.tell(userid, '#multi', text('crsw',{'classn': classname_dict[userid]},player.get('lang')))
- if sw_jediModeEnabled == 1:
- if randomclass1 == 6:
- rebel_model_features[steam] = 6
- wanted_rebel[steam] = yodamodel
- classname_dict[userid] = 'Yoda'
- es.tell(userid, '#multi', text('crsw',{'classn': classname_dict[userid]},player.get('lang')))
- rebelMenuShow(userid, steam)
- if sw_showmenuoneveryspawn == 1:
- rebelMenuShow(userid, steam)
- if team == 3:
- if wanted_empire.has_key(steam):
- change_skin_empire(userid, steam)
- if empire_model_features.has_key(steam):
- if empire_model_features[steam] == 1:
- classname_dict[userid] = 'Stormtrooper'
- es.tell(userid, '#multi', text('cho1',{'classn': classname_dict[userid]},player.get('lang')))
- if empire_model_features[steam] == 2:
- classname_dict[userid] = 'Snowtrooper'
- es.tell(userid, '#multi', text('cho1',{'classn': classname_dict[userid]},player.get('lang')))
- if empire_model_features[steam] == 3:
- classname_dict[userid] = 'Rodian'
- es.tell(userid, '#multi', text('cho1',{'classn': classname_dict[userid]},player.get('lang')))
- if empire_model_features[steam] == 4:
- classname_dict[userid] = 'Officer'
- es.tell(userid, '#multi', text('cho1',{'classn': classname_dict[userid]},player.get('lang')))
- if empire_model_features[steam] == 5:
- classname_dict[userid] = 'Boba Fett'
- es.tell(userid, '#multi', text('cho1',{'classn': classname_dict[userid]},player.get('lang')))
- if sw_bobaJetsEnabled == 1:
- es.tell(userid, '#multi', text('cho1',{'classn': classname_dict[userid]},player.get('lang')))
- if sw_jediModeEnabled == 1:
- if empire_model_features[steam] == 6:
- classname_dict[userid] = 'Vader'
- es.tell(userid, '#multi', text('cho1',{'classn': classname_dict[userid]},player.get('lang')))
- else:
- if sw_randomclasses == 1:
- randomclass2 = random.randint(1, 6)
- if randomclass2 == 1:
- empire_model_features[steam] = 1
- wanted_empire[steam] = stormtroopermodel
- classname_dict[userid] = 'Stormtrooper'
- es.tell(userid, '#multi', text('crsw',{'classn': classname_dict[userid]},player.get('lang')))
- elif randomclass2 == 2:
- empire_model_features[steam] = 2
- wanted_empire[steam] = snowtroopermodel
- classname_dict[userid] = 'Snowtrooper'
- es.tell(userid, '#multi', text('crsw',{'classn': classname_dict[userid]},player.get('lang')))
- elif randomclass2 == 3:
- empire_model_features[steam] = 3
- wanted_empire[steam] = rodianmodel
- classname_dict[userid] = 'Rodian'
- es.tell(userid, '#multi', text('crsw',{'classn': classname_dict[userid]},player.get('lang')))
- elif randomclass2 == 4:
- empire_model_features[steam] = 4
- wanted_empire[steam] = officermodel
- classname_dict[userid] = 'Officer'
- es.tell(userid, '#multi', text('crsw',{'classn': classname_dict[userid]},player.get('lang')))
- elif randomclass2 == 5:
- empire_model_features[steam] = 5
- wanted_empire[steam] = bobamodel
- classname_dict[userid] = 'Boba Fett'
- es.tell(userid, '#multi', text('crsw',{'classn': classname_dict[userid]},player.get('lang')))
- if sw_bobaJetsEnabled == 1:
- es.tell(userid, '#multi', text('crsw',{'classn': classname_dict[userid]},player.get('lang')))
- if sw_jediModeEnabled == 1:
- if randomclass2 == 6:
- empire_model_features[steam] = 6
- wanted_empire[steam] = vadermodel
- classname_dict[userid] = 'Vader'
- es.tell(userid, '#multi', text('crsw',{'classn': classname_dict[userid]},player.get('lang')))
- empireMenuShow(userid, steam)
- if sw_showmenuoneveryspawn == 1:
- empireMenuShow(userid, steam)
Add Comment
Please, Sign In to add comment