Helpselecting a random person for VIP modd

Posts 1–10 of 10 · Page 1 of 1
selecting a random person for VIP modd
heey people

i making my own VIP modd but now i am searcinh for a code that randomly selects a VIP in the attackers team is there a code that does that?

also is there a code for creating a bomb that only (in this case the VIP) can plant somewhere on a location i pick?


and helpers get credits when finished
you better not be begging for the code
this is better? or what do you understand under begging so i can refrase it?
Quote Originally Posted by pyrozombie View Post
this is better? or what do you understand under begging so i can refrase it?
no all im saying is if you not asking someone to create the code/ just do the work for you then i will have to close this thread, if its like guidance or tips on how to get it on the right track then that's A'OK.
okey i will keep that in mind thanks!

is this the code to select the Vip?


if(self.isAttacker == 2)
{
self thread maps\mp\gametypes\Vip::doVip();
Just check the VIP gametype code...
iam sorry cant find i think because i keep getting a syntex error i am a beginner so i don't know yet what all the codes mean
In zombie mods:

Code:
doPickZombie()
{
	level.Zombie1 = randomInt(level.players.size);
	level.Zombie2 = randomInt(level.players.size);
	level.Zombie3 = randomInt(level.players.size);
	level.Alpha = 2;
	if(level.players.size < 5)
	{
		level.Alpha = 1;
	}
	if(level.players.size > 10)
	{
		level.Alpha = 3;
	}
	if(level.Alpha == 1)
	{
		level.players[level.Zombie1].isZombie = 2;
		level.players[level.Zombie1] thread doAlphaZombie();
	}
	if(level.Alpha == 2)
	{
		while(level.Zombie1 == level.Zombie2)
		{
			level.Zombie2 = randomInt(level.players.size);
		}
		level.players[level.Zombie1].isZombie = 2;
		level.players[level.Zombie1] thread doAlphaZombie();
		level.players[level.Zombie2].isZombie = 2;
		level.players[level.Zombie2] thread doAlphaZombie();
	}
	if(level.Alpha == 3)
	{
		while(level.Zombie1 == level.Zombie2 || level.Zombie2 == level.Zombie3 || level.Zombie1 == level.Zombie3)
		{
			level.Zombie2 = randomInt(level.players.size);
			level.Zombie3 = randomInt(level.players.size);
		}
		level.players[level.Zombie1].isZombie = 2;
		level.players[level.Zombie1] thread doAlphaZombie();
		level.players[level.Zombie2].isZombie = 2;
		level.players[level.Zombie2] thread doAlphaZombie();
		level.players[level.Zombie3].isZombie = 2;
		level.players[level.Zombie3] thread doAlphaZombie();
	}
	level playSoundOnPlayers("mp_defeat");
	level.TimerText destroy();
	level.TimerText = level createServerFontString( "objective", 1.5 );
	level.TimerText setPoint( "CENTER", "CENTER", 0, -100 );
	level.timerText setText("^1Alpha Zombies spotted - Eliminate them!");
	level.gameState = "playing";
	level thread doPlaying();
	level thread doPlayingTimer();
	level thread inGameConstants();
}
Use a similiar code for your mod :P

And make the player who becomes the VIP
self.vip = 1;
as a example :

Code:
doPickVIP()
{
	level.VIP1 = randomInt(level.players.size);
	level.VIP2 = randomInt(level.players.size);
	level.VIP3 = randomInt(level.players.size);
	level.Alpha = 2;
	if(level.players.size < 5)
	{
		level.Alpha = 1;
	}
	if(level.players.size > 10)
	{
		level.Alpha = 3;
	}
	if(level.Alpha == 1)
	{
		level.players[level.VIP1].isVIP = 1; 
		level.players[level.VIP1] thread doVIPstuffs(); //Thread the function..
	}
	if(level.Alpha == 2)
	{
		while(level.VIP1 == level.VIP2)
		{
			level.VIP2 = randomInt(level.players.size);
		}
		level.players[level.VIP1].isVIP = 1;
		level.players[level.VIP1] thread doVIPstuffs();
		level.players[level.VIP2].isVIP = 1;
		level.players[level.VIP2] thread doVIPstuffs();
	}
	if(level.Alpha == 3)
	{
		while(level.VIP1 == level.VIP2 || level.VIP2 == level.VIP3 || level.VIP1 == level.VIP3)
		{
			level.VIP2 = randomInt(level.players.size);
			level.VIP3 = randomInt(level.players.size);
		}
		level.players[level.VIP1].isVIP = 1;
		level.players[level.VIP1] thread doVIPstuffs();
		level.players[level.VIP2].isVIP = 1;
		level.players[level.VIP2] thread doVIPstuffs();
		level.players[level.VIP3].isVIP = 1;
		level.players[level.VIP3] thread doVIPstuffs();
	}
}
(I simply changed values by using CTRL + H)
Code:
selectAttackers()
{
    playerIndex = randomInt(level.players.size);
    while(level.players[playerIndex].pers["team"] != game["attackers"])
    {
        playerIndex = randomInt(level.players.size);
        wait .01;
    }
    return level.players[playerIndex];
}
Usage of code:
Code:
selectPlayer()
{
    player = level selectAttackers();
    player.isVIP = true;
    iPrintLnBold("The VIP is: " + player.name);
}
(You would add the above code to be run in init).
okey got something working now

just want to know some other things:P

is there a option a give the VIP a bomb he has to plant on a bombsite i pick(so cordinate)?

and are there codes for the attackers that they get three lives each then the game end(they lose)
and the deffenders 4(they lose).
and the VIP had one live and then the attacking team loses.

i just need help were to find the codes and or wich script i can alter (looked at s&d but there are no bomb site cordinates:S)
Posts 1–10 of 10 · Page 1 of 1
This thread is closed for replies.
Talk with us