Combining multiple not statements for the same parameter like that does not work. How this functions internally is that all conditions for a specific parameter are connected with
or and all conditions for distinct parameters are connected with
and.
In plugin pseudo-code it roughly works like this:
Code:
// Walk through all parameters of the current register_event forward
for (new param = 0; param < paramc; ++param) {
new execute = 0;
new condc = get_condc(param);
/* Check each condition for the current parameter. If any one of them
applies, set the execute flag - effectively making this an *or* connection */
for (new cond = 0; cond < condc; ++cond) {
if (match_cond(param, cond))
execute = 1;
}
/* If the current parameter has any conditions, but none of them match
we exit out - so while the conditions for the current parameter are connected
with or, conditions across different parameters are connected with *and* */
if (condc > 0 && !execute)
return;
}
fire_forward();
Going even simpler, your first register_event basically causes this to happen internally:
Code:
if (!equal(param4, "usp") || !equal(param4, "elites")) {
// do stuff
}
This will always be true, since parameter 4 will either not equal "usp" or not equal "elites" - it can't be both. The function will be executed for all weapons. The second version will result in logic equivalent to this:
Code:
if (equal(param4, "usp") || equal(param4, "elites")) {
// do stuff
}
This will obviously trigger only if parameter 4 either equals "usp" or "elites" - exactly what you expect and what your tests show.
To achieve what you want you need to use two separate register_event calls. You can have them both call the same function without issues.
Great question btw
__________________