No to zostaw sobie tego KnifeBlocka i dorzuć to jako osobny plugin:
#include <amxmodx>
#include <engine>
#include <hamsandwich>
public plugin_init() {
register_plugin("only awp", "0.2", "grankee")
register_event("CurWeapon","Weapon","be","1=1")
RegisterHam(Ham_Spawn,"weaponbox","box_spawned")
set_task(3.0,"blokuj_enty")
}
public box_spawned(ent)
{
if(!is_awp(ent))
entity_set_int(ent,EV_INT_solid,SOLID_NOT)
}
is_awp(const weaponbox)
{
new model[32]
entity_get_string(weaponbox,EV_SZ_model,model,31)
if(containi(model,"w_awp.mdl")==-1)
return 0
return 1
}
public Weapon(id)
{
new wid = read_data(2)
if(wid==CSW_AWP || wid==CSW_KNIFE) return PLUGIN_CONTINUE
client_cmd(id,"drop")
return PLUGIN_CONTINUE
}
public blokuj_enty(){
new weapbox
while((weapbox=find_ent_by_class(weapbox,"armoury_entity"))!=0)
{
if(!is_awp(weapbox))
entity_set_int(weapbox,EV_INT_solid,SOLID_NOT)
}
while((weapbox=find_ent_by_class(weapbox,"weaponbox"))!=0)
{
if(!is_awp(weapbox))
entity_set_int(weapbox,EV_INT_solid,SOLID_NOT)
}
}
Bo jak kiedyś zmienisz zdanie, że chcesz używać noża to po prostu wyłączysz go sobie, a nie będzie trzeba przerabiać pluginu.
Dodatkowo zablokuj kupowanie granatów (amx_restmenu - jest to domyslny plugin amxa), bo ten kod co prawda nie pozwoli podnieść granata, ale jak ktoś kupi to może użyć. To samo flash/smoke
Użytkownik grankee edytował ten post 02.12.2014 20:12