hello, im trying to make a plugin for pistols only, or other onlys, but when i get to the most important part of the plugins, restricting, it doesnt work right, sometimes it restricts and then when i want to unrestrict with another vote it doesnt unrestrict, or the other way round. this is the code for when the votes finishes:
Code:
if (choice[0] > choice[1]) {
server_cmd("exec addons/amxmodx/configs/pistol.cfg");
/*server_cmd("amx_restrict on");
server_cmd("amx_restrict off pistol");
server_cmd("amx_restrict off equip");
server_cmd("amx_restrict off ammo");
server_cmd("amx_restrict save");*/
client_print(0, print_chat, "* Votacion Aprobada para Solo pistolas (si ^"%d^") (no ^"%d^"). *", choice[0], choice[1]);
}else{
server_cmd("exec addons/amxmodx/configs/allweapons.cfg");
/*server_cmd("amx_restrict off");
server_cmd("amx_restrict save");*/
client_print(0, print_chat, "* Todas las armas permitidas (si ^"%d^") (no ^"%d^"). *", choice[0], choice[1]);
i have tried using directly the amx_restrict in the plugin, or executing a cfg that contains the restrictions, but both didnt work well(the amx_restrict are commented because i was testing the other way)
so why restricting with this method doesnt work correctly?