SRCDS Steam group


Custom Models HL2 Deathmatch
#1
Hello,

I have an HL2 deathmatch server with which I would like to have custom player models.

I got it to the point where all the necessary files are downloading to the clients machine. This is being done with Mattie eventscripts, using the skin chooser plugin.

I then go to options in the game, and I am unable to find my custom models that I am sure are installed. I looked in the c drive, and see all the files there.

What am I doing wrong?
[Image: b_560x95.png]
Reply
#2
You have configured the skins for download, but are you sure that you have configured them for use?
Slå den med jeres fiberforbindelser...

[Image: 1308107839.png]
Reply
#3
I am sorry about the double post. Didnt remember that I posted that. Please delete the other one.

I guess I did not configure them for use. I figured it was like CSS, if they are in the directory, you would be able to choose them.

How do you configure them for use?

Thanks,
[Image: b_560x95.png]
Reply
#4
You would have somekind of "skin-manager" Mani Admin Plugin has one "built-in" but theres also some other skin managers. I have seen some of them at the eventscript's download page
Slå den med jeres fiberforbindelser...

[Image: 1308107839.png]
Reply
#5
I use the skin chooser here.

The only thing is it seems to only allow css specs like ct or t. How would I use it with HL2DM?

http://addons.eventscripts.com/addons/view/skin_chooser

It even says hl2dm in the tags. Will it work, or should I just use mani?
[Image: b_560x95.png]
Reply
#6
(02-06-2010, 07:35 AM)danooch13 Wrote:  I use the skin chooser here.

The only thing is it seems to only allow css specs like ct or t. How would I use it with HL2DM?

http://addons.eventscripts.com/addons/view/skin_chooser

It even says hl2dm in the tags. Will it work, or should I just use mani?

Note the "hl2dm" word in the Tag-line. That maybe show that it supports HL2DM Smile
Slå den med jeres fiberforbindelser...

[Image: 1308107839.png]
Reply
#7
LOL LOL....

I just said that in my post. It does not seem to work with it, because as specified in my post, you must set the skin to work with a team, such as ct or t, which hl2mp does not have....

Which do you use, if you even do?
[Image: b_560x95.png]
Reply
#8
(02-06-2010, 07:38 AM)danooch13 Wrote:  LOL LOL....

I just said that in my post. It does not seem to work with it, because as specified in my post, you must set the skin to work with a team, such as ct or t, which hl2mp does not have....

Which do you use, if you even do?

Wow sorry lol. That's my biggest fail for years.. It must be the time that are slowing my brain down.

Im gonna try to look at the files, to see if i can "implement" it to hl2dm
Slå den med jeres fiberforbindelser...

[Image: 1308107839.png]
Reply
#9
No problem, I am not a noob and make the same mistakes also.

I was looking at the python code, but unfortunately dont know enough about hl2dm to make and coding decisions.

Thanks!
[Image: b_560x95.png]
Reply
#10
(02-06-2010, 07:41 AM)danooch13 Wrote:  No problem, I am not a noob and make the same mistakes also.

I was looking at the python code, but unfortunately dont know enough about hl2dm to make and coding decisions.

Thanks!

You are the biggest noob ever! And you know what? Im a bigger one aswell Big Grin

give me a few minutes to look at the code
Slå den med jeres fiberforbindelser...

[Image: 1308107839.png]
Reply
#11
LOL I guess thats why you call yourself lol.


Trust me I am not that much of a noob...

Just a noob to certain things...

Thanks for your help.
[Image: b_560x95.png]
Reply
#12
Maybe, we should edit somethings at these lines:

Code:
if int(player.attributes['teamid']) == 2:
                player.set('model', _mdlstr(random.choice(filter(lambda x: x['type'] == 'normal_t', skin_chooser_skins))['model']))
            elif int(player.attributes['teamid']) == 3:
                player.set('model', _mdlstr(random.choice(filter(lambda x: x['type'] == 'normal_ct', skin_chooser_skins))['model']))
Slå den med jeres fiberforbindelser...

[Image: 1308107839.png]
Reply
#13
Yeah probably looks right, but the hard part is there is no team id in hl2dm.

I will look at the entire code and see what I can do also.

Let me get out of this damn office first.

