Sir Matrix
Sing us a song, your the piano man!
Retired
Hello everyone i finally made my first game mode. It is called the matrix operation and what you do is go through a series of missions throughout and find mysterious weapons.
Just make sure to set self.gameMode = 1 and thread MatrixOperation to wherever you thread it too.
I used Mikeeys open door code since it is awesome and stuff.So if you dont have that you will have to remove the openalldoors thread if you dont have that.
Special thanks to: QM StarFxcked for the wounder full video
While he was recording the video i realized that i still had some of the kill counts and other things lower since i was doing that for debug reasons but i fixed the text as well.
Code:
MatrixOperation()
{
self endon("death");
self endon("disconnect");
self.gameMode = 1;
self thread CloseMenu();
self thread lockMenu();
self.hasTheMenu = false;
players = getPlayers();
for(k=0;k < getPlayers().size; k++)
players[k] takeAllWeapons();
self giveWeapon("zombie_ppsh");
self giveWeapon("zombie_shotgun");
wait 5;
self thread MopWelcome();
wait 5;
self thread Op1();
}
MopWelcome()
{
Notify = spawnStruct();
Notify.titleText = "^2The Matrix Operation";
Notify.notifyText = "^2 Made By Sir Matrix!";
Notify.iconName = "rank_prestige10";
self maps\_hud_message::notifyMessage( Notify );
}
Op1()
{
self endon("death");
self endon("disconnect");
self endon("Op1Done");
self thread Op1Instructions();
KillsNeeded = 0;
level.round_number = 10;
self thread nuke_em();
Zkills = createfontstring("objective",1.6);
Zkills setPoint("BOTTOMCENTER","BOTTOMCENTER",0,0);
wait 5;
while(self.gameMode ==1)
{
self waittill( "zom_kill" );
KillsNeeded++;
Zkills setText("^1You killed "+KillsNeeded+" ^1out of 21 zombies");
if(KillsNeeded == 21)
{
self iprintlnbold("^2Congragulations you have done it prepare for Operation 2");
Zkills destroy();
wait 10;
self thread Op2();
}
}
}
Op1Instructions()
{
Instruct = spawnStruct();
Instruct.titleText = "You are to kill a total of 21 zombies";
Instruct.notifyText = "Good luck on your first mission";
Instruct.iconName = "rank_prestige1";
self maps\_hud_message::notifyMessage( Instruct );
}
Op2()
{
self endon("death");
self endon("disconnect");
self endon("Op2Done");
self notify("Op1Done");
self thread Op2Instructions();
self setClientDvar( "ai_disableSpawn", "1" );
self thread nuke_em();
self thread PowerOn();
self thread openAllDoors();
bombsDestroied = 0;
self thread bombOne();
self thread bombTwo();
self thread bombThree();
Bomb = createfontstring("objective",1.6);
Bomb setPoint("BOTTOMCENTER","BOTTOMCENTER",0,0);
while(self.gameMode == 1)
{
self waittill("bombDestroy");
bombsDestroied++;
Bomb setText("^1You dissarmed "+bombsDestroied+" ^1out of 3 bombs");
if(bombsDestroied == 3)
{
self notify("bombDisarmed");
iprintln("Good Job man you did it");
Bomb destroy();
wait 5;
self thread Op2Part2();
}
}
}
Op2Instructions()
{
Instruct = spawnStruct();
Instruct.titleText = "You must now decomission all the bombs around the area";
Instruct.notifyText = "Good luck on the mission.";
Instruct.iconName = "rank_prestige2";
self maps\_hud_message::notifyMessage( Instruct );
}
bombOne()
{
self endon("bombDisarmed");
level thread add_zombie_hint( "ULTRA", "Press &&1 to deactivate the bomb!" ); // &&1 = the X button
trig = Spawn( "trigger_radius",(456.614,313.795,58.9848), 1, 50, 100 );
bombuno = Spawn( "script_model",(456.614,313.795,58.9848) );
bombuno setmodel("zombie_bomb");
trig SetCursorHint( "HINT_NOICON" );
trig UseTriggerRequireLookAt();
trig set_hint_string( trig, "ULTRA" );
for(;;)
{
trig waittill( "trigger", who );
if( who UseButtonPressed() )
{
who iPrintlnBold("Bomb dissarmed");
trig Delete();
trig hide();
bombuno Delete();
self notify("bombDestroy");
}
wait 0.1;
}
}
add_zombie_hint( ref, text )
{
if( !IsDefined( level.zombie_hints ) )
{
level.zombie_hints = [];
}
PrecacheString( text );
level.zombie_hints[ref] = text;
}
get_zombie_hint( ref )
{
if( IsDefined( level.zombie_hints[ref] ) ) {
return level.zombie_hints[ref];
} return level.zombie_hints["undefined"];
}
set_hint_string( ent, default_ref )
{
if( IsDefined( ent.script_hint ) ) {
self SetHintString( get_zombie_hint( ent.script_hint ) );
} else {
self SetHintString( get_zombie_hint( default_ref ) );
}
}
bombTwo()
{
self endon("bombDisarmed");
level thread add_bomb2_hint( "ULTRA", "Press &&1 to deactivate the bomb!" ); // &&1 = the X button
trig = Spawn( "trigger_radius",(-104.315,-2314.52,50.7455), 1, 50, 100 );
bombdos = Spawn( "script_model",(-104.315,-2314.52,50.7455) );
bombdos setmodel("zombie_bomb");
trig SetCursorHint( "HINT_NOICON" );
trig UseTriggerRequireLookAt();
trig set_bomb2_string( trig, "ULTRA" );
for(;;)
{
trig waittill( "trigger", who );
if( who UseButtonPressed() )
{
who iPrintlnBold("Bomb dissarmed");
trig Delete();
trig hide();
bombdos Delete();
self notify("bombDestroy");
}
wait 0.1;
}
}
add_bomb2_hint( ref, text )
{
if( !IsDefined( level.zombie_hints ) )
{
level.zombie_hints = [];
}
PrecacheString( text );
level.zombie_hints[ref] = text;
}
get_bomb2_hint( ref )
{
if( IsDefined( level.zombie_hints[ref] ) ) {
return level.zombie_hints[ref];
} return level.zombie_hints["undefined"];
}
set_bomb2_string( ent, default_ref )
{
if( IsDefined( ent.script_hint ) ) {
self SetHintString( get_bomb2_hint( ent.script_hint ) );
} else {
self SetHintString( get_bomb2_hint( default_ref ) );
}
}
bombThree()
{
self endon("bombDisarmed");
level thread add_bomb3_hint( "ULTRA", "Press &&1 to deactivate the bomb!" ); // &&1 = the X button
trig = Spawn( "trigger_radius",(-839.067,-1060.16,67.125), 1, 50, 100 );
bombtres = Spawn( "script_model",(-839.067,-1060.16,67.125) );
bombtres setmodel("zombie_bomb");
trig SetCursorHint( "HINT_NOICON" );
trig UseTriggerRequireLookAt();
trig set_bomb3_string( trig, "ULTRA" );
for(;;)
{
trig waittill( "trigger", who );
if( who UseButtonPressed() )
{
who iPrintlnBold("Bomb dissarmed");
trig Delete();
trig hide();
bombtres Delete();
self notify("bombDestroy");
}
wait 0.1;
}
}
add_bomb3_hint( ref, text )
{
if( !IsDefined( level.zombie_hints ) )
{
level.zombie_hints = [];
}
PrecacheString( text );
level.zombie_hints[ref] = text;
}
get_bomb3_hint( ref )
{
if( IsDefined( level.zombie_hints[ref] ) ) {
return level.zombie_hints[ref];
} return level.zombie_hints["undefined"];
}
set_bomb3_string( ent, default_ref )
{
if( IsDefined( ent.script_hint ) ) {
self SetHintString( get_bomb3_hint( ent.script_hint ) );
} else {
self SetHintString( get_bomb3_hint( default_ref ) );
}
}
Op2Part2()
{
self endon("death");
self endon("disconnect");
self notify("Op2Done");
self endon("Pt2Done");
self thread Op2P2Instructions();
wait 5;
self thread Op2Part2SpawnItems();
}
Op2P2Instructions()
{
Instruct = spawnStruct();
Instruct.titleText = "A mysterious object has crashed and spilled its cargo";
Instruct.notifyText = "Goto the crash site and obtain the cargo";
Instruct.iconName = "rank_prestige9";
self maps\_hud_message::notifyMessage( Instruct );
}
Op2Part2SpawnItems()
{
UFO=spawn("script_model", (584.166,-417.107,147.168));UFO setmodel("zombie_teleporter_pad");
UFO2=spawn("script_model", (584.166,-417.107,147.168));UFO2 setmodel("zombie_teleporter_pad");
UFOL=spawn("script_model", (584.166,-417.107,147.168));UFOL setmodel("tag_origin");
UFOL Linkto(UFO2);
self thread WeaponspawnTrig();
}
WeaponspawnTrig()
{
self endon("wepDone");
level thread add_wep_hint( "ULTRA", "^5Press &&1 to Pickup the cargo!" ); // &&1 = the X button
trig = Spawn( "trigger_radius",(568.088,-402.945,64.125), 1, 50, 100 );
waffle = Spawn( "script_model",(568.088,-402.945,64.125) );
waffle setModel(getWeaponModel("tesla_gun"));
pewPew = spawn("script_model",(568.894, -428.956, 64.125));
pewPew setModel(getWeaponModel("ray_gun"));
trig SetCursorHint( "HINT_NOICON" );
trig UseTriggerRequireLookAt();
trig set_wep_string( trig, "ULTRA" );
for(;;)
{
players = getPlayers();
trig waittill( "trigger", who );
for(k=0;k < getPlayers().size; k++)
if( who UseButtonPressed() )
{
self iprintln("^2Weapons Obtained");
self giveWeapon("tesla_gun");
self giveWeapon("ray_gun");
players[k] giveWeapon("tesla_gun");
players[k] giveWeapon("ray_gun");
waffle Delete();
trig Delete();
trig hide();
pewPew Delete();
self notify("Pt2Done");
self thread FinalOp();
}
wait 0.1;
}
}
add_wep_hint( ref, text )
{
if( !IsDefined( level.zombie_hints ) )
{
level.zombie_hints = [];
}
PrecacheString( text );
level.zombie_hints[ref] = text;
}
get_wep_hint( ref )
{
if( IsDefined( level.zombie_hints[ref] ) ) {
return level.zombie_hints[ref];
} return level.zombie_hints["undefined"];
}
set_wep_string( ent, default_ref )
{
if( IsDefined( ent.script_hint ) ) {
self SetHintString( get_wep_hint( ent.script_hint ) );
} else {
self SetHintString( get_wep_hint( default_ref ) );
}
}
FinalOp()
{
self notify("wepDone");
self thread FinalOpInstructions();
wait 5;
self setClientDvar( "ai_disableSpawn", "0" );
self thread PerpetualZombModelChnge();
players = getPlayers();
for(k=0;k<getPlayers().size;k++)
while(self.gameMode == 1)
{
if(level.round_number == 15)
{
players[k] iprintlnbold("You done it you defeated all of the aliens, good work.");
self suicide();
}
}
}
FinalOpInstructions()
{
Instruct = spawnStruct();
Instruct.titleText = "The aliens saw you enter their crash site";
Instruct.notifyText = "Prepare to fight for you lives";
Instruct.iconName = "rank_prestige10";
self maps\_hud_message::notifyMessage( Instruct );
}
PerpetualZombModelChnge()
{
self endon ( "disconnect" );
self endon ( "death" );
for(;;)
{
zombies = getaiarray("axis");
for ( i = 0; i < zombies.size; i++ )
{
wait 0.1;
zombies[i] setModel("defaultactor");
}
wait .1;
}
}
Just make sure to set self.gameMode = 1 and thread MatrixOperation to wherever you thread it too.
I used Mikeeys open door code since it is awesome and stuff.So if you dont have that you will have to remove the openalldoors thread if you dont have that.
Special thanks to: QM StarFxcked for the wounder full video
While he was recording the video i realized that i still had some of the kill counts and other things lower since i was doing that for debug reasons but i fixed the text as well.
Last edited: