import es
import playerlib

info = es.AddonInfo()
info.name = 'Jail Skins'
info.version = '1.3'
info.url = 'http://forums.eventscripts.com/viewtopic.php?t=36797'
info.basename = 'jail_skins'
info.author = 'TheCheeTaH'

# Jail Skins Admins
# Those are the people, that wont get skins.
# To disable this, just set it to the default.
# As I wont come on your server
# To add more admins, keep the syntax
jail_skins_admin = ['STEAM_0:1:75898x73', 'STEAM_ID_PENDING', 'STEAM_ID_LAN']

def load():
    downloadit()
    es.set("jail_skins_version", 'v1.3')
    es.makepublic("jail_skins_version")
    es.msg("#multi", "#green[Jail Skins 1.3]#default Loaded")

def es_map_start(event_var):
    downloadit()

def player_spawn(event_var):
    JailTeamer = es.getplayerteam(event_var['userid'])
    steamid = event_var['es_steamid']
    if steamid not in jail_skins_admin:
        if JailTeamer == 2:
            JailPlayer = playerlib.getPlayer(event_var['userid'])
            JailPlayer.set('model', 'models/player/natalya/prison/prisoner.mdl')
        elif JailTeamer == 3:
            JailPlayer = playerlib.getPlayer(event_var['userid'])
            JailPlayer.set('model', 'models/player/elis/po/police.mdl')

def downloadit():
    es.dbgmsg(0, 'Starting Stringable-Downloadable')
    es.stringtable('downloadables', 'models/player/natalya/prison/prisoner.dx80.vtx')
    es.stringtable('downloadables', 'models/player/natalya/prison/prisoner.dx90.vtx')
    es.stringtable('downloadables', 'models/player/natalya/prison/prisoner.mdl')
    es.stringtable('downloadables', 'models/player/natalya/prison/prisoner.phy')
    es.stringtable('downloadables', 'models/player/natalya/prison/prisoner.sw.vtx')
    es.stringtable('downloadables', 'models/player/natalya/prison/prisoner.vvd')
    es.stringtable('downloadables', 'materials/models/player/natalya/prison/prisoner.vmt')
    es.stringtable('downloadables', 'materials/models/player/natalya/prison/prisoner.vtf')
    es.stringtable('downloadables', 'materials/models/player/natalya/prison/prisoner_normal.vtf')
    es.stringtable('downloadables', 'materials/models/player/elis/po/cleaner_face_e.vmt')
    es.stringtable('downloadables', 'materials/models/player/elis/po/cleaner_face_e.vtf')
    es.stringtable('downloadables', 'materials/models/player/elis/po/cleaner_face_e_n.vtf')
    es.stringtable('downloadables', 'materials/models/player/elis/po/estuche.vmt')
    es.stringtable('downloadables', 'materials/models/player/elis/po/estuche.vtf')
    es.stringtable('downloadables', 'materials/models/player/elis/po/hand_white_a.vmt')
    es.stringtable('downloadables', 'materials/models/player/elis/po/hand_white_a.vtf')
    es.stringtable('downloadables', 'materials/models/player/elis/po/hand_white_a_n.vtf')
    es.stringtable('downloadables', 'materials/models/player/elis/po/nypd_body_a_coat.vmt')
    es.stringtable('downloadables', 'materials/models/player/elis/po/nypd_body_a_coat.vtf')
    es.stringtable('downloadables', 'materials/models/player/elis/po/nypd_body_a_coat_n.vtf')
    es.stringtable('downloadables', 'materials/models/player/elis/po/nypd_legs_a.vmt')
    es.stringtable('downloadables', 'materials/models/player/elis/po/nypd_legs_a.vtf')
    es.stringtable('downloadables', 'materials/models/player/elis/po/nypd_legs_a_n.vtf')
    es.stringtable('downloadables', 'models/player/elis/po/police.dx80.vtx')
    es.stringtable('downloadables', 'models/player/elis/po/police.dx90.vtx')
    es.stringtable('downloadables', 'models/player/elis/po/police.mdl')
    es.stringtable('downloadables', 'models/player/elis/po/police.phy')
    es.stringtable('downloadables', 'models/player/elis/po/police.sw.vtx')
    es.stringtable('downloadables', 'models/player/elis/po/police.vvd')
    es.dbgmsg(0, 'Finnished Stringable-Downloadable')

def unload():
    es.msg("#multi", "#green[Jail Skins 1.3]#default Unloaded")
    es.set("jail_skins_version", 'v1.3-Unloaded')