friendly fire


(jobe314) #1

i want to put disable friendly fire for all my mod, but i don’t understand how to make it in source code (it’s not a boolean).
thx


(Jaquboss) #2

i want to put disable friendly fire for all my mod

So what do you exactly wish?


(jobe314) #3

i want players in same team dont do dmg each other.
by defaut, when you run ET, it’s Enable friendly fire (the box is check).
And i want to put it Disable by default but i dont understand the g_friendlyfire function in source code.


(kamikazee) #4

If you configure your server so that friendly fire is off, it stays off. You can stop people from voting for it as well.
I don’t think you need a new mod just for this small (in my eyes even non-existant) issue, imho.


(Jaquboss) #5

solution is in g_main.c see this line

	{ &g_friendlyFire, "g_friendlyFire", "1", CVAR_SERVERINFO | CVAR_ARCHIVE, 0, qtrue, qtrue },

the string after console name is “1” here, changing it to “0” will make it off by default
eg

	{ &g_friendlyFire, "g_friendlyFire", "0", CVAR_SERVERINFO | CVAR_ARCHIVE, 0, qtrue, qtrue },

however you can just as kamikazee said configure your server…


(jobe314) #6

ok ty.
its just a detail i wanna put in my mod, i’m not so crazy to do a mod just for that. :bump:


(Cheez It) #7

If you leave it like that the user can still change it, it needs to be:

	{ &g_friendlyFire, "g_friendlyFire", "0", CVAR_SERVERINFO | CVAR_ROM, 0, qtrue, qtrue },


(Shanks) #8

IMO forcing it to off will turn off those who like ff on, CVAR_LATCH would be a better way to go.