Code:
// GIVING CLIENT ATTACKS ESF v1.2b by Mr. Satan
//=========================================================
#include <amxmod>
#include <amxmisc>
public give_item_pvk(admin_index,victim_index,weapon_give[])
{
new arg1[32]
read_argv(1,arg1,32)
new name[32]
get_user_name(victim_index,name,32)
// Remove The slashes before the follow 2 lines of code to enable info messages
// set_hudmessage(200, 50, 0, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1)
// show_hudmessage(0,"%s Has Been Given An Attack",name)
// Items
if (equal(weapon_give,"all")){
give_item(victim_index,"item_chainmail")
give_item(victim_index,"item_food")
give_item(victim_index,"item_leather")
give_item(victim_index,"item_platemail")
give_item(victim_index,"item_treasurechest")
} else if (equal(weapon_give,"chainmail")){
give_item(victim_index,"item_chainmail")
} else if (equal(weapon_give,"food")){
give_item(victim_index,"item_food")
} else if (equal(weapon_give,"leather")) {
give_item(victim_index,"item_leather")
} else if (equal(weapon_give,"platemail")){
give_item(victim_index,"item_platemail")
} else if (equal(weapon_give,"tchest")){
give_item(victim_index,"item_treasurechest")
} else {
client_print(admin_index,print_console,"[AMXX] There is no such item")
return PLUGIN_CONTINUE
}
// client_print(admin_index,print_console,"[AMXX] Client ^"%s^" has been given an item",name)
return PLUGIN_CONTINUE
}
public admin_item_pvk(id)
{
if (!(get_user_flags(id)&ADMIN_LEVEL_A)) {
client_print(id,print_console,"[AMXX] You have no access to that command")
return PLUGIN_HANDLED
}
new argc = read_argc()
if (argc < 3) {
client_print(id,print_console,"[AMXX] Usage: amx_item_pvk < part of nick > or < # index > < item to give >")
return PLUGIN_HANDLED
}
new arg1[32]
new arg2[32]
new arg3[32]
read_argv(1,arg1,32)
read_argv(2,arg2,32)
read_argv(3,arg3,32)
//Index
if (equal(arg1,"#")) {
if (is_user_connected(str_to_num(arg2))) {
give_item_pvk(id,str_to_num(arg2),arg3)
} else {
client_print(id,print_console,"[AMXX] Client not found")
}
} else {
new player = find_player("lb",arg1)
if (player) {
give_item_pvk(id,player,arg2)
} else {
client_print(id,print_console,"[AMXX] Client with that part of nick not found")
}
}
return PLUGIN_HANDLED
}
public plugin_init()
{
register_plugin("PVK Give Items","1.2b","Dewd In The Newd")
register_concmd("amx_item_pvk","admin_item_pvk",ADMIN_LEVEL_A,"<part of nick> or <# index> <item to give>")
return PLUGIN_CONTINUE
}