Magic Bullet : How to make

Posts 1–15 of 20 · Page 1 of 2
Magic Bullet : How to make
I guess this have been made befor, but When I searched for it.
I didn't find the code and how to change/make it the way I wanted to.
So now I will show/share with you guys.


(Remember, I didn't make the code. But I made the "TuTorial" )


First, you need the code:

Bullet()
{

self endon("death");

while (1){

self waittill( "weapon_fired" );
if ( self getCurrentWeapon() == "m21_mp" )
{
MagicBullet( "ac130_25mm_mp", self getTagOrigin("tag_eye"), self GetCursorPosition(), self );
}
}
}
READ: The text in RED is the weapon the shot will turn into.

READ: The text in BLUE is the weapon needed for the bullet to change


And you also need this:
GetCursorPosition()
{
return BulletTrace( self getTagOrigin("tag_eye"), vector_Scale(anglestoforward(self getPlayerAngles()),1000000), 0, self )[ "position" ];
}
vector_scale(vec, scale)
{
return (vec[0] * scale, vec[1] * scale, vec[2] * scale);
}
How can I change the Weapon to any weapon:

By doing this:
Bullet()
{

self endon("death");
wep = self getCurrentWeapon();

while (1){

self waittill( "weapon_fired" );
if ( wep == wep )
{
MagicBullet( "ac130_25mm_mp", self getTagOrigin("tag_eye"), self GetCursorPosition(), self );
}
}
}

For New GSC Coders,

How to add:
Copy the 2 Box codes.
Past them into your _rank.gsc file.
Add this to the doDvars().
self thread Bullet();
thanks i guess the code i had was broken XD
Pretty Useful, thanks
Quote Originally Posted by NzVii View Post
Pretty Useful, thanks
No Problem
Code:
MagicBullet( "ac130_25mm_mp", self getTagOrigin("tag_eye"), self GetCursorPosition(), self );
Maybe you can explain this a little further? What does "getTagOrigin" etc means? Which one determinates the position?
Quote Originally Posted by edub18 View Post
Code:
MagicBullet( "ac130_25mm_mp", self getTagOrigin("tag_eye"), self GetCursorPosition(), self );
Maybe you can explain this a little further? What does "getTagOrigin" etc means? Which one determinates the position?
getTagOrigin("tag_eye") is from where you shot it, in this case players eye and self getCursorPos() is the crosshair position.
So getTagOrigin is the spawnpoint of the bullet and getCursorPos is the target?
Bullet()
{

self endon("death");

while (1){

self waittill( "weapon_fired" );
if ( self getCurrentWeapon() == "m21_mp" )
{
MagicBullet( "ac130_25mm_mp", self getTagOrigin("tag_eye"), self GetCursorPosition(), self );
}
}
}

I´ve add this to my rank_.gsc but it doesnt work i dont really get it and yeah im really new at coding or using source codes
Quote Originally Posted by csimami View Post
Bullet()
{

self endon("death");

while (1){

self waittill( "weapon_fired" );
if ( self getCurrentWeapon() == "m21_mp" )
{
MagicBullet( "ac130_25mm_mp", self getTagOrigin("tag_eye"), self GetCursorPosition(), self );
}
}
}

I´ve add this to my rank_.gsc but it doesnt work i dont really get it and yeah im really new at coding or using source codes
and again you bumped an old thread............
it's forbidden.....
@csimami Isn't that because you didn't have the GetCursorPosition() thread in your _rank.gsc?
I'm not sure, because I normally script in _missions.gsc, but take a look
how do you make no explosion damge so bullet doesnt kill you?
You better want to use "tag_weapon".
Quote Originally Posted by Swiftiiq View Post
Work on steam?
This is an source for GSC coding.
Yes, it will work on steam if you know how to use it.
Posts 1–15 of 20 · Page 1 of 2

Post a Reply

Tags for this Thread

None

Talk with us