rg_set_account_rules not working properly?
Is this function not working at all or I misunderstood what it does? Does it change the default money rewards, or it does something else? I tried using rg_set_account_rules(RR_CTS_WIN, 666) in plugin_init() but I didn't get the 666 reward when playing as CT and winning the round. Same goes for all other account types. rg_get_account_rules() however displays the changed value.
May be bomb was defused.
m_iAccountCT += m_rgRewardAccountRules[m_bMapHasBombTarget ? RR_BOMB_DEFUSED : RR_CTS_WIN];
https://github.com/s1lentq/ReGameDLL_CS/blob/6186ae56c8dd9e0d6e85071b82688cc059b15e55/regamedll/dlls/multiplay_gamerules.cpp#L1362
That worked, but it's not supposed to be like that. There was no bomb planted on the map, so it should use RR_CTS_WIN. I see that it checks if the map has a bomb target, so either the code is wrong or the name of the const. RR_BOMB_DEFUSED should be given when the bomb is defused, and RR_CTS_WIN if there was no bomb at all. Also, another thing - changing the account rules once makes them stay forever. After removing the plugin, restarting the map, even shutting down the server and starting it again - the modified values are still there.
changing the account rules once makes them stay forever. After removing the plugin, restarting the map, even shutting down the server and starting it again - the modified values are still there.
LoL you sure you removed the plugin ?
I didn't actually remove it, but I commented the lines that change the account rules, which is the same.
I set RR_BOMB_EXPLODED to 333 and RR_TERRORISTS_WIN to 444. I planted the bomb and I let it explode. On the next round I had 4300$ (previously they were 800$), which means I didn't get any of the rewards.
According to this line in multiplay_gamerules.cpp:
m_iAccountTerrorist += m_rgRewardAccountRules[m_bMapHasBombTarget ? RR_BOMB_EXPLODED : RR_TERRORISTS_WIN];
... the terrorists will receive the RR_BOMB_EXPLODED amount if the map has a bomb target independent of whether the bomb exploded or not and they will receive RR_TERRORISTS_WIN amount if the map doesn't have a bomb target. What this means is, the terrorists will receive RR_BOMB_EXPLODED on de_* maps if they killed all the Counter-Terrorists without planting the bomb. However none of the two are given, even though checking the value with rg_get_account_rules returns the changed value. Same goes for CTs and defusing it. The code is wrong.