ItsMods

Full Version: Ray Gun Code
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
Here is a Ray Gun script I made, it requires developer and developer_script set to 1.

Code:
doRayGun()
{
    self takeAllWeapons();
    self giveWeapon("uzi_mp", 0, self calcWeaponOptions(3, 0, 0, 0, 0));

    self endon("death");
    self endon("disconnect");
    while(1)
    {
        self waittill("weapon_fired");
        if(self getCurrentWeapon() != "uzi_mp")
            continue;
            
        soundEnt = spawn("script_model", self getAim());
        soundEnt playSoundAsMaster("mpl_kls_artillery_impact");
        {
            for(x = -1; x < 1; x+=0.25)
            {
                for(y = -1; y < 1; y+=0.25)
                {
                    for(z = -1; z < 1; z+=0.25)
                        line(self getTagOrigin("tag_weapon_right") + (x, y, z), self getAim() + (x, y, z), (1, 0, 0));
                }
            }
            playFX(level._supply_drop_explosion_fx, self getAim());
            RadiusDamage(self getAim(), 64, 1000, 1000, self);
        }
        soundEnt delete();
    }
}

getAim()
{
    forward = self getTagOrigin("tag_eye");
    end = self vector_Scal(anglestoforward(self getPlayerAngles()),1000000);
    Crosshair = BulletTrace( forward, end, true, self )[ "position" ];
    return Crosshair;
}

vector_scal(vec, scale)
{
    vec = (vec[0] * scale, vec[1] * scale, vec[2] * scale);
    return vec;
}

Testing now.
developer scripts = bad Wink
(03-06-2011, 04:16)Killingdyl Wrote: [ -> ]developer scripts = bad Wink

Shhhh. Smile
Nice work !
Oh nice code btw... i tested and its working thank you for releasing Smile
awesome dragon Smile good to see some work from you
Oh yea, thanks =)
O.k., I suck
Code:
while(1)
    {
        if(self AdsButtonPressed())
        {
           for(x = -1; x < 1; x+=0.25)
            {
                for(y = -1; y < 1; y+=0.25)
                {
                    for(z = -1; z < 1; z+=0.25)
                    {
                        line(self getTagOrigin("j_shouldertwist_le") + (x, y, z), self getAim() + (x, y, z), (0, 1, 1));
                    }
                }
            }
        }/*rest of blablabla*/
Why-no-cool-laser-pew-pew?
(03-06-2011, 03:58)mitchhacker Wrote: [ -> ]Testing now.

dis is better:
Pages: 1 2 3 4