im trying to create a plugin that will drop health and ammo and take away the appropriate amount of res from the marine team. Im new at this, first plugin. Heres what i have so far:
Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
//#include <ns>
public plugin_init()
{
register_plugin("Ns_medpack Giver","1.0","Rorthic")
register_cvar("ns_medpack_enable","1")
register_clcmd("say_team /medpack", "med")
register_clcmd("say /medpack", "med")
register_clcmd("say_team /health", "med")
register_clcmd("say /health", "med")
register_clcmd("say_team /ammo", "ammo")
register_clcmd("say /ammo", "ammo")
}
public plugin_modules()
{
require_module("fun")
}
public ammo(id) //not working for some reason, dosent give the ammo
{
if(get_cvar_num("ns_medpack_enable")==1)
{
new item[33]
item = "item_genericammo" //
give_item(id,item)
return PLUGIN_HANDLED
}
else if(get_cvar_num("ns_medpack_enable")==0)
client_print(id,print_console,"[NS Give medpack]This plugin is disable. Set ns_medpack_enable to 1 to re-enable.")
return PLUGIN_CONTINUE
}
public med(id)
{
if(get_cvar_num("ns_medpack_enable")==1)
{
new item[33]
item = "item_health"
give_item(id,item)
return PLUGIN_HANDLED
}
else if(get_cvar_num("ns_medpack_enable")==0)
client_print(id,print_console,"[NS Give medpack]This plugin is disable. Set ns_medpack_enable to 1 to re-enable.")
return PLUGIN_CONTINUE
}
it drops the meds but not the ammo.
questions
1: why dosent the ammo work when its identical to the med?
2: how would i get the current res amount for the marine team, then change it to a new value?
i tried ns_give_item in place of five item and in game nothing happens for either meds or ammo. there is no errors in either case.
also if there is already one that does something like this let me know, may not need to build my own.
Thanks