Originally posted by nahuel
View Post

void() W_FireAxe = { local vector source; local vector org; makevectors (self.v_angle); source = self.origin + '0 0 16'; traceline (source, source + v_forward*64, FALSE, self); if (trace_fraction == 1.0) return; org = trace_endpos - v_forward*4; if (trace_ent.takedamage) { trace_ent.axhitme = 1; SpawnBlood (org, '0 0 0', 20); T_Damage (trace_ent, self, self, 20); [COLOR="Red"]// you can see here "20" is the ammount of damage[/COLOR] } else { // hit wall sound (self, CHAN_WEAPON, "player/axhit2.wav", 1, ATTN_NORM); // [COLOR="Red"]sound (self, CHAN_WEAPON, "player/axhit2.wav", 1, ATTN_NORM); you need to add your custom sound here, maybe usinf another channel (not CHAN_WEAPON, use CHAN_AUTO instead [/COLOR] WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); WriteByte (MSG_BROADCAST, TE_GUNSHOT); WriteCoord (MSG_BROADCAST, org_x); WriteCoord (MSG_BROADCAST, org_y); WriteCoord (MSG_BROADCAST, org_z); } };
else if (self.weapon == IT_SHOTGUN) { player_shot1 (); W_FireShotgun (); self.attack_finished = time + 0.5; [COLOR="Red"]//time + 0.5; is the time to "reload" the shotgun, change it[/COLOR] }
if (trace_ent.takedamage) { SpawnBlood (org, vel*0.2, damage); AddMultiDamage (trace_ent, damage); [COLOR="Red"]//you can add a little pull here maybe something like[/COLOR] [COLOR="SeaGreen"] if (self.weapon == IT_SHOTGUN) { trace_ent.velocity = (v_forward * 100.000); trace_ent.velocity_z = 50 + (random() * 500); } [/COLOR] }
FireBullets (14, dir, '0.14 0.08 0'); //[COLOR="Red"] '0.14 0.08 0' the vector to the spread!! change it [/COLOR]
.float sngoverheat
void() W_FireSuperSpikes = { local vector dir; [COLOR="SeaGreen"]if (self.sngoverheat >= 20) { self.sngoverheat = 0; self.attack_finished = time + 5; } else { self.attack_finished = time + 0.2; self.sngoverheat = self.sngoverheat + 1; }[/COLOR] sound (self, CHAN_WEAPON, "weapons/spike2.wav", 1, ATTN_NORM); self.currentammo = self.ammo_nails = self.ammo_nails - 2; dir = aim (self, 1000); launch_spike (self.origin + '0 0 16', dir); newmis.classname = "super_spike"; //so we know the difference --gnounc newmis.touch = superspike_touch; setmodel (newmis, "progs/s_spike.mdl"); setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); self.punchangle_x = -2; };
missile.velocity = missile.velocity * 1000;
.float maxspeed
if (self.super_damage_finished) { // sound and screen flash when items starts to run out if (self.super_damage_finished < time + 3) { if (self.super_time == 1) { sprint (self, "Quad Damage is wearing off\n"); stuffcmd (self, "bf\n"); sound (self, CHAN_AUTO, "items/damage2.wav", 1, ATTN_NORM); self.super_time = time + 1; } if (self.super_time < time) { self.super_time = time + 1; stuffcmd (self, "bf\n"); } } if (self.super_damage_finished < time) { // just stopped self.items = self.items - IT_QUAD; self.super_damage_finished = 0; self.super_time = 0; } if (self.super_damage_finished > time) self.effects = self.effects | EF_DIMLIGHT; else self.effects = self.effects - (self.effects & EF_DIMLIGHT); [COLOR="SeaGreen"] if (self.super_damage_finished > time) self.maxspeed = 1,5; else self.maxspeed = 1; [/COLOR] }
void() PutClientInServer = { local entity spot; self.classname = "player"; self.health = 100; [COLOR="SeaGreen"]self.maxspeed = 1; [/COLOR]
if (self.flags & FL_ONGROUND) { if (vlen(self.velocity) >= 320) { self.velocity = (self.velocity * (320/ (vlen(self.velocity)))); } }
Comment