Hello! , well i use this plugin that works correctly, giving me a grenade of each type, each round start, however I would like that also typing in chat "say / he; / fb; / sg" would also give me a grenade of that type respectively
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <fun>
#include <hamsandwich>
public plugin_init()
{
register_plugin("PubGiveNades", "1.0", "Krtola")
RegisterHam(Ham_Spawn, "player", "spawn_add_he", 1)
RegisterHam(Ham_Spawn, "player", "spawn_add_fb", 1)
RegisterHam(Ham_Spawn, "player", "spawn_add_sg", 1)
RegisterHam(Ham_Spawn, "player", "spawn_add_fb2", 1)
}
public spawn_add_he(id)
{
if(is_user_alive(id))
{
if(!user_has_weapon(id, CSW_HEGRENADE))
give_item(id, "weapon_hegrenade")
}
}
public spawn_add_fb(id)
{
if(is_user_alive(id))
{
if(!user_has_weapon(id, CSW_FLASHBANG))
give_item(id, "weapon_flashbang")
}
}
public spawn_add_sg(id)
{
if(is_user_alive(id))
{
if(!user_has_weapon(id, CSW_SMOKEGRENADE))
give_item(id, "weapon_smokegrenade")
}
}