Changing weapons for classes


(incoming!) #21

yo guys i have problem whit my thomspson,mp40
i want to give a mp40 and a thompson to medic and fieldops(ALIIES AND AXIS)

but when i am in the game

i c the choice i can choose a mp40 as an allied medic but when i choose i spawn and i have a thomson help me

g_client c

else if( pc == PC_MEDIC ) {
if( client->sess.skill[SK_BATTLE_SENSE] >= 1 ) {
if( AddWeaponToPlayer( client, WP_BINOCULARS, 1, 0, qfalse ) ) {

				client->ps.stats[STAT_KEYS] |= ( 1 << INV_BINOCS );
				AddWeaponToPlayer( client, WP_MP40,  GetAmmoTableData(WP_MP40)->defaultStartingAmmo, GetAmmoTableData(WP_MP40)->defaultStartingClip, qtrue );
			AddWeaponToPlayer( client, WP_THOMPSON, GetAmmoTableData(WP_THOMPSON)->defaultStartingAmmo, GetAmmoTableData(WP_THOMPSON)->defaultStartingClip, qtrue );

bg_classes c

PC_MEDIC,
	"characters/temperate/axis/medic.char",
	"ui/assets/mp_health_red.tga",
	"ui/assets/mp_arrow_red.tga",
	{ 
		WP_MP40,
		WP_THOMPSON,


	},	
},

(raffles) #22

You have put it with when you get binoculars, which is when you get to level 1 battle sense, try:


 else if( pc == PC_MEDIC ) {
if( client->sess.skill[SK_BATTLE_SENSE] >= 1 ) {
if( AddWeaponToPlayer( client, WP_BINOCULARS, 1, 0, qfalse ) ) {

client->ps.stats[STAT_KEYS] |= ( 1 << INV_BINOCS );
}
}

AddWeaponToPlayer( client, WP_MP40, GetAmmoTableData(WP_MP40)->defaultStartingAmmo, GetAmmoTableData(WP_MP40)->defaultStartingClip, qtrue );
AddWeaponToPlayer( client, WP_THOMPSON, GetAmmoTableData(WP_THOMPSON)->defaultStartingAmmo, GetAmmoTableData(WP_THOMPSON)->defaultStartingClip, qtrue ); 

Also, since you are giving them the Thompson and MP40 regardless of which one they choose (if I understood correctly), you don’t need the bit in bg_classes.c - which means your mod will stay server side :slight_smile:


(incoming!) #23

Hey i dont want to the mod work when i create a server man can u plz help me


(raffles) #24

I’m not sure I understand you.

What I think you mean is you have overwritten the original DLLs in etmain and can’t start a server without your mod anymore.

Well, if you don’t have the original DLLs, you can either reinstall the game or compile them from the original source code (before your modifications).


(incoming!) #25

Hey can i have the email of one of you (if your good in mod) and i will add on msn and it will b easier to help me plz someone


(bacon) #26

Or he can extract the DLLs from mp_bin.pk3


(incoming!) #27

Hey the thing i want is

when i compile the mod.i start ET and i choose a server.when i enter the game i want to b able to choose a thompson as an axis medic ans vice versa

and i want to it work without i must host a server

and i need your msn adress plz


(raffles) #28

So let me get this straight, you think you will be able to modify the client so you can pick whatever weapon you want on someone else’s server?

:lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol:

Sorry, but it can’t be done, because weapon assignments are server-side.

You do know you can pickup enemy SMGs right? Providing you are using an SMG to start with.

If you mean do that with a client on your own server, then you can because you have the server-side code on your server.

Can you elaborate a bit more on what you want?


(incoming!) #29

i can pick up the enemy smg but… i dont spawn whit a thompson when i choose a thompson as a axis medic…