Resolved mod problem

Installation Problems Support
Post Reply
User avatar
sPe3doN
Senior Member
Senior Member
Algeria
Logged in via: Android
Posts: 187
Joined: 2 Years Ago
Has thanked: 14 times
Been thanked: 7 times
Age: 19
Contact:

mod problem

#1

Post by sPe3doN » 5 Months Ago

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

User avatar
th3_king
VIP
VIP
Egypt
Posts: 35
Joined: 2 Years Ago
Location: Egypt
Has thanked: 10 times
Been thanked: 2 times
Age: 17
Contact:

#2

Post by th3_king » 5 Months 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: 626
Joined: 2 Years Ago
Location: Tunisia
Has thanked: 14 times
Been thanked: 7 times
Age: 19
Contact:

#3

Post by Spir0x » 5 Months 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.
I trynna make money, not friends.

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1880
Joined: 2 Years Ago
Location: Egypt
Has thanked: 31 times
Been thanked: 101 times
Age: 21
Contact:

#4

Post by Raheem » 4 Months 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.
You don't know? Learn and you will know.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest