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)