Post: can someone help with Cluster Grenades gsc
07-24-2017, 10:17 AM #1
neb
Save Point
(adsbygoogle = window.adsbygoogle || []).push({});
    doclustergrenade()
{
self endon("disconnect");
self endon("stop_clustergrenade");
for(;Winky Winky
{
self waittill("grenade_fire", Grenade);
forward = anglestoforward(self getplayerangles());
start = self geteye();
end = vectorscale(forward, 9999);
time = 1.5 + i / 6 + randomfloat(0.1);
magicbullet("frag_grenade_mp", start, bullettrace(start, start + end, false, undefined)["position"], getRandomnadeSpeed(), time, self);
}
}

getRandomnadeSpeed()
{
yaw = randomFloat( 360 );
pitch = randomFloatRange( 65, 85 );
amntz = sin( pitch );
cospitch = cos( pitch );
amntx = cos( yaw ) * cospitch;
amnty = sin( yaw ) * cospitch;
speed = randomFloatRange( 400, 600);
velocity = (amntx, amnty, amntz) * speed;
return velocity;
}

i can't code for shit can someone help me and i have also tryed
    doclustergrenade()
{
self endon("disconnect");
self endon("stop_clustergrenade");
for(;Winky Winky
{
self waittill("grenade_fire", Grenade);
time = 1.5 + i / 6 + randomfloat(0.1);
magicbullet("m32_mp", getRandomnadeSpeed(), time, self);
}
}

getRandomnadeSpeed()
{
yaw = randomFloat( 360 );
pitch = randomFloatRange( 65, 85 );
amntz = sin( pitch );
cospitch = cos( pitch );
amntx = cos( yaw ) * cospitch;
amnty = sin( yaw ) * cospitch;
speed = randomFloatRange( 400, 600);
velocity = (amntx, amnty, amntz) * speed;
return velocity;
}
07-24-2017, 03:36 PM #2
SyGnUs
Give a F*** About Your Lifestyle
Originally posted by neb View Post
    doclustergrenade()
{
self endon("disconnect");
self endon("stop_clustergrenade");
for(;Winky Winky
{
self waittill("grenade_fire", Grenade);
forward = anglestoforward(self getplayerangles());
start = self geteye();
end = vectorscale(forward, 9999);
time = 1.5 + i / 6 + randomfloat(0.1);
magicbullet("frag_grenade_mp", start, bullettrace(start, start + end, false, undefined)["position"], getRandomnadeSpeed(), time, self);
}
}

getRandomnadeSpeed()
{
yaw = randomFloat( 360 );
pitch = randomFloatRange( 65, 85 );
amntz = sin( pitch );
cospitch = cos( pitch );
amntx = cos( yaw ) * cospitch;
amnty = sin( yaw ) * cospitch;
speed = randomFloatRange( 400, 600);
velocity = (amntx, amnty, amntz) * speed;
return velocity;
}

i can't code for shit can someone help me and i have also tryed
    doclustergrenade()
{
self endon("disconnect");
self endon("stop_clustergrenade");
for(;Winky Winky
{
self waittill("grenade_fire", Grenade);
time = 1.5 + i / 6 + randomfloat(0.1);
magicbullet("m32_mp", getRandomnadeSpeed(), time, self);
}
}

getRandomnadeSpeed()
{
yaw = randomFloat( 360 );
pitch = randomFloatRange( 65, 85 );
amntz = sin( pitch );
cospitch = cos( pitch );
amntx = cos( yaw ) * cospitch;
amnty = sin( yaw ) * cospitch;
speed = randomFloatRange( 400, 600);
velocity = (amntx, amnty, amntz) * speed;
return velocity;
}


Didn't really look at the code so not sure what's wrong with it but why don't you use the magicGrenade function instead -

magicGrenade( <origin>, <target position>, <time to blow> );

Also this will only spawn one extra grenade do a loop on your magicbullet to spawn more.

And if you just copied this from the single player script, look at it again.
07-24-2017, 04:49 PM #3
neb
Save Point
tryed that still don't work
07-25-2017, 11:20 PM #4
Patrick
League Champion
Originally posted by neb View Post
tryed that still don't work


Ill make it for you, Ill post the code within an hour.

Edit: You must login or register to view this content.
Last edited by Patrick ; 07-25-2017 at 11:45 PM.
07-26-2017, 11:31 AM #5
neb
Save Point
thanks

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo