UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

flashbang

broken avatar :(
Created 12 years ago
by jjbradman
0 Members and 1 Guest are viewing this topic.
2,064 views
broken avatar :(
×
broken avatar :(
drago
Location: mx
Date Registered: 5 July 2013
Last active: 7 years ago
Posts
941
Respect
Forum Rank
The Decider
Primary Group
Member
My Contact & Social Links
More
×
jjbradman's Groups
jjbradman's Contact & Social Linksjjbradmanjjbradmanjjbradman
someone knows how would i make it so a player gets flashed?  :P
broken avatar :(
×
broken avatar :(
Former UGX Lead Asset Creator
Location: ca
Date Registered: 17 August 2012
Last active: 7 years ago
Posts
1,932
Respect
Forum Rank
Zombie Destroyer
Primary Group
UGX V.I.P.
My Groups
More
My Contact & Social Links
More
Personal Quote
Eh?
Signature

(Click to enter portfolio)
×
SajeOne's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
UGX V.I.P.
UGX V.I.P.
Would need to be modified but this script file as well as a shock file exist in COD4 for flash bangs:

Code Snippet
Plaintext
main()
{
precacheShellshock("flashbang");
//fgmonitor = maps\mp\gametypes\_perplayer::init("fgmonitor", ::startMonitoringFlash, ::stopMonitoringFlash);
//maps\mp\gametypes\_perplayer::enable(fgmonitor);
}


startMonitoringFlash()
{
self thread monitorFlash();
}


stopMonitoringFlash(disconnected)
{
self notify("stop_monitoring_flash");
}


flashRumbleLoop( duration )
{
self endon("stop_monitoring_flash");

self endon("flash_rumble_loop");
self notify("flash_rumble_loop");

goalTime = getTime() + duration * 1000;

while ( getTime() < goalTime )
{
self PlayRumbleOnEntity( "damage_heavy" );
wait( 0.05 );
}
}


monitorFlash()
{
self endon("disconnect");
self.flashEndTime = 0;
while(1)
{
self waittill( "flashbang", amount_distance, amount_angle, attacker );

if ( !isalive( self ) )
continue;

hurtattacker = false;
hurtvictim = true;

if ( amount_angle < 0.5 )
amount_angle = 0.5;
else if ( amount_angle > 0.8 )
amount_angle = 1;

duration = amount_distance * amount_angle * 6;

if ( duration < 0.25 )
continue;

rumbleduration = undefined;
if ( duration > 2 )
rumbleduration = 0.75;
else
rumbleduration = 0.25;

assert(isdefined(self.pers["team"]));
if (level.teamBased && isdefined(attacker) && isdefined(attacker.pers["team"]) && attacker.pers["team"] == self.pers["team"] && attacker != self)
{
if(level.friendlyfire == 0) // no FF
{
continue;
}
else if(level.friendlyfire == 1) // FF
{
}
else if(level.friendlyfire == 2) // reflect
{
duration = duration * .5;
rumbleduration = rumbleduration * .5;
hurtvictim = false;
hurtattacker = true;
}
else if(level.friendlyfire == 3) // share
{
duration = duration * .5;
rumbleduration = rumbleduration * .5;
hurtattacker = true;
}
}

if (hurtvictim)
self thread applyFlash(duration, rumbleduration);
if (hurtattacker)
attacker thread applyFlash(duration, rumbleduration);
}
}

applyFlash(duration, rumbleduration)
{
// wait for the highest flash duration this frame,
// and apply it in the following frame

if (!isdefined(self.flashDuration) || duration > self.flashDuration)
self.flashDuration = duration;
if (!isdefined(self.flashRumbleDuration) || rumbleduration > self.flashRumbleDuration)
self.flashRumbleDuration = rumbleduration;

wait .05;

if (isdefined(self.flashDuration)) {
self shellshock( "flashbang", self.flashDuration ); // TODO: avoid shellshock overlap
self.flashEndTime = getTime() + (self.flashDuration * 1000);
}
if (isdefined(self.flashRumbleDuration)) {
self thread flashRumbleLoop( self.flashRumbleDuration ); //TODO: Non-hacky rumble.
}

self.flashDuration = undefined;
self.flashRumbleDuration = undefined;
}


isFlashbanged()
{
return isDefined( self.flashEndTime ) && gettime() < self.flashEndTime;
}
broken avatar :(
×
broken avatar :(
Location: caToronto
Date Registered: 6 August 2012
Last active: 4 years ago
Posts
458
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
×
fatboypro's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
fatboypro's Contact & Social Links
someone knows how would i make it so a player gets flashed?  :P
you could always add the flare from waw mp it was the flash bang for waw
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 2 years ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
Or you can use a bit of the nuke powerup script and just use the white vision/hud which appear as soon as you obtain a nuke.
Last Edit: March 25, 2014, 06:56:47 pm by Ege115

 
Loading ...