Inside3D tutorials.
Created By: | QuakeGod |
eMail: | quakegod@telefragged.com |
Difficulty Scale: | Easy |
void() W_FireAxe = { local vector source; local vector org; makevectors (self.v_angle); source = self.origin + '0 0 16'; //you need an if else statement if (self.classtype == 0) //if you are the Quake Soldier traceline (source, source + v_forward*64, FALSE, self); //leave the same else if (self.classtype == 1) // if you are the old soldier traceline (source, source + v_forward*128, FALSE, self); //to increase range of the axe change v_forward*value higher 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); //now to increase damage, do the same thing if (self.classtype == 0) //if you are the Quake Soldier T_Damage (trace_ent, self, self, 20); //leave the same else if (self.classtype == 1) // if you are the old soldier T_Damage (trace_ent, self, self, 10); //to decrease damage, lower the last value } else { // hit wall sound (self, CHAN_WEAPON, "player/axhit2.wav", 1, ATTN_NORM); 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); } };