Hello, this plugin
http://forums.alliedmods.net/showthread.php?p=235695 is somehow approved....
On my server sometimes admins don't get those weapons.. Sometimes they do.. All cvars are set how they should be. Anyone that can optimize this code? It's actually very useful plugin.
PHP Code:
#include <amxmodx>
#include <amxmisc>
#define ADMIN_LEVEL ADMIN_CHAT
public check_awp()
{
if (get_cvar_num("sv_noawp") != 1)
return PLUGIN_CONTINUE
new id = read_data(0)
if(get_cvar_num("sv_allow_admin_awp") == 1 && access(id, ADMIN_LEVEL))
{
return PLUGIN_CONTINUE
}
client_print(id, print_center, "AWP's are not allowed. Find a real gun!")
client_cmd(id, "weapon_g3sg1;wait;wait;wait;drop")
return PLUGIN_CONTINUE
}
public check_g3sg1()
{
if (get_cvar_num("sv_nog3sg1") != 1)
return PLUGIN_CONTINUE
new id = read_data(0)
if(get_cvar_num("sv_allow_admin_auto") == 1 && access(id, ADMIN_LEVEL))
{
return PLUGIN_CONTINUE
}
client_print(id, print_center, "G3SG1's are not allowed. Find a real gun!")
client_cmd(id, "weapon_g3sg1;wait;wait;wait;drop")
return PLUGIN_CONTINUE
}
public check_sg550()
{
if (get_cvar_num("sv_nosg550") != 1)
return PLUGIN_CONTINUE
new id = read_data(0)
if(get_cvar_num("sv_allow_admin_sg550") == 1 && access(id, ADMIN_LEVEL))
{
return PLUGIN_CONTINUE
}
client_print(id, print_center, "SG550's are not allowed. Find a real gun!")
client_cmd(id, "weapon_g3sg1;wait;wait;wait;drop")
return PLUGIN_CONTINUE
}
public plugin_init(){
register_plugin("Drop Awp","1.1c","Dynamite")
register_event("WeapPickup","check_awp","b","1=18")
register_event("WeapPickup","check_g3sg1","b","1=24")
register_event("WeapPickup","check_sg550","b","1=13")
register_cvar("sv_allow_admin_g3sg1", "0")
register_cvar("sv_allow_admin_sg550", "0")
register_cvar("sv_allow_admin_awp", "0")
register_cvar("sv_nog3sg1","1")
register_cvar("sv_nosg550","1")
register_cvar("sv_noawp","1")
return PLUGIN_CONTINUE
}
Also i've changed some bugs by myself like here
PHP Code:
client_print(id, print_center, "SG550's are not allowed. Find a real gun!")
client_cmd(id, "weapon_g3sg1;wait;wait;wait;drop")
weapon g3sg1 everywhere... But still admins sometimes don't recieve weapons.
Thanks to everyone who wants to help.
__________________