Outdated Black Ops 2 Ray Gun Code

Status
Not open for further replies.

Throwie

Veteran
Messages
313
Reaction score
80
Points
803
Ray Gun Weapon
Code:
initRaygun()
{
    if(self.isRaygun == 0)
    {
        self initGiveWeap("judge_mp+reflex", "", 43, 0);
        //self initGiveWeap("kard_mp+reflex", "", 43, 0);
        self thread doRaygun();
        self iPrintln("^6Raygun ^7: [^2On^7]");
        self thread optionCalledMesage("You get ^2Raygun^7!!", 1, "^7Is this a ^0Zombie?", (0.243, 0.957, 0.545), 8);
        self.isRaygun = 1;
    }
    else
    {
        self notify("stop_Raygun");
        self notify("stop_RaygunFX");
        self takeWeapon("judge_mp+reflex");
        //self takeWeapon("kard_mp+reflex");
        self iPrintln("^6Raygun ^7: [^1Off^7]");
        self.isRaygun = 0;
    }
}

//=====[ 本体 ]=====

//発砲→メインFnction呼び出し

doRaygun()
{
    self endon("disconnect");
    self endon("stop_Raygun");
 
    self thread waitRaygunSuicide();

    for(;:wink:
    {
        self waittill("weapon_fired");
        if(self getCurrentWeapon() == "judge_mp+reflex" || self getCurrentWeapon() == "kard_mp+reflex")
        {
            self thread mainRaygun();
        }
    }
}

//メイン動作
     
mainRaygun()
{
    raygunExplode = loadfx("weapon/emp/fx_emp_explosion_equip");
    raygunExplode2 = loadfx("explosions/fx_exp_equipment_lg");
 
    weapOrigin = self getTagOrigin("tag_weapon_right");
    target = self traceBullet();

    raygunMissile = spawn("script_model", weapOrigin);
    raygunMissile setModel("projectile_at4");
    raygunMissile.killcament = raygunMissile;
    endLocation = BulletTrace(raygunMissile.origin, target, false, self)["position"];
    raygunMissile.angles = VectorToAngles(endLocation - raygunMissile.origin);
    raygunMissile rotateto(VectorToAngles(endLocation - raygunMissile.origin), 0.001);

    raygunMissile moveto(endLocation, 0.55);
    self thread raygunEffect(raygunMissile, endLocation);
    wait 0.556;
    self notify("stop_RaygunFX");
    playfx(raygunExplode, raygunMissile.origin);
    playfx(raygunExplode2, raygunMissile.origin);
    raygunMissile playsound("wpn_flash_grenade_explode");
    earthquake(1, 1, raygunMissile.origin, 300);
    raygunMissile RadiusDamage(raygunMissile.origin, 200, 200, 200, self);
    raygunMissile delete();
}

//緑のトーチEffect移動コード

raygunEffect(object, target)
{
    self endon("disconnect");
    self endon("stop_RaygunFX_Final");
    self endon("stop_Raygun");
 
    raygunLaser = loadFX("misc/fx_equip_tac_insert_light_grn");

    for(;:wink:
    {
        raygunGreen = spawnFx(raygunLaser, object.origin, VectorToAngles(target - object.origin));
        triggerFx(raygunGreen);
        wait 0.0005;
        raygunGreen delete();
    }
 
    for(;:wink:
    {
        self waittill("stop_RaygunFX");
        effect delete();
        self notify("stop_RaygunFX_Final");
    }


//Edited by @CabCon
 
Last edited by a moderator:

Inactive Account

Old CCM Member
Premium Member
Messages
480
Reaction score
240
Points
913
Please use : the code option and put you code on this(because we have code changed into smileys).
Thank's,
 
Last edited:

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
4,998
Reaction score
2,918
Points
1,053
Please use : the code option and put you code on this(because we have code changed into smileys).
Thank's,
Thank you, also move scripts in script section, but good action.



Thread moved: Script
 

Procyon

BANNED
Messages
325
Reaction score
119
Points
43
This code would freeze if used... you're missing several functions.
 

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
4,998
Reaction score
2,918
Points
1,053
This code would freeze if used... you're missing several functions.
Really. I don't test this code.



Thread closed: Code don't work.
 
Status
Not open for further replies.
Top