mod problem
- th3_king
- VIP
- Posts: 31
- Joined: 1 Year Ago
- Location: Egypt
- Has thanked: 9 times
- Been thanked: 2 times
- Age: 16
- Contact:
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;
- }
- }
Who is online
Users browsing this forum: No registered users and 1 guest