Closed ghost closed 11 years ago
leaving this here:
https://forums.alliedmods.net/showthread.php?t=178055 http://docs.sourcemod.net/api/index.php?fastload=show&id=82& SetEntProp http://docs.sourcemod.net/api/index.php?fastload=show&id=81& GetEntProp http://wiki.alliedmods.net/Pawn_Tutorial#Expressions
thinking out loud here if this is really obvious please tell me!!
it seems like the above code is storing whatever the current play condition is as a number, then applying a bitwise add to the bitwise complement of PLAYER_FIRSTBlOOD (which is 1<<11), which will have the effect of removing the bit for firstblood if it's present. so suppose the GetEntProp returned 101101010101, performing cond & ~PLAYER_FIRSTBLOOD would be the same as 101101010101 & 011111111111 == 001101010101, so setting SetEntProp(killer, Prop_Send, "m_nPlayerCond", cond & ~PLAYER_FIRSTBLOOD); or SetEntProp(killer, Prop_Send, "m_nPlayerCond", 001101010101); will reset killer's condtion to be without the firstblood flag if it was present
if this is the case any #define with the value (1<<11) should work, however it makes sense to define PLAYER_FIRSTBLOOD separately.
so player_death might look like this https://gist.github.com/5ac95e190977c1331ff6
We set tf_arena_first_blood 0
in ActivatePlugin, should no longer be an issue.
leaving this here:
function we should be targeting : public Action:player_death(Handle:event, const String:name[], bool:dontBroadcast)
/ new killer = GetClientOfUserId(GetEventInt(event, "attacker")); new cond = GetEntProp(killer, Prop_Send, "m_nPlayerCond"); SetEntProp(killer, Prop_Send, "m_nPlayerCond", cond & ~PLAYER_FIRSTBLOOD); / source http://forums.alliedmods.net/showthread.php?t=99147