Thanks again,
[Image: b_560x95.png]
Reply
#14
I think I edited the code so it will work. I will try it tonight, but look it over and let me know what you think.

Code:
# Hunter's Skin Chooser Addon
#  
# Install instructions:
#       1. Install Mattie's EventScripts 2.0 plugin:
#           http://mattie.info/cs/
#
#       2. Copy and upload this script to:
#           <gamedir>/addons/eventscripts/skin_chooser/
#
#       3. Add the following line somewhere in autoexec.cfg:
#           es_load skin_chooser
#
################################################################################​
#import EventScripts
import es
#import Libraries
import services
import popuplib
import playerlib
import gamethread
import os
import random
#import Psyco Compiler
import psyco
psyco.full()

# Addon Information
info = es.AddonInfo()
info.name = "Skin Chooser"
info.version = "2.0.0"
info.author = "Hunter"
info.url = "http://addons.eventscripts.com/addons/user/289"
info.description = "Allows players and admins to choose special skins"
info.basename = "skin_chooser"

hunter_skin_chooser_ver    = info.version
hunter_skin_chooser_text   = 'Hunters '+info.name+', www.sourceplugins.de, '+info.version+', ES 2.0.0.247+ (Python Version)'

# Server Variables
skin_chooser_download      = es.ServerVar('skin_chooser_download', '1', 'Should the files be downloaded with EventScripts?')
skin_chooser_botskins      = es.ServerVar('skin_chooser_botskins', '1', 'Should bots get random public skins?')

# Global Variables
skin_chooser_downloadables = []
skin_chooser_skins         = []
skin_chooser_players       = {}
skin_chooser_popups        = {}

def load():
    public = es.ServerVar('hu_sc', info.version, info.name)
    public.makepublic()
    
    auth = services.use('auth')
    auth.registerCapability('set_skin', auth.ADMIN)
    auth.registerCapability('admin_skins', auth.ADMIN)
    auth.registerCapability('reserved_skins', auth.POWERUSER)

    es.regcmd('skin_chooser_addskin', 'skin_chooser/addskin', 'Add a type based skin to Hostage Skins, valid types are player_hl2dm or admin_hl2dm')
    es.regcmd('skin_chooser_adddownload', 'skin_chooser/adddownload', 'Add files to Hostage Skins auto-download')
    es.regsaycmd('!skin', 'skin_chooser/skin', 'Skin Chooser Settings')
    es.regsaycmd('!setskin', 'skin_chooser/setskin', 'Skin Chooser Admin')

    es.log(hunter_skin_chooser_text)
    es.msg('#multi', '#green[SkinChooser] #defaultLoaded')
    
def unload():
    for popup in skin_chooser_popups:
        skin_chooser_popups[popup].delete()

    es.unregsaycmd('!skin')
    es.unregsaycmd('!setskin')
    es.msg('#multi', '#green[SkinChooser] #defaultUnloaded')

def es_map_start(event_var):
    if int(skin_chooser_download):
        for filename in skin_chooser_downloadables:
            es.stringtable('downloadables', filename)
    for skin in skin_chooser_skins:
        es.precachemodel(_mdlstr(skin['model']))

def es_client_command(event_var):
    if (str(event_var['command']) == '!hunter_skin_chooser_ver') or (str(event_var['command']) == '!hunter_all_ver'):
        es.cexec(int(event_var['userid']), 'echo '+hunter_skin_chooser_text)

def player_activate(event_var):
    gamethread.delayed(30, es.cexec, (int(event_var['userid']), 'echo '+hunter_skin_chooser_text))

def player_spawn(event_var):
    player = playerlib.getPlayer(event_var['userid'])
    if player and skin_chooser_skins:
        if int(player) in skin_chooser_players:
            player.set('model', _mdlstr(skin_chooser_players[int(player)]))
        elif int(skin_chooser_botskins) and int(player.attributes['isbot']) == 1:
            player.set('model', _mdlstr(random.choice(filter(lambda x: x['type'] == 'player_hl2dm', skin_chooser_skins))['model']))

def player_disconnect(event_var):
    if skin_chooser_skins:
        if int(event_var['userid']) in skin_chooser_players:
            del skin_chooser_players[int(event_var['userid'])]
        if int(event_var['userid']) in skin_chooser_popups:
            del skin_chooser_popups[int(event_var['userid'])]

