def voteexit_teleport(*qwp_extra): global lastvotespawn # put a tfog where the player was triggers.spawn_tfog(qc.other.origin) # if we aren't in custom mode, just find a deathmatch target # find the destination if not qc.self.target: lastvotespawn = qc.find(lastvotespawn, 'classname', 'info_player_deathmatch') if lastvotespawn == qc.world: lastvotespawn = qc.find(lastvotespawn, 'classname', 'info_player_deathmatch') t = lastvotespawn else: t = qc.find(qc.world, 'targetname', qc.self.target) if not t: qc.objerror("couldn't find target") # spawn a tfog flash in front of the destination qc.makevectors(t.mangle) org = t.origin + 32 * qc.v_forward triggers.spawn_tfog(org) triggers.spawn_tdeath(t.origin, qc.other) # move the player and lock him down for a little while if not qc.other.health: qc.other.origin = t.origin qc.other.velocity = (qc.v_forward * qc.other.velocity.x) + (qc.v_forward * qc.other.velocity.y) return qc.setorigin(qc.other, t.origin) qc.other.angles = t.mangle qc.other.fixangle = 1 # turn this way immediately qc.other.teleport_time = qc.time + 0.7 if qc.other.flags & defs.FL_ONGROUND: qc.other.flags -= defs.FL_ONGROUND qc.other.velocity = qc.v_forward * 300
def PutClientInServer(*qwp_extra): global modelindex_eyes global modelindex_player spot = engine.world s = None qc.self.classname = 'player' qc.self.health = 100 qc.self.takedamage = defs.DAMAGE_AIM qc.self.solid = defs.SOLID_SLIDEBOX qc.self.movetype = defs.MOVETYPE_WALK qc.self.show_hostile = 0 qc.self.max_health = 100 qc.self.flags = defs.FL_CLIENT qc.self.air_finished = qc.time + 12 qc.self.dmg = 2 # initial water damage qc.self.super_damage_finished = 0 qc.self.radsuit_finished = 0 qc.self.invisible_finished = 0 qc.self.invincible_finished = 0 qc.self.effects = 0 qc.self.invincible_time = 0 DecodeLevelParms() weapons.W_SetCurrentAmmo() qc.self.attack_finished = qc.time qc.self.th_pain = player.player_pain qc.self.th_die = player.PlayerDie qc.self.deadflag = defs.DEAD_NO # paustime is set by teleporters to keep the player from moving a while qc.self.pausetime = 0 spot = SelectSpawnPoint() qc.self.origin = spot.origin + Vector(0, 0, 1) qc.self.angles = spot.angles qc.self.fixangle = defs.TRUE # turn this way immediately # oh, this is a hack! qc.self.setmodel('progs/eyes.mdl') modelindex_eyes = qc.self.modelindex qc.self.setmodel('progs/player.mdl') modelindex_player = qc.self.modelindex qc.setsize(qc.self, defs.VEC_HULL_MIN, defs.VEC_HULL_MAX) qc.self.view_ofs = Vector(0, 0, 22) # Mod - Xian (May.20.97) # Bug where player would have velocity from their last kill qc.self.velocity = Vector(0, 0, 0) player.player_stand1() qc.makevectors(qc.self.angles) triggers.spawn_tfog(qc.self.origin + qc.v_forward * 20) triggers.spawn_tdeath(qc.self.origin, qc.self) # Set Rocket Jump Modifiers if qc.stof(qc.world.infokey('rj')) != 0: defs.rj = qc.stof(qc.world.infokey('rj')) if defs.deathmatch == 4: qc.self.ammo_shells = 0 if qc.stof(qc.world.infokey('axe')) == 0: qc.self.ammo_nails = 255 qc.self.ammo_shells = 255 qc.self.ammo_rockets = 255 qc.self.ammo_cells = 255 qc.self.items |= defs.IT_NAILGUN qc.self.items |= defs.IT_SUPER_NAILGUN qc.self.items |= defs.IT_SUPER_SHOTGUN qc.self.items |= defs.IT_ROCKET_LAUNCHER # self.items = self.items | IT_GRENADE_LAUNCHER; qc.self.items |= defs.IT_LIGHTNING qc.self.items = qc.self.items - (qc.self.items & (defs.IT_ARMOR1 | defs.IT_ARMOR2 | defs.IT_ARMOR3)) + defs.IT_ARMOR3 qc.self.armorvalue = 200 qc.self.armortype = 0.8 qc.self.health = 250 qc.self.items |= defs.IT_INVULNERABILITY qc.self.invincible_time = 1 qc.self.invincible_finished = qc.time + 3 if defs.deathmatch == 5: qc.self.ammo_nails = 80 qc.self.ammo_shells = 30 qc.self.ammo_rockets = 10 qc.self.ammo_cells = 30 qc.self.items |= defs.IT_NAILGUN qc.self.items |= defs.IT_SUPER_NAILGUN qc.self.items |= defs.IT_SUPER_SHOTGUN qc.self.items |= defs.IT_ROCKET_LAUNCHER qc.self.items |= defs.IT_GRENADE_LAUNCHER qc.self.items |= defs.IT_LIGHTNING qc.self.items = qc.self.items - (qc.self.items & (defs.IT_ARMOR1 | defs.IT_ARMOR2 | defs.IT_ARMOR3)) + defs.IT_ARMOR3 qc.self.armorvalue = 200 qc.self.armortype = 0.8 qc.self.health = 200 qc.self.items |= defs.IT_INVULNERABILITY qc.self.invincible_time = 1 qc.self.invincible_finished = qc.time + 3