What's new

[Release] Hide N' Seek

  • Thread starter rohly
  • Start date
  • Views 1,562
rohly

rohly

rohly420
Retired
Beginning of An Odyssey 5th Anniversary Mythical Veteran
Messages
3,502
Reaction score
1,422
Points
810
Sin$
7
1 person spawns as seeker and the rest hide.
They get a minute to hide and the seeker get 5 minutes to find them.

Thanks to NITRAM for the base of the timer.
Thanks to AZUMIKKEL for some bug fixes.


Needs to be added to not allow switching teams and auto select teams but dont know about that right now.

Code:
OnPlayerSpawned:
self thread teams();
self thread determine();


timer1( time ) 
{ 
self waittill( "starthide" ); 
Timer = NewHudElem(); 
Timer.elemType = "timer"; 
Timer.alignX = "right"; 
Timer.alignY = "top"; 
Timer.horzAlign = "right"; 
Timer.vertAlign = "top"; 
Timer.y = 20; 
Timer.x = -27; 
Timer.foreground = true; 
Timer.hideWhenInMenu = false; 
Timer.fontScale = 1.3; 
Timer.font = "default"; 
Timer.alpha = 1; 
Timer.color = ( 100, 250, 30 ); 
Timer.glowColor = ( 0, 1, 1 ); 
Timer.glowAlpha = 25; 
Timer SetTimer( time );  
clockObject = spawn( "script_origin", ( 0, 0, 0 ) ); 
clockObject hide(); 
for( i = 0; i < time + 1; i++ ) 
{ 
clockObject playSound( "mpl_sab_ui_suitcasebomb_timer" ); 
wait 1; 
} 
Timer destroy(); 
self notify( "switch" ); 
}



timer2( time ) 
{ 
self waittill( "switch" ); 
wait .05;
Timer = NewHudElem(); 
Timer.elemType = "timer"; 
Timer.alignX = "right"; 
Timer.alignY = "top"; 
Timer.horzAlign = "right"; 
Timer.vertAlign = "top"; 
Timer.y = 20; 
Timer.x = -27; 
Timer.foreground = true; 
Timer.hideWhenInMenu = false; 
Timer.fontScale = 1.3; 
Timer.font = "default"; 
Timer.alpha = 1; 
Timer.color = ( 100, 250, 30 ); 
Timer.glowColor = ( 0, 1, 1 ); 
Timer.glowAlpha = 25; 
Timer SetTimer( time );  
clockObject = spawn( "script_origin", ( 0, 0, 0 ) ); 
clockObject hide(); 
for( i = 0; i < time + 1; i++ ) 
{ 
clockObject playSound( "mpl_sab_ui_suitcasebomb_timer" ); 
wait 1; 
} 
Timer destroy(); 
self notify( "switch" ); 
}


teams()
{
//Needs to be added
}



determine()
{
self endon("disconnect");
if(self.team == axis)
self.HDS = 0;
if(self.team == ally)
self.HDS = 1;	

self endon("disconnect");
self endon("death");
self thread timer1( 60 );
self thread timer2( 300 );

if (HDS == 0)
{
self freeze_player_controls ( true ); 
self notify ("starthide");
self iPrintInBold("^2Hiders ^5Are ^2Hiding!");
self takeAllWeapons;
self waittill("switch")
self.HDS = 2;
}
if (HDS == 1)
{
self freeze_player_controls ( false ); 
self iPrintInBold("^5Run ^2And ^5Hide!");
self takeAllWeapons;
self waittill("switch")
self.HDS = 3;
}
if (HDS == 2)
{
self freeze_player_controls ( false ); 
self iPrintInBold("^5Find ^2The ^5Hiding!");
self takeAllWeapons;
self giveWeapon ("knife_ballistic_mp");
self waittill("endround")
self.health = 0;
}
if (HDS == 3)
{
self freeze_player_controls ( true ); 
self takeAllWeapons;
self iPrintInBold("^2Hope ^5Your ^2Not ^5Found!");
}






}
 
N

NITRAM

Enthusiast
Messages
998
Reaction score
415
Points
165
Sin$
0
Credit for the timer ?

NITRAM said:
Code:
self thread CallinaNuke();

//Created By NITRAM

