示例#1
0
def findVirtualFunc(pointer, offset):
    '''
    Finds the virtual function by a pointer and an offset.
    '''

    if spe.platform != 'nt':
        offset += 1

    return spe.getLocVal('i', spe.getLocVal('i', pointer) + (offset * 4))
示例#2
0
def OnTick():
    for i in amounts:
        if i not in parachuted and not es.getplayerprop(i, "CBasePlayer.pl.deadflag") and spe.getLocVal("i", spe.getPlayer(i) + buttonPressedOffset) & 32 and es.getplayerprop(i, "CBasePlayer.localdata.m_Local.m_flFallVelocity") >= 1.0 and amounts[i] > 0:
            index = es.createentity("prop_dynamic_override")
            parachuted[i] = index
            es.entitysetvalue(index, "solid", 0)
            es.entitysetvalue(index, "model", random.choice(rpgParachuteModels))
            es.server.insertcmd("es_xspawnentity %i" % index)
            amounts[i] -= 1             
    for i in parachuted.copy():
        if not es.exists("userid", i) or es.getplayerprop(i, "CBasePlayer.pl.deadflag") or es.getplayerprop(i, "CBasePlayer.localdata.m_hGroundEntity") != -1 or es.getplayerprop(i, "CBasePlayer.localdata.m_nWaterLevel") > 1 or not spe.getLocVal("i", spe.getPlayer(i) + buttonPressedOffset) & 32:
            spe.removeEntityByIndex(parachuted[i])
            del parachuted[i]
        else:
            es.entitysetvalue(parachuted[i], "angles", "0 %f 0" % es.getplayerprop(i, "CCSPlayer.m_angEyeAngles[1]"))
            es.entitysetvalue(parachuted[i], "origin", es.getplayerprop(i, "CBaseEntity.m_vecOrigin").replace(",", " "))
            es.setplayerprop(i, "CBasePlayer.localdata.m_vecBaseVelocity", "0,0,%f" % es.getplayerprop(i, "CBasePlayer.localdata.m_Local.m_flFallVelocity"))
示例#3
0
# =============================================================================
# >> GLOBAL VARIABLES & INITIALIZATION
# =============================================================================
MAX_ENTITIES = 32
DATAPATH = path(__file__).parent.joinpath('data')
EFFECTS  = ConfigObj(DATAPATH.joinpath('effects.ini'))
POINTERS = ConfigObj(DATAPATH.joinpath('pointers.ini'))

if spe.platform == 'nt':
    sig, pos = POINTERS['g_TESystem']['nt']
    g_TESystem = spe.getPointer(sig, int(pos))

else:
    sym = POINTERS['g_TESystem']['linux']
    g_TESystem = spe.getLocVal('i', spe.findSymbol(sym))

spe.parseINI('_libs/python/spe_effects/data/signatures.ini')


# =============================================================================
# >> STATIC EFFECTS
# =============================================================================
def beam(users, delay, start, end, model, halo, startframe, framerate, life,
        width, endwidth, fadelength, amplitude, r, g, b, a, speed,
        parent=True, queue=True):
    '''
    This is a wrapper for beamEnts(), beamPoints() and beamEntPoint(). You can
    pass two entity indexes or an entity index and a cooardinate or even two
    coordinates.
    If you set "parent" to True, the beam is parented to the given entity