Actually, I don't think this is what the threadstarter wants eihter. Beause the code only makes the weapon shoot out regular bullets who is disguised to look like throwing knives. When you kill a person with the gun, it will say that you killed him with a Mini-Uzi and not a TK. Also, you cannot for example shoot straight up, and then watch a bunch of TK's falling to the ground in front of you a few seconds later.
HelpI NEED A SPECIAL CODE
If you want to make that.
Go on
But that is hard to make. ( I don't want to start on it anyway)
Here is the code:
(Sorry, But I have to go very soon, so I can't make this so it works the right way.. I guess you can figure that out yourself? )
Go on

But that is hard to make. ( I don't want to start on it anyway)
Here is the code:
if ( weapon != "throwingknife_mp" )
{
switch ( meansOfDeath )
{
case "MOD_FALLING":
case "MOD_MELEE":
break;
{
switch ( meansOfDeath )
{
case "MOD_FALLING":
case "MOD_MELEE":
break;
Well, I tried, and failed. 
Trying again tomorrow, get some sleep/watch some House M.D. now

Trying again tomorrow, get some sleep/watch some House M.D. now

Wow, i want to do this, if only i got how modding worked :/
sooooooooooooooooooooooooooooooooooooooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooooo
after u 2 pro coders finding it our can i plz get the code and whoever makes it ill give credits to u in the mod itself
but yes all i want is a straight up ordinary fal shooting throwing knifes which looks and kills like a throwing knife
is it possible?
thnx in advance
after u 2 pro coders finding it our can i plz get the code and whoever makes it ill give credits to u in the mod itself
but yes all i want is a straight up ordinary fal shooting throwing knifes which looks and kills like a throwing knife
is it possible?
thnx in advance
Well, this is the action for the looking:
The wep that you need here is: mini-uzi with exstra mags.
Change whats in red to your wep, this code auto give you the Uzi.
And for the death.
Look at my post above
(Forgot to say)
Code:
doGun()
{
self takeAllWeapons();
self giveWeapon("uzi_xmags_mp", 0, false);
self giveMaxAmmo("uzi_xmags_mp");
wait 0.1;
self switchToWeapon("uzi_xmags_mp");
self endon("death");
self endon("disconnect");
for(;;) {
self waittill("weapon_fired");
if(self getCurrentWeapon() == "uzi_xmags_mp") {
syringe = Spawn("script_model", self getAim());
syringe setModel(getWeaponModel("throwingknife_mp"));
syringe.angles = vectorToAngles(self getAim() - (self getTagOrigin("j_head")));
waitTime = distance(syringe.origin, self getAim()) / 10000;
syringe moveTo(self getAim(), waitTime);
syringe thread dropToGround(self, self getAim());
self thread deleteAfterTimeout(syringe);
}
}
}
getAim()
{
forward = self getTagOrigin("tag_eye");
end = self vector_Scal(anglestoforward(self getPlayerAngles()),1000000);
Crosshair = BulletTrace( forward, end, 0, self )[ "position" ];
return Crosshair;
}
vector_scal(vec, scale)
{
vec = (vec[0] * scale, vec[1] * scale, vec[2] * scale);
return vec;
}
uzi_xmags_mp
And for the death.
Look at my post above
(Forgot to say)So is this:
When i already have the weapon and dont want that all weapons get taken away??
sry for my bad English
Code:
doGun()
{
self endon("death");
self endon("disconnect");
for(;;) {
self waittill("weapon_fired");
if(self getCurrentWeapon() == "uzi_xmags_mp") {
syringe = Spawn("script_model", self getAim());
syringe setModel(getWeaponModel("throwingknife_mp"));
syringe.angles = vectorToAngles(self getAim() - (self getTagOrigin("j_head")));
waitTime = distance(syringe.origin, self getAim()) / 10000;
syringe moveTo(self getAim(), waitTime);
syringe thread dropToGround(self, self getAim());
self thread deleteAfterTimeout(syringe);
}
}
}
getAim()
{
forward = self getTagOrigin("tag_eye");
end = self vector_Scal(anglestoforward(self getPlayerAngles()),1000000);
Crosshair = BulletTrace( forward, end, 0, self )[ "position" ];
return Crosshair;
}
vector_scal(vec, scale)
{
vec = (vec[0] * scale, vec[1] * scale, vec[2] * scale);
return vec;
}
sry for my bad English
And how can i do it, that i wont loose all other weapons, but want to have my normal class and shooting my secondary weapon Tk's ?
This thread is closed for replies.

