Code: Select all
forward grenade_throw( index,greindex,wId );
Mai jos plugin , pentru exemplu.
Peste 15 secunde dupa ce ai aruncat HE , primeste inca un HE.
Code: Select all
#include <amxmodx>
#include <fun>
#define PLUGIN "test"
#define VERSION "1.0"
#define AUTHOR "ExoTiQ"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
}
public grenade_throw ( index, greindex, wId )
{
if(wId==4) set_task(15.0,"give_he" ,index, _, _, "a", 1)
return PLUGIN_CONTINUE
}
public give_he( index) {
give_item(index,"weapon_hegrenade")
return PLUGIN_CONTINUE
}
Poftim info din amxmodx.inc
Code: Select all
/**
* Returns the weapon id, otherwise 0 when no id found.
* The weapon name is case sensitive, and has the weapon_* form.
*/
native get_weaponid(const name[]);
Code: Select all
get_weaponid(const name[])
Eu am folosit If( wId == 4 ) unde wId == 4 inseamna Weapon ID 4 (weapon_hegrenade).
Poftim lista cu weapons id - https://wiki.alliedmods.net/CS_Weapons_Information