Manipulate weapons between same opposing classes?


(*NOB* Perica) #1

Hi!

I’m trying to figure out how to make say, allied covert not to have binoculars, smoke greande etc…and I was messing around g_client.c but didn’t find a way how to do it -> although I managed to make allied covert panz-only. :clap:

Any advices?

Thx!


(Demolama) #2

g_client clientspawn


(*NOB* Perica) #3

Thanks! Will give it a look!


(Salteh) #4

g_client.c
–> SetWolfSpawnWeapons

imo :slight_smile:


(*NOB* Perica) #5

Yeah, but I would like to say, give axis covert binocs and the allied has none.
How do I do that?
I know how to change weapons, but how to change their gear?


(Demolama) #6

oh yea thats what I meant… dumb me… SetWolfSpawnWeapons


(Demolama) #7
if( AddWeaponToPlayer( client, WP_BINOCULARS, 1, 0, qfalse ) ) 
				{
					client->ps.stats[STAT_KEYS] |= ( 1 << INV_BINOCS );
				}

find that and add a check for the team


(*NOB* Perica) #8

Add a check for the team?
I don’t understand.
There is only occurance of Binocs for covert ops and so what am I supposed to do with it?

Add “TEAM_ALLIED” or something?


(Jaquboss) #9

you must use another if , there is many examples of this in the sources
you should probably use this if( ps->persistant[PERS_TEAM] == TEAM_AXIS )
or maybe not , I am not really sure , try it…


(bacon) #10

[quote=“NOB Perica”]

Add a check for the team?
I don’t understand.
There is only occurance of Binocs for covert ops and so what am I supposed to do with it?

Add “TEAM_ALLIED” or something?[/quote]

Change it to

if ( client->sess.sessionTeam == TEAM_AXIS ) {
				if( AddWeaponToPlayer( client, WP_BINOCULARS, 1, 0, qfalse ) ) {
					client->ps.stats[STAT_KEYS] |= ( 1 << INV_BINOCS );
				}
			}

And you’re done.

This code goes under

default:
				AddWeaponToPlayer( client, WP_STEN, 2*(GetAmmoTableData(WP_STEN)->defaultStartingAmmo), GetAmmoTableData(WP_STEN)->defaultStartingClip, qtrue );
				break;
			}

(Demolama) #11

well Im glad someone was nice enough to do his homework for him

I just pointed him to the statement he needs to look for… and told him what he needed to add… if he cant put 2 and 2 together than maybe modding isnt his thing

dont mean to sound rude… but this task wasnt that difficult and how is supposed to learn if people do his work for him


(*NOB* Perica) #12

I’m currently working on a mod which will include new skins + additional body model enhancements, completely new voicechat on two languages for both allies & axis (this alone takes LOTS of time to nail), modified weapons (knives), and very likely new faces models for every class.

I am doing this (like most of the modders) alone and tell u the truth I can’t be an expert for its each and every aspect, so I ask people for help.

If that’s too hard for u to understand, then I’m sorry but it’s the way it this, but don’t imply that I KNOW C++ but just don’t wanna bother. I got the damn thing 6-7 days ago and my only programming experience comes from Amiga Basic 10 yrs ago, so u figure out how those two compare. :wink:


(*NOB* Perica) #13

Thanks Bacon!

Just by looking at the code u modified, I learned what actually adding a check for the team means!