Ight so here is the edited one... DK why you had the sizeof there... but here ya go
When player types m4a1 he recieves one (tested scout, m4a1, p90)
PHP Code:
#include <amxmodx>
#include <fun>
//WPN
new weapon_list[9][] = {
"scout",
"sg550",
"famas",
"usp",
"awp",
"m249",
"m4a1",
"deagle",
"p90"
};
public plugin_init() {
register_plugin("WPN", "0.01", "Ex3cuTioN");
register_clcmd("say","cmdWPN");
}
public cmdWPN(id) {
static s_Args[32];
read_args(s_Args, charsmax(s_Args));
if(!s_Args[0])
return PLUGIN_CONTINUE;
remove_quotes(s_Args);
for(new i = 0; i < 9; i++)
{
if(equal(s_Args , weapon_list[i]))
{
//Dont need to replace beacsue you use Equal.. It wont take /m4a1
new weaponName[32];
format(weaponName, charsmax(weaponName), "weapon_%s", s_Args);
give_item(id, weaponName);
client_print(id, print_chat, "You received %s", weaponName);
}
}
return PLUGIN_CONTINUE;
}