GSC Shoot Power Ups

BaDSooD

Old CCM Member
Premium Member
Messages
594
Points
688
Hello,I give you a shoot power ups function. Work on (ZM)
Code:
Toggle_ShootPowerUps()
{
    self notify("StopShootPowerUps");
    if(!isDefined(self.ShootPowerUps))
        self.ShootPowerUps = false;
    if (!isDefined(level.zombie_include_powerups) || (level.zombie_include_powerups.size <= 0))     
    {
        self.ShootPowerUps = false;
        S("Power Ups ^1Not Supported ^7On This Map");
    }
    else
    {
        self.ShootPowerUps = !self.ShootPowerUps;
        if(self.ShootPowerUps)
            self thread doShootPowerUps();
        S("Shoot PowerUps " + (self.ShootPowerUps ? "^2ON" : "^1OFF"));
    }
}

doShootPowerUps()
{
    self notify("StopShootPowerUps");
    self endon("StopShootPowerUps");
    self endon("disconnect");
    self endon("death");
    level endon("game_ended");
    powerups = getarraykeys(level.zombie_include_powerups);
    while(isDefined(self.ShootPowerUps) && self.ShootPowerUps)
    {
        for(i = 0; i < powerups.size; i++)
        {
            self waittill("weapon_fired");
            level.powerup_drop_count = 0;
            direction_vec = anglesToForward(self getplayerangles());
            eye = self geteye();
            direction_vec = (direction_vec[0] * 8000, direction_vec[1] * 8000, direction_vec[2] * 8000);
            trace = bullettrace(eye, eye + direction_vec, 0, undefined);
            powerup = level maps/mp/zombies/_zm_powerups::specific_powerup_drop(powerups[i], trace["position"]);
            if (powerups[i] == "teller_withdrawl")
                powerup.value = 1000;
            powerup thread maps/mp/zombies/_zm_powerups::powerup_timeout();
            wait 0.1;
        }
    }
}
Function By : CabCon
 

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
4,616
Points
828
Hello,I give you a shoot power ups function. Work on (ZM)
Code:
Toggle_ShootPowerUps()
{
    self notify("StopShootPowerUps");
    if(!isDefined(self.ShootPowerUps))
        self.ShootPowerUps = false;
    if (!isDefined(level.zombie_include_powerups) || (level.zombie_include_powerups.size <= 0))    
    {
        self.ShootPowerUps = false;
        S("Power Ups ^1Not Supported ^7On This Map");
    }
    else
    {
        self.ShootPowerUps = !self.ShootPowerUps;
        if(self.ShootPowerUps)
            self thread doShootPowerUps();
        S("Shoot PowerUps " + (self.ShootPowerUps ? "^2ON" : "^1OFF"));
    }
}

doShootPowerUps()
{
    self notify("StopShootPowerUps");
    self endon("StopShootPowerUps");
    self endon("disconnect");
    self endon("death");
    level endon("game_ended");
    powerups = getarraykeys(level.zombie_include_powerups);
    while(isDefined(self.ShootPowerUps) && self.ShootPowerUps)
    {
        for(i = 0; i < powerups.size; i++)
        {
            self waittill("weapon_fired");
            level.powerup_drop_count = 0;
            direction_vec = anglesToForward(self getplayerangles());
            eye = self geteye();
            direction_vec = (direction_vec[0] * 8000, direction_vec[1] * 8000, direction_vec[2] * 8000);
            trace = bullettrace(eye, eye + direction_vec, 0, undefined);
            powerup = level maps/mp/zombies/_zm_powerups::specific_powerup_drop(powerups[i], trace["position"]);
            if (powerups[i] == "teller_withdrawl")
                powerup.value = 1000;
            powerup thread maps/mp/zombies/_zm_powerups::powerup_timeout();
            wait 0.1;
        }
    }
}
Function By : CabCon
I like this function :grinning:
 

Top