rehlds / ReAPI

AMXModX module providing APIs for ReHLDS, ReGameDLL, and Metamod plugins (e.g., ReUnion, ReVoice).
GNU General Public License v3.0
160 stars 105 forks source link

Add RewardAccount as a native enum and not as a custom one #169

Open metita opened 4 years ago

metita commented 4 years ago

RewardRules is the only one working natively on ReAPI, you need to add manually the RewardAccount enum to your plugin and do some tricks to make it works.

for ( new i = 0 ; i < _:RewardRules ; i++ )
{
     rg_set_account_rules( RewardRules:i, 0 );
}

You can call that on AddAccount_Pre and you will effectively block RewardRules, but you cannot call the same way RewardAccount because RewardAccount cannot be call'd natively, because ReAPI does not include it yet, but it is marked as a custom enum (not sure why?)

Can we add RewardAccount into ReAPI natively so we can use rg_set_account_rules with RewardAccount the same way as RewardRules and without having to add the enum to our plugin.

Take as an example REWARD_KILLED_ENEMY, that for won't cover it, or just add REWARD_KILLED_ENEMY and more kill rewards to the original RewardRules enum, so that cover everything.

metita commented 4 years ago

@s1lentq Do you think REWARD_KILLED_ENEMY, REWARD_KILLED_VIP, REWARD_VIP_HAS_SELF_RESCUED can be added into RewardRules? so we can do the this and block all rewards in the game.

for ( new i = 0 ; i < _:RewardRules ; i++ )
{
     rg_set_account_rules( RewardRules:i, 0 );
}
fl0werD commented 4 years ago

@metita check RewardType into cssdk_const.inc. You can block these rewards in AddAccount pre.