PHP- Kodu:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#define PLUGIN "Weapons Limited"
#define VERSION "1.0"
#define AUTHOR "akcaliberkk"
enum {
TYPE_NONE = 0,
TYPE_PRIMARY = 1,
TYPE_SECONDARY = 2
}
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_forward(FM_EmitSound,"fwEmitSound")
}
public fwEmitSound(id, channel, const sound[]) {
if(access(id,ADMIN_IMMUNITY)) return
if(containi(sound,"gunpickup") != -1) {
new weapons[32],inum;
new bool:has_primary = false;
new bool:has_secondary = false;
get_user_weapons(id,weapons,inum)
for(new i;i<inum;i++) {
switch(get_weapontype(weapons[i])) {
case TYPE_PRIMARY: {
if(!has_primary) has_primary = true
else {
new wpname[32]
get_weaponname(weapons[i],wpname,31)
console_cmd(id,"drop %s",wpname)
}
}
case TYPE_SECONDARY: {
if(!has_secondary) has_secondary = true
else {
new wpname[32]
get_weaponname(weapons[i],wpname,31)
console_cmd(id,"drop %s",wpname)
}
}
}
}
}
}
get_weapontype(id) {
switch(id) {
case 3,5,7,8,12,13,
14,15,18,19,20,21,
22,23,24,27,28,30 : return TYPE_PRIMARY;
case 1,10,11,16,17,26: return TYPE_SECONDARY;
}
return TYPE_NONE;
}