23/05/2018, 09:28 PM
como lo dice el titulo.. solo dropea armas por su tipo. esto ya esta en reapi de otra forma pero por slots y como yo no uso rehlds me vi forzado a recrearlo con amxx es simple de usar.
Req: AMXMODX 1.8.3 por el client_print_color pero lo pueden quitar y funcionaria para AMXMODX 1.8.2 también xd
por si lo quieren agregarlo a un mod personalizado solo tendrían que añadir el 'native' y el 'enum' en sus includes, las constantes de las armas las conseguí en la include de cstrike_const.inc.
para usarlo correctamente solamente drop_wpn_by_type(el id del player, el tipo de arma a dropear bien sea PISTOLS ó SHOTGUNS ó SMGS ó RIFLES ó SNIPERRIFLES)
re100 lo paso a native antes lo tenia en un stock si hay alguna falla comenten
Req: AMXMODX 1.8.3 por el client_print_color pero lo pueden quitar y funcionaria para AMXMODX 1.8.2 también xd
por si lo quieren agregarlo a un mod personalizado solo tendrían que añadir el 'native' y el 'enum' en sus includes, las constantes de las armas las conseguí en la include de cstrike_const.inc.
para usarlo correctamente solamente drop_wpn_by_type(el id del player, el tipo de arma a dropear bien sea PISTOLS ó SHOTGUNS ó SMGS ó RIFLES ó SNIPERRIFLES)
Código PHP:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <cstrike>
enum WEAPONS_BY_TYPE
{
PISTOLS = (1<<CSW_P228 | 1<<CSW_ELITE | 1<<CSW_FIVESEVEN | 1<<CSW_USP | 1<<CSW_GLOCK18 | 1<<CSW_DEAGLE),
SHOTGUNS = (1<<CSW_M3 | 1<<CSW_XM1014),
SMGS = (1<<CSW_MAC10 | 1<<CSW_UMP45 | 1<<CSW_MP5NAVY | 1<<CSW_TMP | 1<<CSW_P90),
RIFLES = (1<<CSW_AUG | 1<<CSW_GALIL | 1<<CSW_FAMAS | 1<<CSW_M4A1 | 1<<CSW_AK47 | 1<<CSW_SG552),
SNIPERRIFLES = (1<<CSW_SCOUT | 1<<CSW_AWP | 1<<CSW_G3SG1 | 1<<CSW_SG550),
MACHINEGUNS = (1<<CSW_M249)
}
native drop_wpn_by_type(const id, WEAPONS_BY_TYPE:type)
public plugin_init()
{
register_plugin("Drop Weapon by Type", "1.0", "OsweRRR;")
register_clcmd("say t", "test")
}
public test(id)
{
drop_wpn_by_type(id, RIFLES)
drop_wpn_by_type(id, PISTOLS)
drop_wpn_by_type(id, SMGS)
drop_wpn_by_type(id, MACHINEGUNS)
client_print_color(id, print_team_red, "^3UPS :(^1 Hicimos dropear tus armas.")
}
public plugin_natives()
{
register_native("drop_wpn_by_type", "pfn_drop_")
}
public pfn_drop_(plugin, params)
{
new id
new WEAPONS_BY_TYPE:type
new num
new wpn_id[32]
new wpn_name[33]
new i
id = get_param(1)
type = WEAPONS_BY_TYPE:get_param(2)
get_user_weapons(id, wpn_id, num)
for(i = 0; i < num; i++)
{
if((1<<wpn_id[i]) & _:type)
{
get_weaponname(wpn_id[i], wpn_name, charsmax(wpn_name))
engclient_cmd(id, "drop", wpn_name)
}
}
}
re100 lo paso a native antes lo tenia en un stock si hay alguna falla comenten