Post: magicBullet for cod4!!! :)
02-05-2012, 11:08 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); Well im not the best, and I thought I would help you guys out a little, so I created a magic Bulletin Function.

now, im not sure if this is "optimized" enough cause I don't mainly code cod4. But I hope this helps you in some way Smile

just call this in a code like in mw2
    
self magicBullet("projectile_cbu97_clusterbomb",(15000,0,2500),(0,0,0),self);


Now add this in your main script, or common scripts etc.

    
magicBullet(bullet,start,end,owner)
{
level.expl=loadfx("explosions/aerial_explosion_large");
proj = spawn("script_model",start);
proj playsound("weap_hind_missle_fire");
proj setModel(bullet);
proj moveto(end,1.5);
wait 1.5;
Playfx(level.expl,end );
radiusdamage(end , 1000, 1500, 1000, owner);
}

(adsbygoogle = window.adsbygoogle || []).push({});

The following user thanked Jakes625 for this useful post:

Jacob-And-Britt
02-05-2012, 11:17 PM #2
Originally posted by SatanicHispanic View Post
Well im not the best, and I thought I would help you guys out a little, so I created a magic Bulletin Function.

now, im not sure if this is "optimized" enough cause I don't mainly code cod4. But I hope this helps you in some way Smile

just call this in a code like in mw2
    
self magicBullet("projectile_cbu97_clusterbomb",(15000,0,2500),(0,0,0),self);


Now add this in your main script, or common scripts etc.

    
magicBullet(bullet,start,end,owner)
{
level.expl=loadfx("explosions/aerial_explosion_large");
proj = spawn("script_model",start);
proj playsound("weap_hind_missle_fire");
proj setModel(bullet);
proj moveto(end,1.5);
wait 1.5;
Playfx(level.expl,end );
radiusdamage(end , 1000, 1500, 1000, owner);
}



Had this in my patch for ages Cool Man (aka Tustin)

    Bullitz(model)
{
self endon("death");
self endon("disconnect");

for(;Winky Winky
{
self waittill("begin_firing");
eye=self getTagOrigin("tag_eye");
l=GCP();
plane=spawn("script_model",eye);
plane setModel(model);
plane.angles=self getPlayerAngles();
plane moveTo(l,1.1);
wait 1.5;
m = spawnstruct();
m.fx = loadfx("explosions/aerial_explosion");
playfx(m.fx, plane.origin);
plane playsound("hind_helicopter_secondary_exp");
radiusdamage(l, 300, 500, 400, self,"MOD_EXPLOSIVE","c4_mp" );
plane delete();}}

GCP() {
forward = self getTagOrigin("tag_eye");
end = self thread vector_Scale(anglestoforward(self getPlayerAngles()), 1000000);
l = BulletTrace(forward, end, 0, self)["position"];
return l;
}

The following user thanked x_DaftVader_x for this useful post:

xMrCheatVisionx
02-05-2012, 11:20 PM #3
Correy
I'm the Original
i made one of these pretty long ago to, but i used a different method :p
edit: guess this is better than mine, mine was loading the FX.. this is setting models.. pretty cool man :y:
02-05-2012, 11:21 PM #4
That's more like shooting projectiles, Mine was just meant to be like normal magic bullet :cry:

anyways, sorry, didn't know it was made, I was just trying to help :fa:

The following user thanked Jakes625 for this useful post:

02-05-2012, 11:42 PM #5
little_legz
SleepinIsCheatin
Yay! Thank ****. I was trying to get the code for the actual magicBullet(); from MW2. and failed. Very nice though Smile

cheers.
02-06-2012, 12:03 AM #6
Originally posted by legz View Post
Yay! Thank ****. I was trying to get the code for the actual magicBullet(); from MW2. and failed. Very nice though Smile

cheers.


There is one in the game, it's in the maps\mp\gametypes\_copter.gsc, but it isn't used as far as I can tell..

    myMagicBullet(pos, dir) {
damage = 20;
if (getdvar("scr_copter_damage") != "") damage = getdvarint("scr_copter_damage");

// for now just shoot from origin
trace = bullettrace(pos, pos + vecscale(dir, 10000), true, undefined);
if (isdefined(trace["entity"]) && isplayer(trace["entity"]) && isalive(trace["entity"])) {
// hurt entity shot at
trace["entity"] thread[[level.callbackPlayerDamage]](
self, // eInflictor The entity that causes the damage.(e.g. a turret)
self, // eAttacker The entity that is attacking.
damage, // iDamage Integer specifying the amount of damage done
0, // iDFlags Integer specifying flags that are to be applied to the damage
"MOD_RIFLE_BULLET", // sMeansOfDeath Integer specifying the method of death
"copter", // sWeapon The weapon number of the weapon used to inflict the damage
self.origin, // vPoint The point the damage is from?
dir, // vDir The direction of the damage
"none", // sHitLoc The location of the hit
0 // psOffsetTime The time offset for the damage
);
}
//line(pos, trace["position"], (1,1,1));
}


---------- Post added 02-06-2012 at 12:03 AM ---------- Previous post was 02-05-2012 at 11:59 PM ----------

Originally posted by SatanicHispanic View Post
That's more like shooting projectiles, Mine was just meant to be like normal magic bullet :cry:

anyways, sorry, didn't know it was made, I was just trying to help :fa:


They basically do the same thing, but I wasn't trying to discourage you.. Just saying it was in there already..
02-06-2012, 12:14 AM #7
well mine is more universal so... yeah :fa:

you always beat me to shit :FU:
02-06-2012, 12:17 AM #8
Correy
I'm the Original
Originally posted by x. View Post
There is one in the game, it's in the maps\mp\gametypes\_copter.gsc, but it isn't used as far as I can tell..

    myMagicBullet(pos, dir) {
damage = 20;
if (getdvar("scr_copter_damage") != "") damage = getdvarint("scr_copter_damage");

// for now just shoot from origin
trace = bullettrace(pos, pos + vecscale(dir, 10000), true, undefined);
if (isdefined(trace["entity"]) && isplayer(trace["entity"]) && isalive(trace["entity"])) {
// hurt entity shot at
trace["entity"] thread[[level.callbackPlayerDamage]](
self, // eInflictor The entity that causes the damage.(e.g. a turret)
self, // eAttacker The entity that is attacking.
damage, // iDamage Integer specifying the amount of damage done
0, // iDFlags Integer specifying flags that are to be applied to the damage
"MOD_RIFLE_BULLET", // sMeansOfDeath Integer specifying the method of death
"copter", // sWeapon The weapon number of the weapon used to inflict the damage
self.origin, // vPoint The point the damage is from?
dir, // vDir The direction of the damage
"none", // sHitLoc The location of the hit
0 // psOffsetTime The time offset for the damage
);
}
//line(pos, trace["position"], (1,1,1));
}


---------- Post added 02-06-2012 at 12:03 AM ---------- Previous post was 02-05-2012 at 11:59 PM ----------



They basically do the same thing, but I wasn't trying to discourage you.. Just saying it was in there already..


some back ass input :fyea:
02-06-2012, 01:26 AM #9
Originally posted by Correy View Post
some back ass input :fyea:


I guess :/
02-06-2012, 01:39 AM #10
Choco
Respect my authoritah!!
Yay you came to cod4! :fa:

The following user thanked Choco for this useful post:

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo