• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Random Player Select - New Problem
#1
Ok, im working on a new Mod. Jumpers vs Paladins.
My Problem: When you are on the Paladin Team, a random Player have to be choosed to be the Paladin Boss. But this doesnt works ... -,-
Heres the Random Function Code:

Code:
doPaladin()
{//weapon stuff}

doJumper()
{//weapon stuff}

SelectBossPaladin()
{
level endon ( "game_ended" );

level.BPaladin = randomInt(level.players.size[team.axis]);
}

doBossPaladin()
{
//weapon stuff... bla bla bla
}  


...

//ON PLAYER SPAWN:

            if(self.team == "allies")
            {
                self thread doJumper();
                
            }
            else if(self.team == "axis")
            {
                self thread doPaladin();
                
            }    
            else if(level.players[level.BPaladin] && self.team == "axis")
            {
                self thread doBossPaladin();
                
            }

//BTW:l level.BPaladin is the variable with the random number

But it doesnt works Sad
Everyone spawns as a Paladin or a Jumper
BUT NOONE IS THE BOSSPALADIN!!!
I ve tried everything. Pls help. I really dont get it.
  Reply
#2
Quote:SelectBossPaladin()
{
level endon ( "game_ended" );
if(self.team == "axis")
{
level.BPaladin = randomInt(level.players.size);
}
}
I am not sure, try it you never know.
  Reply
#3
randomPlayer = level.players[randomInt(level.players.size)];
self iPrintLnBold("The chosen player's name is " + randomPlayer.name);
randomPlayer kick();
YouTube 1: Azumikkel - Modding
YouTube 2: DerpShark - Gaming Entertainment
Website: Jensby.me
Contact: im[at]jensby.me
[-] The following 1 user says Thank You to AZUMIKKEL for this post:
  • Tomsen1410
  Reply
#4
(03-03-2011, 22:09)AZUMIKKEL Wrote: randomPlayer = level.players[randomInt(level.players.size)];
self iPrintLnBold("The chosen player's name is " + randomPlayer.name);
randomPlayer kick();

And what have i do then?

On Spawn:

if(self.player == randomPlayer)
{
doBossPaladin();
}

????

That doesnt work for me Sad
  Reply
#5
(03-03-2011, 23:00)Tomsen1410 Wrote:
(03-03-2011, 22:09)AZUMIKKEL Wrote: randomPlayer = level.players[randomInt(level.players.size)];
self iPrintLnBold("The chosen player's name is " + randomPlayer.name);
randomPlayer kick();

And what have i do then?

On Spawn:

if(self.player == randomPlayer)
{
doBossPaladin();
}

????

That doesnt work for me Sad

...
YouTube 1: Azumikkel - Modding
YouTube 2: DerpShark - Gaming Entertainment
Website: Jensby.me
Contact: im[at]jensby.me
  Reply
#6
(03-03-2011, 23:12)AZUMIKKEL Wrote:
(03-03-2011, 23:00)Tomsen1410 Wrote:
(03-03-2011, 22:09)AZUMIKKEL Wrote: randomPlayer = level.players[randomInt(level.players.size)];
self iPrintLnBold("The chosen player's name is " + randomPlayer.name);
randomPlayer kick();

And what have i do then?

On Spawn:

if(self.player == randomPlayer)
{
doBossPaladin();
}

????

That doesnt work for me Sad

...

Some help pls?^^
Didnt coded a random player choose yet. And im not that pro in coding^^

EDIT: My Problem is: How can i code, that the randomPlayer gonna play the doBossPala thread?
EDIT2:
SRY I WAS DUMP!!!
My fault^^
Sry @AZU
  Reply
#7
Code:
doRandom()
{
randomPlayer = level.players[randomInt(level.players.size)];
self iPrintLnBold("The chosen player's name is " + randomPlayer.name);
randomPlayer thread doBossPaladin();
}
Call doRandom in spawn
[Image: wyipjqo9qon7rc2v1lo.jpg]
[-] The following 2 users say Thank You to alistair3149 for this post:
  • iAegle, Tomsen1410
  Reply
#8
(03-04-2011, 10:18)alistair3149 Wrote:
Code:
doRandom()
{
randomPlayer = level.players[randomInt(level.players.size)];
self iPrintLnBold("The chosen player's name is " + randomPlayer.name);
randomPlayer thread doBossPaladin();
}
Call doRandom in spawn

Thx but ive already done it yesterday Big Grin
But thx
  Reply
#9
Ok Ive got a new Problem:

Code:
SelectBossPaladin()
{
level endon ( "game_ended" );
level waittill("grace_period_ending");
level endon("select_done");
    
    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 notify("select_done");

}

Thats the Funktion for selecting the Boss.

Code:
for(;;)
    {
        self waittill("spawned_player");
        self takeAllWeapons();
        self clearPerks();
        level waittill("select_done");
        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.name == !level.BossPaladin.name)
            {
                if(self.team == "axis")
                {
    
                self thread doPaladin();
                }
                else
                {
    
                self thread doJumper();
                }
                
            }
            else if(self.team == "axis" && self.name == level.BossPaladin.name)
            {
                self thread doBossPaladin();
            }    
            

    }  
        
}
And thats on the spawn.
It shows me with this function
Code:
Countdown setText("^7THE BOSS PALADIN: " + "^9" + level.BossPaladin.name);

that I am the Boss Pala, but it doesnt start the doBossPaladin function. Im still a normal Paladin. AND when a Jumper or a Paladin dies, and respawns two times, he will get 4 Weapons. His "normal" default weapons and the Weapons of the Jumper/Paladin...

Someone can help pls Sad
  Reply
#10
Code:
if(self.name != level.BossPaladin.name)
            {
                if(self.team == "axis")
                {
    
                self thread doPaladin();
                }
                else
                {
    
                self thread doJumper();
                }
                
            }
            else if(self.team == "axis" && self.name == level.BossPaladin.name)
            {
                self thread doBossPaladin();
            }
If this fails, something wrong with doBossblablabla
[Image: 1fxsnb.jpg]
  Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Help Android problem Yamato 12 2,783 04-25-2014, 04:49
Last Post: ScHmIdTy56789
  [Release] [SOURCE] Random Weapons. [HARD] Tony. 1 1,895 11-08-2013, 11:11
Last Post: Nekochan
  Help source random weapons [HARD] Tony. 4 1,808 11-08-2013, 05:25
Last Post: [HARD] Tony.
  Help Sentry Gun kill = Player kill Snake 8 2,255 11-07-2013, 13:41
Last Post: Nekochan
  Problem with Rain Effects on Maps mitchhacker 5 1,472 10-22-2013, 00:46
Last Post: mitchhacker
  Player can write Fl0w_.JACKDAN 2 1,095 09-19-2013, 16:36
Last Post: Fl0w_.JACKDAN
  Help choose 2 random players?(1 each team) 26hz 6 1,815 09-12-2013, 17:32
Last Post: Yamato
Rainbow [Release] MW3: Random Weapon Plugin V1 Nekochan 50 14,553 09-11-2013, 15:11
Last Post: EnVi Sweden Rocks
Exclamation [Request] Random Weapon At Spawn Scripts18 3 1,823 07-27-2013, 23:53
Last Post: DidUknowiPwn
  Help Receiving a random primary & secondary DidUknowiPwn 5 1,774 07-22-2013, 09:47
Last Post: Yamato

Forum Jump:


Users browsing this thread: 1 Guest(s)