View Full Version : Please help with my first coding mod

09-22-2004, 12:02 AM
Hello. I've tried to make a server side mod that gives player only enchanced Flechette. So I've boosted a few things, and now I need help with:

1. How to disable weapons and ammo in the maps
2. Make the 'hello' text when player joins the game. So I've tried putting

print \" Hello \"

at the end of code block


Called on a first-time connect
void G_InitSessionData( gclient_t *client, char *userinfo, qboolean isBot ) {



in file game\g_session.c

I don't know if it will work, so plz tell me

3. And the last thing. How to compile that? Since Visual C++ costs 100 bucks I can't download it, but Microsoft offers free Visual C++ toolkit. Can I use it to compile files to .dll file?

Thanks for replies!

09-22-2004, 12:29 AM
I think I've made only Flechette avaible by editing the start weapon (if force saberattack>0 give wp_lightsaber changed to give wp_flechette) But I still don't get a few things. I think that won't work.. and the wapons and ammo will be on the map.
So I think there should be settings like saberonly (to disable ammo and weapons) but player will have flechette, and server will show on the list like server with guns. Any ideas?

And how can I make console command that shows some text in console, and how can I make console command that specifies some thing, like damage size. In g_weapons.c it looks like

And I would like it to use the cvar
#define FLECHETTE_DAMAGE mymod_damage or g_flechettedamage

09-22-2004, 11:16 PM
To your first post -

I think if you want to disable item pickups, you'd probably want to poke around in g_items, probably in the G_SpawnItem and touch_item functions.

For a printed message when you spawn, check g.cmds or g.client. Most of the MP strings are called from there.

09-23-2004, 01:48 AM
Thanks! I've found stuff about respawning ammo and weapons. There is a line
return adjustRespawnTime(g_weaponRespawn.integer, ent->item->giType, ent->item->giTag);
So... may I just change stuff in () to 99999, so it won't respawn?

09-23-2004, 10:30 PM
Well, if you do that, the items will still spawn initally. The best way is to just completely disable them. I've set the code up to do this with the weapon disable cvar in OJP but I don't remember the code at the moment. I suggest you just reference to the OJP source code.