what do you have to bind so you can throw it. and tell me every thing i have to do so i can do it .b/c i dont know anything to do.
[code] Throwable Knives
Forgive me… I didn’t realize this was something I could figure out so quickly. Kudos to the programmers for their liberal commenting of code! 
You might want to submit this to RTCWFiles, im not sure if we already have it listed there, but if its not it definatly should be.
You guys do realize this is changes for the game source, which require compiling a completely new mod to use, not something you can just bind and use on any server, right ?
yeah but i still want to know how to put it in my game and do you bind /throwknife ?
- download game source. If you can’t find it, give up.
- modify the specified files as described in the post. If this doesn’t make sense, learn C until it does. If you don’t know what C is, either figure it out, or give up.
- compile and install as described in the sticky threads. If you can’t follow those instructions, give up.
I’m not trying to be rude, but if you can’t find these things for your self, you really have no chance of getting it to work. You need to make effort to learn this kind of stuff, and if you are not willing to try, it is unreasonable to expect people here to put in the effort to help you.
This is a helpful script for any modders, and i would like to add it to the Tutorial section of the site.
Hm, any news on the subject yet ? I compiled the modified cg_,qg_ and put it in an extra folder. So far it works to throw the knife but if i pick a knife up the game crashes…any updated code for that bacon ?
hmmz,
anyone ever fixed this ? ( 2004 )
During warmup : 165301 secs
Ready : throws knife ( from console ) ( including arm … v_hand dagger ) 
20 secs later for rethrow ( console ) --> [crash]…
exactly pasted as bacon described…
( sourcecode used :2.55 )
I know this is a bit off-topic, but I always thought it would be cool if you could throw down a ‘clip’ of bullets, so that you could share with your teammates in case you had 120 bullets, while your team mate had none. Would something like that be possible?
Yes it is. I remmember doing it in NQ, not so intensive job, you just had to create items and get some model for it. IIRC ammo pickups still work as leftover from RTCW so adding stuff in bg_misc or whatever is it called with some suitable action/command should be enough.
It should be in old nq sources if they’re still available.
i have not yet debugged it , because of the users replied in the topic had similar behaviour with the executeble ( locking up ) and maybe someone had updated code …
ill debug it tonight
…
Unhandled exception at 0x200ede8f (qagame_mp_x86.dll) in ET.exe: 0xC0000005: Access violation reading location 0x40311999.
output.c
#else /* _UNICODE /
if (flags & (FL_LONG|FL_WIDECHAR)) {
if (text.wz == NULL) / NULL passed, use special string */
text.wz = __wnullstring;
bufferiswide = 1;
pwch = text.wz;
while ( i-- && pwch )
++pwch;
textlen = (int)(pwch - text.wz);
/ textlen now contains length in wide chars /
} else {
if (text.sz == NULL) / NULL passed, use special string */
text.sz = __nullstring;
p = text.sz;
while (i-- && p)
++p;
textlen = (int)(p - text.sz); / length of the string */
}
Break on
while (i-- && *p)
Can you find what’s calling that function?
Also, changing Cmd_ThrowKnife_f to this might help a bit:
void Cmd_ThrowKnife_f( gentity_t *ent ) {
vec3_t velocity, offset, org, mins, maxs;
trace_t tr;
gentity_t *traceEnt;
gitem_t *item = BG_FindItemForWeapon(WP_KNIFE);
// can only throw 1 knife every 30 seconds
if ( ent->specialTime && (level.time - ent->specialTime < 30000) ) {
float wait = (level.time - ent->specialTime) * 0.001;
trap_SendServerCommand(ent-g_entities, va("cp \"You must wait %d %s
\"", wait, wait < 2 ? "second" : "seconds" ));
return;
}
// we have to have a throwing knife left
// give us unlimited knifes
/*if ( ent->client->ps.ammo[BG_FindAmmoForWeapon(WP_KNIFE)] == 0 ) {
trap_SendServerCommand(ent-g_entities, "cp \"You do not have any knives
\"");
return;
}*/
// our currently selected weapon must be the knife
if (ent->s.weapon != WP_KNIFE) {
return;
}
AngleVectors(ent->client->ps.viewangles, velocity, NULL, NULL);
VectorScale(velocity, 64, offset);
offset[2] += ent->client->ps.viewheight / 2;
VectorScale(velocity, 800, velocity); // somewhat realistic knife movement
velocity[2] += 50 + rand()%35;
VectorAdd(ent->client->ps.origin, offset, org);
VectorSet( mins, -ITEM_RADIUS, -ITEM_RADIUS, 0);
VectorSet( maxs, ITEM_RADIUS, ITEM_RADIUS, 2 * ITEM_RADIUS);
trap_Trace( &tr, ent->client->ps.origin, mins, maxs, org, ent->s.number, MASK_SOLID);
VectorCopy(tr.endpos, org);
// ideally we want to make a sound play from the client
G_Sound(ent, G_SoundIndex( "sound/weapons/knife/knife_splash1.wav" ));
traceEnt = LaunchItem(item, org, velocity, ent->client->ps.clientNum);
traceEnt->touch = touchKnife;
traceEnt->parent = ent;
// we lose a knife
// bugfix: don't countdown ammo if we're not using ammo, right?
//ent->client->ps.ammo[BG_FindClipForWeapon(WP_KNIFE)]--;
// we should make this throwTime or something so it doesn't interfere with other things that use this...
ent->specialTime = level.time;
}
Tried the updated code …
… it appears to be happening when pressing the binded key throwing a second knife …
im getting 19002343 seconds left … or after that 0 seconds left and then -283238922 seconds left so i think the timer is not doing as it’s supposed to …
havn’t had time to break it on the function yet … but probably as stated above …