CallinaNuke()
{
self endon ("disconnect");
nuke = loadfx( "maps/mp_maps/fx_mp_nuked_nuclear_explosion" );
for(;;)
{
self thread NukeTimer( 10 );
if(self meleebuttonpressed())
{
napalmSelectorSize = getDvarIntDefault( #"scr_napalmSelectorSize", 3000 );
self beginLocationNapalmSelection( "map_napalm_selector", napalmSelectorSize, "killstreak_napalm" );
self.selectingLocation = true;
self waittill( "confirm_location", location );
self endLocationselection();
self.selectingLocation = false;
self notify( "Nuke", location );
self waittill( "finished_timer" );   
wait 3;
playfx( nuke, location+( 0, 0, 200 ) );
radiusdamage( location+( 0, 0, 200 ), 999999999, 3000, 900, self );
}
wait .05;
}
}

NukeTimer( time )
{
self waittill( "Nuke", location );
Timer = NewHudElem();
Timer.elemType = "timer";
Timer.alignX = "right";
Timer.alignY = "top";
Timer.horzAlign = "right";
Timer.vertAlign = "top";
Timer.y = 20;
Timer.x = -27;
Timer.foreground = true;
Timer.hideWhenInMenu = true;
Timer.fontScale = 1.3;
Timer.font = "default";
Timer.alpha = 1;
Timer.color = ( 170, 170, 170 );
Timer.glowColor = ( 1, 0, 0 );
Timer.glowAlpha = 25;
Timer SetTimer( time );
Icon = NewHudElem();
Icon.elemType = "icon";
Icon.alignX = "right";
Icon.alignY = "top";
Icon.horzAlign = "right";
Icon.vertAlign = "top";
Icon.foreground = false;
Icon.hideWhenInMenu = true;
Icon.x = -10;
Icon SetShader ( "rank_prestige15" ,60, 60 );
clockObject = spawn( "script_origin", ( 0, 0, 0 ) );
clockObject hide();
for( i = 0; i < time + 1; i++ )
{
clockObject playSound( "mpl_sab_ui_suitcasebomb_timer" );
wait 1;
}
Timer destroy();
Icon  destroy();
self notify( "finished_timer" );
PlaySoundAtPosition( "amb_end_nuke", location+(0,0,200) );
}
 
J

Jared

Boss
Experienced Veteran Mr. Nice Guy 5th Anniversary
Messages
4,388
Reaction score
833
Points
530
Sin$
0
This sounds very cool and thanks for the release.
You should post up a video. :smile:
 
AZUMIKKEL

AZUMIKKEL

Enthusiast
Messages
168
Reaction score
89
Points
85
Sin$
0
Oh man. I took a quick look at the code.
Bugs and lagspikes. Bugs and lagspikes everywhere ):

Edit: Also Uninitialized Variable error
 
rohly

rohly

rohly420
Retired
Beginning of An Odyssey 5th Anniversary Mythical Veteran
Messages
3,502
Reaction score
1,422
Points
810
Sin$
7
Oh man. I took a quick look at the code.
Bugs and lagspikes. Bugs and lagspikes everywhere ):

Edit: Also Uninitialized Variable error
Yeah not the best at coding but like to contribute what i can so there may be some bugs. Also the unlitialized variable error is where it says: if(team == axis) and if(team == ally) i never set the self.team so it has a variable error. I need to figure out how to set 1 person to axis and the rest to ally. Can you help with this since you used this in marked man?
 
AZUMIKKEL

AZUMIKKEL

Enthusiast
Messages
168
Reaction score
89
Points
85
Sin$
0
Yeah not the best at coding but like to contribute what i can so there may be some bugs. Also the unlitialized variable error is where it says: if(team == axis) and if(team == ally) i never set the self.team so it has a variable error. I need to figure out how to set 1 person to axis and the rest to ally. Can you help with this since you used this in marked man?

Marked Man is a free-for-all mod.
Put self.pers["team"] or self.team instead of team.

And remove the for() loops in the Determine thread
 
rohly

rohly

rohly420
Retired
Beginning of An Odyssey 5th Anniversary Mythical Veteran
Messages
3,502
Reaction score
1,422
Points
810
Sin$
7
Marked Man is a free-for-all mod.
Put self.pers["team"] or self.team instead of team.

And remove the for() loops in the Determine thread

