ItsMods

Full Version: Random Player Select - New Problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Code:
SelectBossPaladin()
{
    level endon ( "game_ended" );
    level waittill("grace_period_ending");
    
    level.BossPaladin = level.alivePlayers["axis"][randomint(level.alivePlayers["axis"].size)];    
    
    Countdown = level createServerFontString("default", 1.5);
    Countdown setPoint( "CENTER", "CENTER", "CENTER", "CENTER" );
    Countdown.foreground = false;
    Countdown.hidewheninmenu = true;
    for(i=7;i>0;i--)
    {
        Countdown setText("^7SEARCHING FOR THE BOSSPALADIN: " + "^3" + i);
        wait 1;
    }    

    Countdown setText("^7THE BOSS PALADIN: " + "^9" + level.BossPaladin.name);
    wait 2;
    Countdown destroy();
    level.BossPaladin takeAllWeapons();
    level.BossPaladin clearPerks();
    level.BossPaladin thread doBossPaladin();
}

for(;;)
    {
        self waittill("spawned_player");
        self takeAllWeapons();
        self clearPerks();
        if(!isdefined(self.hud_rankscroreupdate))
        {
            self.hud_rankscroreupdate = NewScoreHudElem(self);
            self.hud_rankscroreupdate.horzAlign = "center";
            self.hud_rankscroreupdate.vertAlign = "middle";
            self.hud_rankscroreupdate.alignX = "center";
            self.hud_rankscroreupdate.alignY = "middle";
             self.hud_rankscroreupdate.x = 0;
            if( self IsSplitscreen() )
                self.hud_rankscroreupdate.y = -15;
            else
                self.hud_rankscroreupdate.y = -60;
            self.hud_rankscroreupdate.font = "default";
            self.hud_rankscroreupdate.fontscale = 2.0;
            self.hud_rankscroreupdate.archived = false;
            self.hud_rankscroreupdate.color = (0.5,0.5,0.5);
            self.hud_rankscroreupdate.alpha = 0;
            self.hud_rankscroreupdate maps\mp\gametypes\_hud::fontPulseInit();
            self.hud_rankscroreupdate.overrridewhenindemo = true;
        }
        
        if((self != level.BossPaladin && isDefined(level.BossPaladin)) || !isDefined(level.BossPaladin))
        {
            if(self.team == "axis")
            {
                self thread doPaladin();
            }
            else
            {
                self thread doJumper();
            }
            
        }
        else if(self.team == "axis" && self == level.BossPaladin)
        {
            self thread doBossPaladin();
        }    
    }      
}

?
Thx @met. Smile
Now the Paladin Boss get his Weapons, but when u gonna die u will get three weapons Sad
The Paladin(boss)/Jumper Weapon AND your default class weapons...Sad
WHY I HAVE THREE WEPS?? Sad

EDIT:
Maybe something wrong with the weapon function:

PHP Code:
Weapon(wep)
{
self endon("disconnect");
         
         
self giveWeapon(wep0);

        for(;;)
        {
         
self waittill("spawned_player");

         
self giveWeapon(wep0);
        } 

take all weapons on spawned_player and only give the allowed ones.
(03-07-2011, 12:03)SuperNovaAO Wrote: [ -> ]take all weapons on spawned_player and only give the allowed ones.

i already did but nothing happens
Remove the for loop, that means that when you spawn it will keep piling with loops that will keep giving you more and more of the same gun!
(03-07-2011, 12:41)master131 Wrote: [ -> ]Remove the for loop, that means that when you spawn it will keep piling with loops that will keep giving you more and more of the same gun!

No, doesnt work Sad
Without the for loop u dont get your Paladin/Jumper Weapon after dieing.

EDIT: After the Selecht PaladinBoss Function ive made a level notify("select_done")
And on PLayerSpawned ive made level waittill("select_done"). Maybe because this u will get your default weapons?
Pages: 1 2