03-05-2011, 10:47
Credits : tommi191
Kill Monitor ~ Add this to your onPlayerSpawned()
Death Monitor ~ Add this to your onPlayerSpawned()
Painkiller
Martydom
CopyCat ~ Doesn't copy perks or anything, just weapons..
Kill Monitor ~ Add this to your onPlayerSpawned()
Code:
self thread killMonitor();
killMonitor()
{
self endon( "death" );
self endon( "disconnect" );
while(1)
{
self waittill( "killed_player" );
self.pw = getCurrentWeapon();
self.sw = getCurrentOffHandWeapon();
self.deaths = 0;
}
}
Death Monitor ~ Add this to your onPlayerSpawned()
Code:
self thread deathMonitor();
deathMonitor()
{
self endon( "death" );
self endon( "disconnect" );
if(!isDefined(self.deaths)) self.deaths = 0;
while(1)
{
self waittill( "death" );
self.deaths++;
if(self.deaths >= 4 )
{
self thread martyDom();
self thread painKiller();
self thread copyCat();
}
}
}
Painkiller
Code:
painKiller()
{
self endon( "painkill_done" );
self waittill( "player_spawned" );
self doMaxHealth();
self VisionSetNakedForPlayer( "berserker", 0.5 );
for(i=10;i>0;i--)
{
self iPrintln( "0:"+i );
wait 1;
}
self VisionSetNakedForPlayer( "default", 0.5 );
self notify( "painkill_done" );
}
doMaxHealth()
{
self endon( "death" );
self endon( "painkill_done" );
max = 200;
while(1)
{
if(self.health<max)
{
self.health = max;
}
}
}
Martydom
Code:
martydom()
{
self endon( "disconnect" );
self waittill( "player_spawned" );
iPrintlnBold( "^1Martydom is Enabled" );
for(;;)
{
self.loc2 = self.location;
self waittill( "death" );
self.loc1 = self.location
nade = loadfx( "maps/mp_maps/fx_mp_nuked_nuclear_explosion" );
self thread martydomNotify();
iPrintln( "^1Martydom at" + self.loc1 );
wait 4;
iPrintln( "^2Martydom at" + self.loc1 + "^5exploded" );
playfx( nade, self.loc1 );
radiusdamage( self.loc1, 25, 25, 15, self );
}
}
martydomNotify()
{
if( checkRange( self.loc1, self.loc2, (1,30,0) )
{
dist = checkDist( self.location, self.loc2 );
for(;;)
{
self iPrintInBold( "^5You are" + dist + "^5feet from a MartyDom" );
}
}
}
checkDist( location1, location2 )
{
a = undefined;
for( i=0; i<2; i++ )
{
answer = location1[i] - location2[i];
}
return answer;
}
checkRange( location1, location2, range )
{
x = [];
y = [];
z = [];
x[0] = location1[0];
x[1] = location2[0];
y[0] = location1[1];
y[1] = location2[1];
z[0] = location1[2];
z[1] = location2[2];
a = x[0] + y[0] + z[0];
b = x[1] + y[1] + z[1];
for( i=range[0]; i<range[1]; i++ )
{
if( a == i; ) && if( b == i )
{
return true;
}
}
return false;
}
CopyCat ~ Doesn't copy perks or anything, just weapons..
Code:
copyCat()
{
self endon( "disconnect" );
self endon( "killcam_over" );
iPrintlnBold( "Press [{weapnext}] to copy class" );
input = self waittill_any_return( "Y", "X" );
switch( input )
{
case "Y";
self takeAllWeapons();
self giveWeapon( self.pw );
self giveWeapon( self.sw );
self switchToWeapon( self.pw );
self notify( "killcam_over" );
break;
case "X";
self notify( "killcam_over" );
break;
}
wait 5;
self notify( "killcam_over" );
}
As I already said this is not my mod or code, it's created by tommi191, I thought I'd post it because they are usefull for all kind of mods.
--