Page 1 of 1
mod problem
Posted: 08 Feb 2019, 15:56
by sPe3doN
hi can someone help on my server zombies can pick up weapons and shot on humans
Re: mod problem
Posted: 08 Feb 2019, 17:45
by th3_king
Try this code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
#include <reapi>
#define ALLOWED_KEY 55110
new bool:g_bTKilledCT[33]
public plugin_init()
{
register_plugin("No pickup Weapons", "1.0", "Raheem")
// Hams
RegisterHam(Ham_Touch, "weaponbox", "Fw_TouchWeaponBox_Pre", 0)
RegisterHam(Ham_Touch, "armoury_entity", "Fw_TouchWeaponBox_Pre", 0)
// Forwards
register_forward(FM_SetModel, "Fw_SetModel")
// Events
register_event("DeathMsg", "DeathMsgEvent", "a");
}
public Fw_TouchWeaponBox_Pre(iEnt, iIndex)
{
if(!is_user_alive(iIndex))
return HAM_IGNORED
// Block T From Pick UP Weapons
if(get_member(iIndex, m_iTeam) == TEAM_TERRORIST && !(pev(iEnt, pev_impulse) == ALLOWED_KEY))
{
client_print(iIndex, print_center, "You can't pickup guns!")
return HAM_SUPERCEDE
}
return HAM_IGNORED
}
public Fw_SetModel(iEnt, szModel[])
{
if(!pev_valid(iEnt))
return FMRES_IGNORED
new iOwner = pev(iEnt, pev_owner)
if (g_bTKilledCT[iOwner])
{
set_pev(iEnt, pev_impulse, ALLOWED_KEY)
}
return FMRES_IGNORED
}
public DeathMsgEvent()
{
new iAttacker = read_data(1);
new iVictim = read_data(2);
if (get_member(iAttacker, m_iTeam) == TEAM_TERRORIST && get_user_weapon(iAttacker) == CSW_KNIFE)
{
g_bTKilledCT[iVictim] = true;
}
}
Re: mod problem
Posted: 11 Feb 2019, 22:01
by Spir0x
Th3 king should we use this plugin ? or only him cuz he uses outdated version of our mod ? becuz i don't have this bug on my server.
Re: mod problem
Posted: 12 Mar 2019, 19:47
by Raheem
You should not use it, already included in our Mod.
And what th3_king posted is a general purpose one, i wrote it for DR Mod.