Solved mod problem

Installation Problems Support
Post Reply
User avatar
sPe3doN
Senior Member
Senior Member
Algeria
Posts: 258
Joined: 7 years ago
Contact:

mod problem

#1

Post by sPe3doN » 5 years ago

hi can someone help on my server zombies can pick up weapons and shot on humans
Image

User avatar
th3_king
VIP
VIP
Egypt
Posts: 35
Joined: 6 years ago
Location: Egypt
Contact:

#2

Post by th3_king » 5 years ago

Try this code:
  1. #include <amxmodx>
  2. #include <hamsandwich>
  3. #include <fakemeta>
  4. #include <reapi>
  5.  
  6. #define ALLOWED_KEY 55110
  7.  
  8. new bool:g_bTKilledCT[33]
  9.  
  10. public plugin_init()
  11. {
  12.     register_plugin("No pickup Weapons", "1.0", "Raheem")
  13.    
  14.     // Hams
  15.     RegisterHam(Ham_Touch, "weaponbox", "Fw_TouchWeaponBox_Pre", 0)
  16.     RegisterHam(Ham_Touch, "armoury_entity", "Fw_TouchWeaponBox_Pre", 0)
  17.    
  18.     // Forwards
  19.     register_forward(FM_SetModel, "Fw_SetModel")
  20.    
  21.     // Events
  22.     register_event("DeathMsg", "DeathMsgEvent", "a");
  23. }
  24.  
  25. public Fw_TouchWeaponBox_Pre(iEnt, iIndex)
  26. {
  27.     if(!is_user_alive(iIndex))
  28.         return HAM_IGNORED
  29.    
  30.     // Block T From Pick UP Weapons
  31.     if(get_member(iIndex, m_iTeam) == TEAM_TERRORIST && !(pev(iEnt, pev_impulse) == ALLOWED_KEY))
  32.     {
  33.         client_print(iIndex, print_center, "You can't pickup guns!")
  34.         return HAM_SUPERCEDE
  35.     }
  36.    
  37.     return HAM_IGNORED
  38. }
  39.  
  40. public Fw_SetModel(iEnt, szModel[])
  41. {
  42.     if(!pev_valid(iEnt))
  43.         return FMRES_IGNORED
  44.    
  45.     new iOwner = pev(iEnt, pev_owner)
  46.    
  47.     if (g_bTKilledCT[iOwner])
  48.     {
  49.         set_pev(iEnt, pev_impulse, ALLOWED_KEY)
  50.     }
  51.  
  52.     return FMRES_IGNORED
  53. }
  54.  
  55. public DeathMsgEvent()
  56. {
  57.     new iAttacker = read_data(1);
  58.     new iVictim = read_data(2);
  59.    
  60.     if (get_member(iAttacker, m_iTeam) == TEAM_TERRORIST && get_user_weapon(iAttacker) == CSW_KNIFE)
  61.     {
  62.         g_bTKilledCT[iVictim] = true;
  63.     }
  64. }

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 641
Joined: 7 years ago
Location: Tunisia
Contact:

#3

Post by Spir0x » 5 years ago

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.

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#4

Post by Raheem » 5 years ago

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.
He who fails to plan is planning to fail

Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Who is online

Users browsing this forum: No registered users and 4 guests