Hello everyone!
Is there a way to change the RELATIONSHIP between two CLASS?
For example, I wanna set CLASS_NONE and CLASS_MACHINE to be hostile (RL_NM).
How can i do that ?
thanks !![]()
Not possible. You would need to implement your own class system, or make custom monsters.
Love,
w00tguy
With the PlayerTakeDamage hook you can override the class system for players. I think you've already done that with this script?
https://forums.svencoop.com/showthre...gin-PVP-Enable
To create a new class/team for that script, you can set a custom keyvalue on the player and then write your own isAlly() function.
I'm pretty sure I don't understand your question, but if you wanted 3 teams where 1 class could attack itself:
1) TEAM_A (can't attack themselves)
2) TEAM_B (can't attack themselves)
3) TEAM_C (can attack themselves)
Then you could check ally status with:
Then call that in the PlayerTakeDamage hook before applying damage.Code:bool isAlly(int attackerClass, int victimClass) { return attackerClass != victimClass or (attackerClass == TEAM_C and attackerClass == victimClass); }
Last edited by w00tguy123; 03-03-2019 at 02:40 PM.
Love,
w00tguy
Much Thx!
Sorry about my poor English, i am not a native speaker...much apologize for my vague language.
i did want 3 teams where 1 class could attack itself, and thanks for your answer.
In fact, i had trid this method wtih changing player.pev.team and checked it before applying damage. however, i found that if i do so, every weapon could not do any damage except bullet weapons, and the HUD shown that everyone is ally.
Thanks!
There are sometimes unwanted side-effects when changing the default keyvalues. I used to think pev.iuser1 was unused, but setting to 1 makes third-person weapon models invisible! It's safer to use custom keyvalues for stuff like this.
Love,
w00tguy