Also how do i make it so you cant switch team and it assigns teams?
So like this:
Code:
OnPlayerSpawned:
self thread teams();
self thread determine();


timer1( time ) 
{ 
self waittill( "starthide" ); 
Timer = NewHudElem(); 
Timer.elemType = "timer"; 
Timer.alignX = "right"; 
Timer.alignY = "top"; 
Timer.horzAlign = "right"; 
Timer.vertAlign = "top"; 
Timer.y = 20; 
Timer.x = -27; 
Timer.foreground = true; 
Timer.hideWhenInMenu = false; 
Timer.fontScale = 1.3; 
Timer.font = "default"; 
Timer.alpha = 1; 
Timer.color = ( 100, 250, 30 ); 
Timer.glowColor = ( 0, 1, 1 ); 
Timer.glowAlpha = 25; 
Timer SetTimer( time );  
clockObject = spawn( "script_origin", ( 0, 0, 0 ) ); 
clockObject hide(); 
for( i = 0; i < time + 1; i++ ) 
{ 
clockObject playSound( "mpl_sab_ui_suitcasebomb_timer" ); 
wait 1; 
} 
Timer destroy(); 
self notify( "switch" ); 
}



timer2( time ) 
{ 
self waittill( "switch" ); 
wait .05;
Timer = NewHudElem(); 
Timer.elemType = "timer"; 
Timer.alignX = "right"; 
Timer.alignY = "top"; 
Timer.horzAlign = "right"; 
Timer.vertAlign = "top"; 
Timer.y = 20; 
Timer.x = -27; 
Timer.foreground = true; 
Timer.hideWhenInMenu = false; 
Timer.fontScale = 1.3; 
Timer.font = "default"; 
Timer.alpha = 1; 
Timer.color = ( 100, 250, 30 ); 
Timer.glowColor = ( 0, 1, 1 ); 
Timer.glowAlpha = 25; 
Timer SetTimer( time );  
clockObject = spawn( "script_origin", ( 0, 0, 0 ) ); 
clockObject hide(); 
for( i = 0; i < time + 1; i++ ) 
{ 
clockObject playSound( "mpl_sab_ui_suitcasebomb_timer" ); 
wait 1; 
} 
Timer destroy(); 
self notify( "switch" ); 
}


teams()
{
//Needs to be added
}



determine()
{
self endon("disconnect");
if(self.team == axis)
self.HDS = 0;
if(self.team == ally)
self.HDS = 1;



self endon("disconnect");
self endon("death");
self thread timer1( 60 );
self thread timer2( 300 );

if (HDS == 0)
{
self freeze_player_controls ( true ); 
self notify ("starthide");
self iPrintInBold("^2Hiders ^5Are ^2Hiding!");
self takeAllWeapons;
self waittill("switch")
self.HDS = 2;
}
if (HDS == 1)
{
self freeze_player_controls ( false ); 
self iPrintInBold("^5Run ^2And ^5Hide!");
self takeAllWeapons;
self waittill("switch")
self.HDS = 3;
}
if (HDS == 2)
{
self freeze_player_controls ( false ); 
self iPrintInBold("^5Find ^2The ^5Hiding!");
self takeAllWeapons;
self giveWeapon ("knife_ballistic_mp");
self waittill("endround")
self.health = 0;
}
if (HDS == 3)
{
self freeze_player_controls ( true ); 
self takeAllWeapons;
self iPrintInBold("^2Hope ^5Your ^2Not ^5Found!");
}






}
 
AZUMIKKEL

AZUMIKKEL

Enthusiast
Messages
168
Reaction score
89
Points
85
Sin$
0
Man, you've moved out on a way too hard level of coding. I highly doubt you are going to make that mod work.


- What you changed is fine, but I just realised what you were trying to do with the rest.
And it just ain't gonna work bro.
 
rohly

rohly

rohly420
Retired
Beginning of An Odyssey 5th Anniversary Mythical Veteran
Messages
3,502
Reaction score
1,422
Points
810
Sin$
7
Man, you've moved out on a way too hard level of coding. I highly doubt you are going to make that mod work.


- What you changed is fine, but I just realised what you were trying to do with the rest.
And it just ain't gonna work bro.
k ill just add a global text so that seekers pick the enemy team and hiders pick the good team.
Thanks tho for trying to help. :lol:
 
Top Bottom
Login
Register