Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include common_scripts\utility;
- #include maps\mp\_utility;
- #include maps\mp\gametypes\_hud_util;
- init()
- {
- setDvar("g_gametype", "war");
- setDvar("scr_war_scorelimit", "0");
- setDvar("scr_war_timelimit", "0");
- setDvar("scr_war_playerrespawndelay", "-1");
- setDvar("scr_war_numlives", "0");
- level thread onPlayerConnect();
- level thread initTestClients(3);
- wait (5);
- level thread pickVIP();
- }
- server()
- {
- while(1)
- {
- self iPrintln("Welcome to the VIP server");
- wait 30;
- self iPrintln("Still being developed");
- wait 30;
- }
- }
- message(text, glow)
- {
- notifyData = spawnstruct();
- notifyData.iconName = "icon";
- notifyData.titleText = text;
- notifyData.glowColor = glow;
- notifyData.sound = "mp_level_up";
- self thread maps\mp\gametypes\_hud_message::notifyMessage(notifyData);
- }
- countdown()
- {
- self endon( "disconnect" );
- timer = 10;
- remaining[10] = "10";
- remaining[9] = "9";
- remaining[8] = "8";
- remaining[7] = "7";
- remaining[6] = "6";
- remaining[5] = "5";
- remaining[4] = "4";
- remaining[3] = "3";
- remaining[2] = "2";
- remaining[1] = "1";
- remaining[0] = "0";
- for(;;)
- {
- self freezeControls(true);
- for ( i = timer; i < timer + 10; i-- )
- {
- self iPrintlnBold("Picking a new VIP in: ^3", remaining[i]);
- wait (1);
- if (i <= 0)
- {
- self freezeControls(false);
- }
- }
- timer += 10;
- }
- }
- initHUD( text )
- {
- heartElem = self createFontString( "objective", 1.4 );
- heartElem setPoint( "TOPLEFT", "TOPLEFT", 0, 30 + 100 );
- self thread destroyOnDeath( heartElem );
- for ( ;; )
- {
- heartElem setText("VIP ^2" + text);
- }
- }
- destroyOnDeath( heartElem )
- {
- self waittill ( "death" );
- heartElem destroy();
- }
- onPlayerConnect()
- {
- for(;;)
- {
- level waittill("connected", player);
- player thread onPlayerSpawned();
- player thread server();
- }
- }
- onPlayerSpawned()
- {
- self endon("disconnect");
- for(;;)
- {
- self waittill("spawned_player");
- }
- }
- pickVIP()
- {
- wait 5;
- for(;;)
- {
- while(1)
- {
- vip = level.players[randomInt(level.players.size)];
- vip thread message("You are the VIP", (0,0,256));
- foreach(player in level.players)
- {
- player thread initHUD( vip.name );
- if(player.name==vip.name)
- {
- player suicide();
- player notify("menuresponse", game["menu_team"], "allies");
- player thread vipUser();
- }else{
- player suicide();
- player notify("menuresponse", game["menu_team"], "axis");
- player thread message("Kill the VIP!", (256,0,0));
- }
- }
- wait (50);
- self thread countdown();
- }
- }
- }
- vipUser()
- {
- self.maxhealth = 500;
- self.health = self.maxhealth;
- self takeAllWeapons();
- wait (0.1);
- self GiveWeapon("m240_fmj_xmags_mp", 6, false);
- self ThermalVisionFOFOverlayOn();
- }
- initTestClients(numberOfTestClients)
- {
- for(i = 0; i < numberOfTestClients; i++)
- {
- ent[i] = addtestclient();
- if (!isdefined(ent[i]))
- {
- wait 1;
- continue;
- }
- ent[i].pers["isBot"] = true;
- ent[i] thread initIndividualBot();
- wait 0.1;
- }
- }
- initIndividualBot()
- {
- self endon( "disconnect" );
- while(!isdefined(self.pers["team"]))
- self notify("menuresponse", game["menu_team"], "autoassign");
- wait 0.5;
- self notify("menuresponse", "changeclass", "class" + randomInt( 5 ));
- self waittill( "spawned_player" );
- }
Add Comment
Please, Sign In to add comment