I'm currently (by currently I mean at 6:00 am) porting my ES plugin to SP. Refactoring it, too. Everything seems to be OK, but still I've got 2 questions:
1.
Say I have entities.entity.Entity instance or just entity index. How do I gain access to its keyvalues? In ES I did something like this
Syntax: Select all
int(es.entitygetvalue(index, 'mykey'))
Note that mykey is not present in FGD and it's a non-standard key. But map creators can still set it.
2.
Help iPlayer find an alternative to this function
Syntax: Select all
def fire(*args):
args = list(args)
if not (isinstance(args[0], int) and es.exists('userid', args[0])):
args.insert(0, es.getuserid())
args = args[:5]
es.fire(*args)
Another version of this (before I figured out my Windows SRCDS actually does not crash from es.fire) ended this way:
Syntax: Select all
es.server.queuecmd('es_xfire %s' % ' '.join(map(str, args)))
To shorten this up, I have a userid/player index and I have a string that he should fire.
I don't have access (index) to entity(es) that I fire input of and I'm not sure such entity exists.
Valid code:
Syntax: Select all
fire(userid, '*', 'SetParent', '!activator')
I just have a string to fire. How do I do this?
Sorry if this been resolved somewhere, but even your Wiki can't keep up with all the changes that are going on in Source.Python.