def addskin():
    if int(es.getargc()) >= 3:
        skin = {'type':es.getargv(1), 'name':es.getargv(2), 'model':es.getargv(3)}
        skin_chooser_skins.append(skin)
    else:
        es.dbgmsg(0, 'Syntax: skin_chooser_addskin <type> <name> <model>')

def adddownload():
    if int(es.getargc()) == 2:
        if os.path.exists(str(es.server_var['eventscripts_gamedir'])+'/'+str(es.getargv(1))):
            skin_chooser_downloadables.append(str(es.getargv(1)))
            es.stringtable('downloadables', str(es.getargv(1)))
        else:
            es.dbgmsg(0, 'Could not add downloadable '+str(es.getargv(1))+', file not found!')
    else:
        es.dbgmsg(0, 'Syntax: skin_chooser_adddownload <file>')

def skin():
    player = playerlib.getPlayer(es.getcmduserid())
    if player:
        auth = services.use('auth')
        skin_chooser_popups[int(player)] = popuplib.easymenu('skin_chooser_%s'%int(player), None, _select_skin)
        skin_chooser_popups[int(player)]._target = player
        skin_chooser_popups[int(player)].settitle('Skin Chooser')
        skin_chooser_popups[int(player)].vguititle = 'Skin Chooser'
        skin_chooser_popups[int(player)].addoption('default', 'Default')
        for skin in skin_chooser_skins:
            if skin['type'].endswith('_hl2dm'):
                if skin['type'].startswith('player_'):
                    skin_chooser_popups[int(player)].addoption(skin['type']+skin['name'].lower(), skin['name'])
                elif skin['type'].startswith('reserved_') and auth.isUseridAuthorized(int(player), 'reserved_skins'):
                    skin_chooser_popups[int(player)].addoption(skin['type']+skin['name'].lower(), skin['name'])
                elif skin['type'].startswith('admin_') and auth.isUseridAuthorized(int(player), 'admin_skins'):
                    skin_chooser_popups[int(player)].addoption(skin['type']+skin['name'].lower(), skin['name'])
        skin_chooser_popups[int(player)].send(int(player))
        
    

def setskin():
    if int(es.getargc()) == 2 and es.getuserid(es.getargv(1)):
        player = playerlib.getPlayer(es.getcmduserid())
        target = playerlib.getPlayer(es.getuserid(es.getargv(1)))
        if player and target:
            auth = services.use('auth')
            if auth.isUseridAuthorized(int(player), 'set_skin'):
                skin_chooser_popups[0] = popuplib.easymenu("skin_chooser_admin", None, _select_skin)
                skin_chooser_popups[0]._target = target
                skin_chooser_popups[0].settitle('Set %s\'s Skin' % target.attributes['name'])
                skin_chooser_popups[0].vguititle = 'Set %s\'s Skin' % target.attributes['name']
                skin_chooser_popups[0].addoption('default', 'Default')
                for skin in skin_chooser_skins:
                    skin_chooser_popups[0].addoption(skin['type']+skin['name'].lower(), skin['name'])
                skin_chooser_popups[0].send(int(player))
            else:
                es.tell(es.getcmduserid(), '#multi', '#green[SkinChooser] #lightgreenNo permission!')
        else:
            es.tell(es.getcmduserid(), '#multi', '#green[SkinChooser] #lightgreenThis user was not found!')
    else:
        es.tell(es.getcmduserid(), '#multi', '#green[SkinChooser] #lightgreenYou need to specify a user!')

def _select_skin(userid, choice, popupid):
    player = playerlib.getPlayer(userid)
    popup = popuplib.find(popupid)
    if player and popup and popup._target:
        if choice == 'default':
            if int(popup._target) in skin_chooser_players:
                del skin_chooser_players[int(popup._target)]
        else:
            for skin in skin_chooser_skins:
                if skin['type']+skin['name'].lower() == choice:
                    skin_chooser_players[int(popup._target)] = skin['model']

def _mdlstr(model):
    if model[:7] != 'models/':
        model = 'models/'+model
    if model[-4:] != '.mdl':
        model = model + '.mdl'
    return model
[Image: b_560x95.png]
Reply
#15
It seems fine, im looking forward to hear your results Smile
Slå den med jeres fiberforbindelser...

[Image: 1308107839.png]
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)