Your ideas for v1.6

Community News/Announcements
User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

Your ideas for v1.6

#1

Post by Raheem » 3 years ago

Hello there :smiley:,

We will make new version of the Mod, so in this topic post:
  • Your ideas or any missing feature :bulb:
  • Any bug to be fixed :gear:
Waiting your awesome ideas :boom: :boom: :boom:.
He who fails to plan is planning to fail

czirimbolo
Veteran Member
Veteran Member
Poland
Posts: 598
Joined: 7 years ago
Contact:

#2

Post by czirimbolo » 3 years ago

Ideas:
- Global limit for items and guns(individual limit alreadt excist)
- Survivor round or something similar? Lets make game more attractive
Image

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

#3

Post by Raheem » 3 years ago

czirimbolo wrote: 3 years ago Ideas:
- Global limit for items and guns(individual limit alreadt excist) [Accepted ✔️]
- Survivor round or something similar? Lets make game more attractive [Can be a separate addon ❌]
OK, first idea already done in this commit: https://github.com/raheem-cs/Zombie-Esc ... 4e467c2522

The idea as following, for example if setting is: If GLOBAL LIMIT is zero in ze_extraitems.ini, then there is a limit for individual player of 2 and global limit feature is disabled.
Another example: As you see if GLOBAL LIMIT have any value greater than zero, then the individual limit will be disabled. And there will be global limit for all players of 15. So it does not mater LIMIT value if GLOBAL LIMIT already take value greater than zero.

So using this new feature you can make some items to have global limit like powerful guns... etc. Also please note that you cannot set the global limit in ze_register_item() native, only individual limit can be set in this function.

This feature will be available in version 1.6.
He who fails to plan is planning to fail

karan
Mod Tester
Mod Tester
India
Posts: 122
Joined: 6 years ago
Location: India
Contact:

#4

Post by karan » 3 years ago

Idea
1.Individual knockback for all guns.
Image

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

#5

Post by Raheem » 3 years ago

karan wrote: 3 years ago Idea
1.Individual knockback for all guns.
I think the current knockback does not modify the weapons knockback, it just increase the overall knock of all weapons by percentage. So you can use any plugin that can change weapons knockback and it will work correctly. Further you can disable Mod knockback and control the knock of weapons by any plugin.
He who fails to plan is planning to fail

karan
Mod Tester
Mod Tester
India
Posts: 122
Joined: 6 years ago
Location: India
Contact:

#6

Post by karan » 3 years ago

Raheem wrote: 3 years ago
karan wrote: 3 years ago Idea
1.Individual knockback for all guns.
I think the current knockback does not modify the weapons knockback, it just increase the overall knock of all weapons by percentage. So you can use any plugin that can change weapons knockback and it will work correctly. Further you can disable Mod knockback and control the knock of weapons by any plugin.
yes raheem i know that but the problem is when i set plugin weapon modifier and disable default kb ; in freeze time zombies getting hit i mean kb is working which is not good for mod how can i fix that.
Image

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

#7

Post by Raheem » 3 years ago

Post the code, but maybe new topic better so we don't mix things in this topic.
He who fails to plan is planning to fail

karan
Mod Tester
Mod Tester
India
Posts: 122
Joined: 6 years ago
Location: India
Contact:

#8

Post by karan » 3 years ago

Raheem wrote: 3 years ago Post the code, but maybe new topic better so we don't mix things in this topic.
by this method @raheem viewtopic.php?f=11&t=3408&p=8134#p8134
Image

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

#9

Post by Raheem » 3 years ago

karan wrote: 3 years ago
Raheem wrote: 3 years ago Post the code, but maybe new topic better so we don't mix things in this topic.
by this method @raheem viewtopic.php?f=11&t=3408&p=8134#p8134
  1. #include <zombie_escape>
  2. #include <engine>
  3. #include <cstrike>
  4. #include <fakemeta_util>
  5.  
  6. #define CSW_THIGHPACK   0
  7. #define CSW_SHIELD      2
  8. #define CSW_BACKPACK    32
  9.  
  10. // Offsets
  11. const OFFSET_USE_STOPPED            = 0;
  12. const OFFSET_PDATA                  = 2;
  13. const OFFSET_LINUX_WEAPONS          = 4;
  14. const OFFSET_LINUX                  = 5;
  15. const OFFSET_WEAPON_OWNER           = 41;
  16. const OFFSET_ID                     = 43;
  17. const OFFSET_NEXT_PRIMARY_ATTACK    = 46;
  18. const OFFSET_NEXT_SECONDARY_ATTACK  = 47;
  19. const OFFSET_TIME_WEAPON_IDLE       = 48;
  20. const OFFSET_IN_RELOAD              = 54;
  21. const OFFSET_IN_SPECIAL_RELOAD      = 55;
  22. const OFFSET_NEXT_ATTACK            = 83;
  23. const OFFSET_FOV                    = 363;
  24. const OFFSET_ACTIVE_ITEM            = 373;
  25.  
  26. new const g_customization_file_cfg[] = "weapon_modifier.cfg"
  27. new const g_customization_file_ini[] = "weapon_modifier.ini"
  28.  
  29. new const g_weapon_ent_names[][] = {"", "weapon_p228", "", "weapon_scout", "", "weapon_xm1014", "", "weapon_mac10",
  30. "weapon_aug", "", "weapon_elite", "weapon_fiveseven", "weapon_ump45", "weapon_sg550", "weapon_galil", "weapon_famas", "weapon_usp", "weapon_glock18",
  31. "weapon_awp", "weapon_mp5navy", "weapon_m249", "weapon_m3", "weapon_m4a1", "weapon_tmp", "weapon_g3sg1", "", "weapon_deagle", "weapon_sg552",
  32. "weapon_ak47", "weapon_knife", "weapon_p90", "all"};
  33.  
  34. new const g_weapon_ent_names_all[][] = {"weapon_thighpack", "weapon_p228", "weapon_shield", "weapon_scout", "weapon_hegrenade", "weapon_xm1014", "weapon_c4",
  35. "weapon_mac10", "weapon_aug", "weapon_smokegrenade", "weapon_elite", "weapon_fiveseven", "weapon_ump45", "weapon_sg550", "weapon_galil", "weapon_famas", "weapon_usp",
  36. "weapon_glock18", "weapon_awp", "weapon_mp5navy", "weapon_m249", "weapon_m3", "weapon_m4a1", "weapon_tmp", "weapon_g3sg1", "weapon_flashbang", "weapon_deagle",
  37. "weapon_sg552", "weapon_ak47", "weapon_knife", "weapon_p90", "w_backpack"};
  38.  
  39. new const g_model_default[][] = {"models/w_thighpack.mdl", "models/w_p228.mdl", "models/w_shield.mdl", "models/w_scout.mdl", "models/w_hegrenade.mdl",
  40. "models/w_xm1014.mdl", "models/w_c4.mdl", "models/w_mac10.mdl", "models/w_aug.mdl", "models/w_smokegrenade.mdl", "models/w_elite.mdl", "models/w_fiveseven.mdl",
  41. "models/w_ump45.mdl", "models/w_sg550.mdl", "models/w_galil.mdl", "models/w_famas.mdl", "models/w_usp.mdl", "models/w_glock18.mdl", "models/w_awp.mdl",
  42. "models/w_mp5.mdl", "models/w_m249.mdl", "models/w_m3.mdl", "models/w_m4a1.mdl", "models/w_tmp.mdl", "models/w_g3sg1.mdl", "models/w_flashbang.mdl",
  43. "models/w_deagle.mdl", "models/w_sg552.mdl", "models/w_ak47.mdl", "models/w_knife.mdl", "models/w_p90.mdl", "models/w_backpack.mdl"};
  44.  
  45. new const g_max_bpammo[] = {-1, 52, -1, 90, 1, 32, 1, 100, 90, 1, 120, 100, 100, 90, 90, 90, 100, 120, 30, 120, 200, 32, 90, 120, 90, 2, 35, 90, 90, -1, 100};
  46. new const g_max_clip[] = {-1, 13, -1, 10, -1, 7, -1, 30, 30, -1, 30, 20, 25, 30, 35, 25, 12, 20, 10, 30, 100, 8, 30, 30, 20, -1, 7, 30, 30, -1, 50};
  47. new const g_ammo_type[][] = {"", "357sig", "", "762nato", "", "buckshot", "", "45acp", "556nato", "", "9mm", "57mm", "45acp", "556nato", "556nato", "556nato", "45acp",
  48. "9mm", "338magnum", "9mm", "556natobox", "buckshot", "556nato", "9mm", "762nato", "", "50ae", "556nato", "762nato", "", "57mm"};
  49. new const g_ammo_weapon[] = {0, CSW_AWP, CSW_SCOUT, CSW_M249, CSW_AUG, CSW_XM1014, CSW_MAC10, CSW_FIVESEVEN, CSW_DEAGLE, CSW_P228, CSW_ELITE, CSW_FLASHBANG,
  50. CSW_HEGRENADE, CSW_SMOKEGRENADE, CSW_C4};
  51. new const SECONDARY_WEAPONS_BIT_SUM = (1 << CSW_P228)|(1 << CSW_ELITE)|(1 << CSW_FIVESEVEN)|(1 << CSW_USP)|(1 << CSW_GLOCK18)|(1 << CSW_DEAGLE)
  52. new const SHOTGUN_WEAPONS_BIT_SUM = (1 << CSW_M3)|(1 << CSW_XM1014)
  53. new const ALREADY_SECONDARY_ATTACK = (1 << CSW_KNIFE)|(1 << CSW_USP)|(1 << CSW_GLOCK18)|(1 << CSW_FAMAS)|(1 << CSW_M4A1)
  54.  
  55. new const g_sound_knife_default[][] = {
  56.     "weapons/knife_deploy1.wav",
  57.     "weapons/knife_hit1.wav",
  58.     "weapons/knife_hit2.wav",
  59.     "weapons/knife_hit3.wav",
  60.     "weapons/knife_hit4.wav",
  61.     "weapons/knife_hitwall1.wav",
  62.     "weapons/knife_slash1.wav",
  63.     "weapons/knife_slash2.wav",
  64.     "weapons/knife_stab.wav"
  65. };
  66.  
  67. enum()
  68. {
  69.     WEAPON_DAMAGE = 0,
  70.     WEAPON_RECOIL,
  71.     WEAPON_SPEED,
  72.     WEAPON_W_GLOW,
  73.     WEAPON_P_GLOW,
  74.     WEAPON_UNLIMITED_CLIP,
  75.     WEAPON_UNLIMITED_BPAMMO,
  76.     WEAPON_KNOCKBACK,
  77.     WEAPON_AUTO_FIRE,
  78.     WEAPON_ZOOM,
  79.  
  80.     MAX_WM
  81. };
  82. new g_cvar_weapon[CSW_P90+3][MAX_WM];
  83. new g_cvar_knockback;
  84. new g_cvar_knockback_zvel;
  85. new g_cvar_knockback_dist;
  86. new g_pcvar_ff;
  87.  
  88. enum()
  89. {
  90.     V_ = 0,
  91.     P_,
  92.     W_,
  93.    
  94.     ALL_MODELS
  95. };
  96. new g_model_weapon[ALL_MODELS][CSW_P90+2][128];
  97. new g_sound_weapon[sizeof(g_sound_knife_default)][128];
  98.  
  99. new g_ent_weaponmodel[33];
  100. new g_has_ammo[33];
  101. new g_weapon[33];
  102.  
  103. new Trie:g_trie_wmodel;
  104.  
  105. new g_msg_curweapon;
  106. new g_msg_ammopickup;
  107.  
  108. new g_maxplayers;
  109.  
  110. new bool:g_bBlock
  111.  
  112. #define is_user_valid_connected(%1) (1 <= %1 <= g_maxplayers && is_user_connected(%1))
  113. public plugin_precache()
  114. {
  115.     fn_load_customization();
  116. }
  117. public plugin_init()
  118. {
  119.     new plugin_name[] = "Weapon Modifier";
  120.     new plugin_version[] = "v1.56";
  121.     new plugin_author[] = "Kiske";
  122.    
  123.     new i;
  124.     new j;
  125.     new buffer[64];
  126.    
  127.     new wm_cvars[][] = {"damage", "recoil", "speed", "wglow", "pglow", "unclip", "unbpammo", "kb", "autofire", "zoom"};
  128.    
  129.     register_plugin(plugin_name, plugin_version, plugin_author);
  130.    
  131.     register_event("AmmoX", "event_AmmoX", "be");
  132.    
  133.     RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage");
  134.     RegisterHam(Ham_Killed, "player", "fw_PlayerKilled");
  135.     RegisterHam(Ham_TraceAttack, "player", "fw_TraceAttack");
  136.     RegisterHam(Ham_AddPlayerItem, "player", "fw_AddPlayerItem");
  137.     RegisterHam(Ham_Use, "func_tank", "fw_UseStationary_Post", 1);
  138.     RegisterHam(Ham_Use, "func_tankmortar", "fw_UseStationary_Post", 1);
  139.     RegisterHam(Ham_Use, "func_tankrocket", "fw_UseStationary_Post", 1);
  140.     RegisterHam(Ham_Use, "func_tanklaser", "fw_UseStationary_Post", 1);
  141.    
  142.     // Register CVARS
  143.     for(i = 0; i < CSW_P90+2; i++)
  144.     {
  145.         // Get Weapon and Change Models
  146.         if(i != 0 && i != 2 && i != 31) // weapon_thighpack(0) , weapon_shield (2) and w_backpack(31)
  147.             RegisterHam(Ham_Item_Deploy, g_weapon_ent_names_all[i], "fw_Item_Deploy_Post", 1);
  148.        
  149.         if(g_weapon_ent_names[i][0])
  150.         {
  151.             // Recoil , Speed , Auto Fire Pistol and Zoom
  152.             if(i != 31) // all is 31
  153.             {
  154.                 RegisterHam(Ham_Weapon_PrimaryAttack, g_weapon_ent_names[i], "fw_Weapon_PrimaryAttack_Post", 1); // Recoil , Speed and Auto Fire Pistol
  155.                
  156.                 // Zoom
  157.                 if(!((1 << i) & ALREADY_SECONDARY_ATTACK))
  158.                 {
  159.                     RegisterHam(Ham_Item_PostFrame, g_weapon_ent_names[i], "fw_Item_PostFrame");
  160.                     RegisterHam(Ham_Item_Holster, g_weapon_ent_names[i], "fw_Item_Holster");
  161.                     RegisterHam(Ham_CS_Item_GetMaxSpeed, g_weapon_ent_names[i], "fw_CS_Item_GetMaxSpeed");
  162.                     RegisterHam(Ham_Weapon_Reload, g_weapon_ent_names[i], ((1 << i) & SHOTGUN_WEAPONS_BIT_SUM) ? "fw_Weapon_Shotgun_Reload_Post" : "fw_Weapon_Reload_Post", 1);
  163.                 }
  164.             }
  165.            
  166.             // Remove weapon_ from the names
  167.             replace(g_weapon_ent_names[i], 17, "weapon_", "");
  168.            
  169.             for(j = 0; j < MAX_WM; j++)
  170.             {
  171.                 formatex(buffer, charsmax(buffer), "wm_%s_%s", wm_cvars[j], g_weapon_ent_names[i]);
  172.                
  173.                 switch(j)
  174.                 {
  175.                     case WEAPON_KNOCKBACK: g_cvar_weapon[i][j] = register_cvar(buffer, "0.00");
  176.                     case WEAPON_AUTO_FIRE:
  177.                     {
  178.                         if(i == 31) // all is 31
  179.                         {
  180.                             g_cvar_weapon[i][j] = register_cvar(buffer, "0");
  181.                             continue;
  182.                         }
  183.                        
  184.                         if((1 << i) & SECONDARY_WEAPONS_BIT_SUM)
  185.                             g_cvar_weapon[i][j] = register_cvar(buffer, "0");
  186.                     }
  187.                     case WEAPON_ZOOM:
  188.                     {
  189.                         if(!((1 << i) & ALREADY_SECONDARY_ATTACK))
  190.                             g_cvar_weapon[i][j] = register_cvar(buffer, "off");
  191.                     }
  192.                     default: g_cvar_weapon[i][j] = register_cvar(buffer, "off");
  193.                 }
  194.             }
  195.         }
  196.     }
  197.    
  198.     // Extra Cvars for W_ models glow :)
  199.     g_cvar_weapon[CSW_THIGHPACK][WEAPON_W_GLOW] = register_cvar("wm_wglow_thighpack", "off");
  200.     g_cvar_weapon[CSW_SHIELD][WEAPON_W_GLOW] = register_cvar("wm_wglow_shield", "off");
  201.     g_cvar_weapon[CSW_HEGRENADE][WEAPON_W_GLOW] = register_cvar("wm_wglow_hegrenade", "off");
  202.     g_cvar_weapon[CSW_C4][WEAPON_W_GLOW] = register_cvar("wm_wglow_c4", "off");
  203.     g_cvar_weapon[CSW_SMOKEGRENADE][WEAPON_W_GLOW] = register_cvar("wm_wglow_smokegrenade", "off");
  204.     g_cvar_weapon[CSW_FLASHBANG][WEAPON_W_GLOW] = register_cvar("wm_wglow_flashbang", "off");
  205.     g_cvar_weapon[CSW_BACKPACK][WEAPON_W_GLOW] = register_cvar("wm_wglow_backpack", "off");
  206.    
  207.     // Extra Cvars for P_ models glow :)
  208.     g_cvar_weapon[CSW_HEGRENADE][WEAPON_P_GLOW] = register_cvar("wm_pglow_hegrenade", "off");
  209.     g_cvar_weapon[CSW_C4][WEAPON_P_GLOW] = register_cvar("wm_pglow_c4", "off");
  210.     g_cvar_weapon[CSW_SMOKEGRENADE][WEAPON_P_GLOW] = register_cvar("wm_pglow_smokegrenade", "off");
  211.     g_cvar_weapon[CSW_FLASHBANG][WEAPON_P_GLOW] = register_cvar("wm_pglow_flashbang", "off");
  212.    
  213.     // Cvars for knockback
  214.     g_cvar_knockback = register_cvar("wm_knockback", "0");
  215.     g_cvar_knockback_zvel = register_cvar("wm_kb_zvel", "1");
  216.     g_cvar_knockback_dist = register_cvar("wm_kb_dist", "500");
  217.     g_pcvar_ff = get_cvar_pointer("mp_friendlyfire");
  218.    
  219.     new wmodels[][] = {"models/w_shield.mdl", "models/w_thighpack.mdl", "models/w_c4.mdl", "models/w_backpack.mdl"};
  220.    
  221.     g_trie_wmodel = TrieCreate();
  222.    
  223.     for(i = 0; i < sizeof(wmodels); i++)
  224.         TrieSetCell(g_trie_wmodel, wmodels[i], 1);
  225.    
  226.     register_forward(FM_SetModel, "fw_SetModel");
  227.     register_forward(FM_EmitSound, "fw_EmitSound");
  228.     register_forward(FM_CmdStart, "fw_CmdStart");
  229.    
  230.     g_msg_curweapon = get_user_msgid("CurWeapon");
  231.     g_msg_ammopickup = get_user_msgid("AmmoPickup");
  232.    
  233.     register_message(g_msg_curweapon, "message_CurWeapon");
  234.    
  235.     g_maxplayers = get_maxplayers();
  236. }
  237.  
  238. public ze_zombie_appear()
  239. {
  240.     g_bBlock = true
  241. }
  242.  
  243. public ze_zombie_release()
  244. {
  245.     g_bBlock = false
  246. }
  247.  
  248. public plugin_cfg()
  249. {
  250.     new cfgdir[32];
  251.     get_configsdir(cfgdir, charsmax(cfgdir));
  252.    
  253.     server_cmd("exec %s/%s", cfgdir, g_customization_file_cfg);
  254. }
  255.  
  256. public plugin_end()
  257. {
  258.     TrieDestroy(g_trie_wmodel);
  259. }
  260.  
  261. public client_disconnect(id)
  262. {
  263.     g_has_ammo[id] = 0;
  264.    
  265.     fm_remove_model_ents(id);
  266. }
  267.  
  268. public event_AmmoX(id)
  269. {
  270.     static bpammo_cvar[10];
  271.     static bpammo_cvar_temp[10];
  272.     static bpammo_cvar_int;
  273.     static mode;
  274.     mode = 0;
  275.    
  276.     get_pcvar_string(g_cvar_weapon[g_weapon[id]][WEAPON_UNLIMITED_BPAMMO], bpammo_cvar, charsmax(bpammo_cvar));
  277.     get_pcvar_string(g_cvar_weapon[31][WEAPON_UNLIMITED_BPAMMO], bpammo_cvar_temp, charsmax(bpammo_cvar_temp));
  278.    
  279.     bpammo_cvar_int = str_to_num(bpammo_cvar);
  280.    
  281.     if(!equali(bpammo_cvar_temp, "off") || bpammo_cvar_int)
  282.         mode = 1;
  283.    
  284.     if(!mode)
  285.         return;
  286.    
  287.     static type;
  288.     type = read_data(1);
  289.    
  290.     if(type >= sizeof(g_ammo_weapon))
  291.         return;
  292.    
  293.     static weapon;
  294.     weapon = g_ammo_weapon[type];
  295.    
  296.     if(g_max_bpammo[weapon] <= 2)
  297.         return;
  298.    
  299.     static amount;
  300.     amount = read_data(2);
  301.    
  302.     if(amount < g_max_bpammo[weapon])
  303.     {
  304.         // The BP Ammo refill code causes the engine to send a message, but we
  305.         // can't have that in this forward or we risk getting some recursion bugs.
  306.         // For more info see: https://bugs.alliedmods.net/show_bug.cgi?id=3664
  307.        
  308.         static args[1];
  309.         args[0] = weapon;
  310.        
  311.         set_task(0.1, "fn_refill_bpammo", id, args, sizeof(args));
  312.     }
  313. }
  314.  
  315. public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
  316. {
  317.     if(victim == attacker || !is_user_valid_connected(attacker) || g_bBlock)
  318.         return HAM_IGNORED;
  319.    
  320.     static dmg_cvar[10];
  321.     static dmg_cvar_k[10];
  322.     static dmg_cvar_temp[10];
  323.     static dmg_cvar_temp_k[10];
  324.    
  325.     get_pcvar_string(g_cvar_weapon[g_weapon[attacker]][WEAPON_DAMAGE], dmg_cvar, charsmax(dmg_cvar));
  326.     get_pcvar_string(g_cvar_weapon[31][WEAPON_DAMAGE], dmg_cvar_temp, charsmax(dmg_cvar_temp));
  327.    
  328.     copy(dmg_cvar_k, charsmax(dmg_cvar_k), dmg_cvar);
  329.     copy(dmg_cvar_temp_k, charsmax(dmg_cvar_temp_k), dmg_cvar_temp);
  330.    
  331.     if(fn_contain_words(dmg_cvar_k) || fn_contain_words(dmg_cvar_temp_k))
  332.     {
  333.         fn_replace_words(dmg_cvar_k, charsmax(dmg_cvar_k));
  334.         fn_replace_words(dmg_cvar_temp_k, charsmax(dmg_cvar_temp_k));
  335.        
  336.         static Float:dmg;
  337.        
  338.         if(equali(dmg_cvar_temp, "off")) dmg = str_to_float(dmg_cvar_k);
  339.         else dmg = str_to_float(dmg_cvar_temp_k);
  340.        
  341.         switch((equali(dmg_cvar_temp, "off")) ? dmg_cvar[0] : dmg_cvar_temp[0])
  342.         {
  343.             case '+':
  344.             {
  345.                 if(dmg < 1.00) return HAM_IGNORED;
  346.                 damage += dmg;
  347.             }
  348.             case '-':
  349.             {
  350.                 if(dmg < 1.00) return HAM_IGNORED;
  351.                 damage -= dmg;
  352.             }
  353.             case '*':
  354.             {
  355.                 if(dmg == 1.00) return HAM_IGNORED;
  356.                 damage *= dmg;
  357.             }
  358.             case '/':
  359.             {
  360.                 if(dmg == 0.00) return HAM_IGNORED; // Can't divide by 0
  361.                 damage /= dmg;
  362.             }
  363.             case '=':
  364.             {
  365.                 if(dmg < 1.00) return HAM_IGNORED;
  366.                 damage = dmg;
  367.             }
  368.         }
  369.        
  370.         SetHamParamFloat(4, damage);
  371.     }
  372.    
  373.     return HAM_IGNORED;
  374. }
  375.  
  376. public fw_PlayerKilled(victim, attacker, shouldgib)
  377. {
  378.     fm_remove_model_ents(victim);
  379. }
  380.  
  381. public fw_TraceAttack(victim, attacker, Float:damage, Float:direction[3], trace_handle, damage_type)
  382. {
  383.     if(victim == attacker || !is_user_valid_connected(attacker) || g_bBlock)
  384.         return HAM_IGNORED;
  385.    
  386.     if(!get_pcvar_num(g_cvar_knockback))
  387.         return HAM_IGNORED;
  388.    
  389.     if(!(damage_type & DMG_BULLET))
  390.         return HAM_IGNORED;
  391.    
  392.     if(!get_pcvar_num(g_pcvar_ff) && (cs_get_user_team(attacker) == cs_get_user_team(victim)))
  393.         return HAM_IGNORED;
  394.    
  395.     static kb_duck;
  396.     static origin1[3];
  397.     static origin2[3];
  398.    
  399.     kb_duck = entity_get_int(victim, EV_INT_flags) & (FL_DUCKING | FL_ONGROUND) == (FL_DUCKING | FL_ONGROUND);
  400.    
  401.     get_user_origin(victim, origin1);
  402.     get_user_origin(attacker, origin2);
  403.    
  404.     if(get_distance(origin1, origin2) > get_pcvar_num(g_cvar_knockback_dist))
  405.         return HAM_IGNORED;
  406.    
  407.     static Float:velocity[3];
  408.     entity_get_vector(victim, EV_VEC_velocity, velocity);
  409.    
  410.     xs_vec_mul_scalar(direction, damage, direction);
  411.    
  412.     static Float:kb_cvar;
  413.    
  414.     if(get_pcvar_float(g_cvar_weapon[31][WEAPON_KNOCKBACK]) == 0.00) kb_cvar = get_pcvar_float(g_cvar_weapon[g_weapon[attacker]][WEAPON_KNOCKBACK]);
  415.     else kb_cvar = get_pcvar_float(g_cvar_weapon[31][WEAPON_KNOCKBACK]);
  416.    
  417.     if(kb_cvar > 0.00)
  418.         xs_vec_mul_scalar(direction, kb_cvar, direction);
  419.    
  420.     if(kb_duck)
  421.         xs_vec_mul_scalar(direction, 0.2, direction);
  422.    
  423.     xs_vec_add(velocity, direction, direction);
  424.    
  425.     if(!get_pcvar_num(g_cvar_knockback_zvel))
  426.         direction[2] = velocity[2];
  427.    
  428.     entity_set_vector(victim, EV_VEC_velocity, direction);
  429.    
  430.     return HAM_IGNORED;
  431. }
  432.  
  433. public fw_AddPlayerItem(id, weapon_ent)
  434. {
  435.     static extra_ammo;
  436.     extra_ammo = entity_get_int(weapon_ent, EV_INT_iuser1);
  437.    
  438.     if(extra_ammo)
  439.     {
  440.         static weaponid;
  441.         weaponid = cs_get_weapon_id(weapon_ent);
  442.        
  443.         ExecuteHamB(Ham_GiveAmmo, id, extra_ammo, g_ammo_type[weaponid], g_max_bpammo[weaponid]);
  444.         entity_set_int(weapon_ent, EV_INT_iuser1, 0);
  445.     }
  446. }
  447.  
  448. public fw_UseStationary_Post(entity, caller, activator, use_type)
  449. {
  450.     if(use_type == OFFSET_USE_STOPPED && is_user_valid_connected(caller))
  451.     {
  452.         fm_remove_model_ents(caller);
  453.         fn_replace_weapon_models(caller, g_weapon[caller]);
  454.     }
  455. }
  456.  
  457. public fw_Item_Deploy_Post(weapon_ent)
  458. {
  459.     if(!pev_valid(weapon_ent))
  460.         return;
  461.    
  462.     static id;
  463.     id = fm_get_weapon_ent_owner(weapon_ent);
  464.    
  465.     if(!pev_valid(id))
  466.         return;
  467.    
  468.     fm_remove_model_ents(id);
  469.    
  470.     static weaponid;
  471.     weaponid = cs_get_weapon_id(weapon_ent);
  472.    
  473.     if(weaponid != CSW_C4 &&
  474.     weaponid != CSW_SHIELD &&
  475.     weaponid != CSW_HEGRENADE &&
  476.     weaponid != CSW_FLASHBANG &&
  477.     weaponid != CSW_SMOKEGRENADE)
  478.         g_weapon[id] = weaponid;
  479.    
  480.     // Replace Weapon Models
  481.     fn_replace_weapon_models(id, weaponid);
  482. }
  483.  
  484. public fw_Weapon_PrimaryAttack_Post(weapon_ent) // Recoil , Speed and Auto Fire Pistol
  485. {
  486.     if(!pev_valid(weapon_ent))
  487.         return HAM_IGNORED;
  488.    
  489.     static id;
  490.     id = fm_get_weapon_ent_owner(weapon_ent);
  491.    
  492.     if(!pev_valid(id) || cs_get_weapon_ammo(weapon_ent) < 1)
  493.         return HAM_IGNORED;
  494.    
  495.     // Recoil
  496.     static Float:def_recoil[3];
  497.     entity_get_vector(id, EV_VEC_punchangle, def_recoil);
  498.    
  499.     static recoil_cvar[10];
  500.     static recoil_cvar_k[10];
  501.     static recoil_cvar_temp[10];
  502.     static recoil_cvar_temp_k[10];
  503.    
  504.     get_pcvar_string(g_cvar_weapon[g_weapon[id]][WEAPON_RECOIL], recoil_cvar, charsmax(recoil_cvar));
  505.     get_pcvar_string(g_cvar_weapon[31][WEAPON_RECOIL], recoil_cvar_temp, charsmax(recoil_cvar_temp));
  506.    
  507.     copy(recoil_cvar_k, charsmax(recoil_cvar_k), recoil_cvar);
  508.     copy(recoil_cvar_temp_k, charsmax(recoil_cvar_temp_k), recoil_cvar_temp);
  509.    
  510.     if(fn_contain_words(recoil_cvar_k) || fn_contain_words(recoil_cvar_temp_k))
  511.     {
  512.         fn_replace_words(recoil_cvar_k, charsmax(recoil_cvar_k));
  513.         fn_replace_words(recoil_cvar_temp_k, charsmax(recoil_cvar_temp_k));
  514.        
  515.         static Float:recoil;
  516.        
  517.         if(equali(recoil_cvar_temp, "off")) recoil = str_to_float(recoil_cvar_k);
  518.         else recoil = str_to_float(recoil_cvar_temp_k);
  519.        
  520.         switch((equali(recoil_cvar_temp, "off")) ? recoil_cvar[0] : recoil_cvar_temp[0])
  521.         {
  522.             case '+':
  523.             {
  524.                 if(recoil == 0.00) return HAM_IGNORED;
  525.                 def_recoil[0] += recoil;
  526.             }
  527.             case '-':
  528.             {
  529.                 if(recoil == 0.00) return HAM_IGNORED;
  530.                 def_recoil[0] -= recoil;
  531.             }
  532.             case '*':
  533.             {
  534.                 if(recoil == 1.00) return HAM_IGNORED;
  535.                 def_recoil[0] *= recoil;
  536.             }
  537.             case '/':
  538.             {
  539.                 if(recoil == 0.00) return HAM_IGNORED; // Can't divide by 0
  540.                 def_recoil[0] /= recoil;
  541.             }
  542.             case '=':
  543.             {
  544.                 def_recoil[0] = recoil;
  545.                 if(recoil == 0)
  546.                     def_recoil[1] = def_recoil[2] = recoil;
  547.             }
  548.         }
  549.        
  550.         entity_set_vector(id, EV_VEC_punchangle, def_recoil);
  551.     }
  552.    
  553.     // Speed
  554.     static Float:def_speed[3];
  555.     def_speed[0] = get_pdata_float(weapon_ent, OFFSET_NEXT_PRIMARY_ATTACK, OFFSET_LINUX_WEAPONS);
  556.     def_speed[1] = get_pdata_float(weapon_ent, OFFSET_NEXT_SECONDARY_ATTACK, OFFSET_LINUX_WEAPONS);
  557.     def_speed[2] = get_pdata_float(weapon_ent, OFFSET_TIME_WEAPON_IDLE, OFFSET_LINUX_WEAPONS);
  558.    
  559.     static speed_cvar[10];
  560.     static speed_cvar_k[10];
  561.     static speed_cvar_temp[10];
  562.     static speed_cvar_temp_k[10];
  563.    
  564.     get_pcvar_string(g_cvar_weapon[g_weapon[id]][WEAPON_SPEED], speed_cvar, charsmax(speed_cvar));
  565.     get_pcvar_string(g_cvar_weapon[31][WEAPON_SPEED], speed_cvar_temp, charsmax(speed_cvar_temp));
  566.    
  567.     copy(speed_cvar_k, charsmax(speed_cvar_k), speed_cvar);
  568.     copy(speed_cvar_temp_k, charsmax(speed_cvar_temp_k), speed_cvar_temp);
  569.    
  570.     if(fn_contain_words(speed_cvar_k) || fn_contain_words(speed_cvar_temp_k))
  571.     {
  572.         fn_replace_words(speed_cvar_k, charsmax(speed_cvar_k));
  573.         fn_replace_words(speed_cvar_temp_k, charsmax(speed_cvar_temp_k));
  574.        
  575.         static Float:speed;
  576.        
  577.         if(equali(speed_cvar_temp, "off")) speed = str_to_float(speed_cvar_k);
  578.         else speed = str_to_float(speed_cvar_temp_k);
  579.        
  580.         switch((equali(speed_cvar_temp, "off")) ? speed_cvar[0] : speed_cvar_temp[0])
  581.         {
  582.             case '+':
  583.             {
  584.                 if(speed == 0.00) return HAM_IGNORED;
  585.                 def_speed[0] += speed;
  586.                 def_speed[1] += speed;
  587.                 def_speed[2] += speed;
  588.             }
  589.             case '-':
  590.             {
  591.                 if(speed == 0.00) return HAM_IGNORED;
  592.                 def_speed[0] -= speed;
  593.                 def_speed[1] -= speed;
  594.                 def_speed[2] -= speed;
  595.             }
  596.             case '*':
  597.             {
  598.                 if(speed == 1.00) return HAM_IGNORED;
  599.                 def_speed[0] *= speed;
  600.                 def_speed[1] *= speed;
  601.                 def_speed[2] *= speed;
  602.             }
  603.             case '/':
  604.             {
  605.                 if(speed == 0.00) return HAM_IGNORED; // Can't divide by 0
  606.                 def_speed[0] /= speed;
  607.                 def_speed[1] /= speed;
  608.                 def_speed[2] /= speed;
  609.             }
  610.             case '=': def_speed[0] = def_speed[1] = def_speed[2] = speed;
  611.         }
  612.        
  613.         set_pdata_float(weapon_ent, OFFSET_NEXT_PRIMARY_ATTACK, def_speed[0], OFFSET_LINUX_WEAPONS)
  614.         set_pdata_float(weapon_ent, OFFSET_NEXT_SECONDARY_ATTACK, def_speed[1], OFFSET_LINUX_WEAPONS)
  615.         set_pdata_float(weapon_ent, OFFSET_TIME_WEAPON_IDLE, def_speed[2], OFFSET_LINUX_WEAPONS)
  616.     }
  617.    
  618.     // Auto Fire Pistol
  619.     if((1 << g_weapon[id]) & SECONDARY_WEAPONS_BIT_SUM)
  620.     {
  621.         static autofire_cvar;
  622.        
  623.         if(!get_pcvar_num(g_cvar_weapon[31][WEAPON_AUTO_FIRE])) autofire_cvar = get_pcvar_num(g_cvar_weapon[g_weapon[id]][WEAPON_AUTO_FIRE]);
  624.         else autofire_cvar = 1;
  625.        
  626.         g_has_ammo[id] = autofire_cvar;
  627.     }
  628.    
  629.     return HAM_IGNORED;
  630. }
  631.  
  632. public fw_Item_PostFrame(weapon_ent)
  633. {
  634.     if(!pev_valid(weapon_ent))
  635.         return HAM_IGNORED;
  636.    
  637.     static id;
  638.     id = fm_get_weapon_ent_owner(weapon_ent);
  639.    
  640.     if(!pev_valid(id))
  641.         return HAM_IGNORED;
  642.    
  643.     static button;
  644.     button = entity_get_int(id, EV_INT_button);
  645.    
  646.     if(button & IN_ATTACK2)
  647.     {
  648.         static zoom_cvar[32];
  649.         static zoom_delay[9];
  650.         static zoom_speed[1]; // not interesting here
  651.         static zoom_1[3];
  652.         static zoom_2[3];
  653.         static Float:f_zoom_delay;
  654.         static i_zoom_1;
  655.         static i_zoom_2;
  656.        
  657.         get_pcvar_string(g_cvar_weapon[31][WEAPON_ZOOM], zoom_cvar, charsmax(zoom_cvar));
  658.        
  659.         if(equali(zoom_cvar, "off"))
  660.         {
  661.             get_pcvar_string(g_cvar_weapon[g_weapon[id]][WEAPON_ZOOM], zoom_cvar, charsmax(zoom_cvar));
  662.        
  663.             if(equali(zoom_cvar, "off"))
  664.                 return HAM_IGNORED;
  665.         }
  666.        
  667.         parse(zoom_cvar, zoom_delay, charsmax(zoom_delay), zoom_speed, charsmax(zoom_speed), zoom_1, charsmax(zoom_1), zoom_2, charsmax(zoom_2));
  668.        
  669.         f_zoom_delay = str_to_float(zoom_delay);
  670.         i_zoom_1 = clamp(str_to_num(zoom_1), 0, 255);
  671.         i_zoom_2 = clamp(str_to_num(zoom_2), 0, 255);
  672.        
  673.         static fov;
  674.         fov = get_pdata_int(id, OFFSET_FOV, OFFSET_LINUX);
  675.        
  676.         if(fov == 90) fn_SetFov(id, i_zoom_1);
  677.         else if(fov == i_zoom_1) fn_SetFov(id, i_zoom_2);
  678.         else fn_SetFov(id, 90);
  679.        
  680.         ExecuteHamB(Ham_Item_PreFrame, id);
  681.        
  682.         emit_sound(id, CHAN_ITEM, "weapons/zoom.wav", 0.20, 2.40, 0, 100);
  683.         set_pdata_float(id, OFFSET_NEXT_ATTACK, f_zoom_delay, OFFSET_LINUX);
  684.        
  685.         return HAM_SUPERCEDE;
  686.     }
  687.    
  688.     return HAM_IGNORED;
  689. }
  690.  
  691. public fw_Item_Holster(weapon_ent)
  692. {
  693.     if(pev_valid(weapon_ent))
  694.     {
  695.         if(ExecuteHamB(Ham_Item_CanHolster, weapon_ent))
  696.             fn_ResetFov(fm_get_weapon_ent_owner(weapon_ent));
  697.     }
  698. }
  699.  
  700. public fw_CS_Item_GetMaxSpeed(weapon_ent)
  701. {
  702.     if(!pev_valid(weapon_ent))
  703.         return HAM_IGNORED;
  704.    
  705.     static id;
  706.     id = fm_get_weapon_ent_owner(weapon_ent);
  707.    
  708.     if(!pev_valid(id))
  709.         return HAM_IGNORED;
  710.    
  711.     if(get_pdata_int(id, OFFSET_FOV, OFFSET_LINUX) == 90)
  712.         return HAM_IGNORED;
  713.    
  714.     static zoom_cvar[32];
  715.     static zoom_delay[1]; // not interesting here
  716.     static zoom_speed[9];
  717.     static zoom_1[1]; // not interesting here
  718.     static zoom_2[1]; // not interesting here
  719.     static Float:f_zoom_speed;
  720.    
  721.     get_pcvar_string(g_cvar_weapon[31][WEAPON_ZOOM], zoom_cvar, charsmax(zoom_cvar));
  722.    
  723.     if(equali(zoom_cvar, "off"))
  724.     {
  725.         get_pcvar_string(g_cvar_weapon[g_weapon[id]][WEAPON_ZOOM], zoom_cvar, charsmax(zoom_cvar));
  726.    
  727.         if(equali(zoom_cvar, "off"))
  728.             return HAM_IGNORED;
  729.     }
  730.    
  731.     parse(zoom_cvar, zoom_delay, charsmax(zoom_delay), zoom_speed, charsmax(zoom_speed), zoom_1, charsmax(zoom_1), zoom_2, charsmax(zoom_2));
  732.     f_zoom_speed = str_to_float(zoom_speed);
  733.  
  734.     static Float:f_MaxSpeed;
  735.     f_MaxSpeed = f_zoom_speed;
  736.    
  737.     if(f_MaxSpeed > 0.00)
  738.     {
  739.         SetHamReturnFloat(f_MaxSpeed);
  740.         return HAM_SUPERCEDE;
  741.     }
  742.  
  743.     return HAM_IGNORED;
  744. }
  745.  
  746. public fw_Weapon_Reload_Post(weapon_ent)
  747. {
  748.     if(pev_valid(weapon_ent))
  749.     {
  750.         if(get_pdata_int(weapon_ent, OFFSET_IN_RELOAD, OFFSET_LINUX_WEAPONS))
  751.             fn_ResetFov(fm_get_weapon_ent_owner(weapon_ent))
  752.     }
  753. }
  754.  
  755. public fw_Weapon_Shotgun_Reload_Post(weapon_ent)
  756. {
  757.     if(pev_valid(weapon_ent))
  758.     {
  759.         if(get_pdata_int(weapon_ent, OFFSET_IN_SPECIAL_RELOAD, OFFSET_LINUX_WEAPONS) == 1)
  760.             fn_ResetFov(fm_get_weapon_ent_owner(weapon_ent))
  761.     }
  762. }
  763.  
  764. fn_SetFov(id, fov)
  765. {
  766.     entity_set_float(id, EV_FL_fov, float(fov));
  767.     set_pdata_int(id, OFFSET_FOV, fov, OFFSET_LINUX);
  768. }
  769.  
  770. fn_ResetFov(id)
  771. {
  772.     if(0 <= get_pdata_int(id, OFFSET_FOV, OFFSET_LINUX) <= 90)
  773.     {
  774.         entity_set_float(id, EV_FL_fov, 90.0);
  775.         set_pdata_int(id, OFFSET_FOV, 90, OFFSET_LINUX);
  776.     }
  777. }
  778.  
  779. public fw_SetModel(entity, const model[])
  780. {
  781.     if(strlen(model) < 8 || model[7] != 'w' || model[8] != '_')
  782.         return FMRES_IGNORED;
  783.    
  784.     static classname[10];
  785.     static color_all[21];
  786.    
  787.     entity_get_string(entity, EV_SZ_classname, classname, charsmax(classname));
  788.     get_pcvar_string(g_cvar_weapon[31][WEAPON_W_GLOW], color_all, charsmax(color_all));
  789.    
  790.     if(equal(classname, "weaponbox") ||
  791.     TrieKeyExists(g_trie_wmodel, model))
  792.     {
  793.         static i;
  794.         static color[21];
  795.         static p_rgb[3][4];
  796.         static i_rgb[3];
  797.        
  798.         for(i = 0; i < CSW_P90+2; i++)
  799.         {
  800.             if(equali(model, g_model_default[i]))
  801.             {
  802.                 get_pcvar_string(g_cvar_weapon[i][WEAPON_W_GLOW], color, charsmax(color));
  803.                 if(!equali(color, "off") || !equali(color_all, "off"))
  804.                 {
  805.                     if(equali(color_all, "off")) parse(color, p_rgb[0], charsmax(p_rgb[]), p_rgb[1], charsmax(p_rgb[]), p_rgb[2], charsmax(p_rgb[]));
  806.                     else parse(color_all, p_rgb[0], charsmax(p_rgb[]), p_rgb[1], charsmax(p_rgb[]), p_rgb[2], charsmax(p_rgb[]));
  807.                    
  808.                     i_rgb[0] = clamp(str_to_num(p_rgb[0]), 0, 255);
  809.                     i_rgb[1] = clamp(str_to_num(p_rgb[1]), 0, 255);
  810.                     i_rgb[2] = clamp(str_to_num(p_rgb[2]), 0, 255);
  811.                    
  812.                     fm_set_rendering(entity, kRenderFxGlowShell, i_rgb[0], i_rgb[1], i_rgb[2], kRenderNormal, 16);
  813.                 }
  814.                
  815.                 if(g_model_weapon[W_][i][0])
  816.                 {
  817.                     entity_set_model(entity, g_model_weapon[W_][i]);
  818.                     return FMRES_SUPERCEDE;
  819.                 }
  820.             }
  821.         }
  822.        
  823.         return FMRES_IGNORED;
  824.     }
  825.    
  826.     static Float:dmg_time;
  827.     dmg_time = entity_get_float(entity, EV_FL_dmgtime);
  828.    
  829.     if(dmg_time == 0.0)
  830.         return FMRES_IGNORED;
  831.    
  832.     static pg_rgb[3][3][4];
  833.     static ig_rgb[3][3];
  834.     if(equali(color_all, "off"))
  835.     {
  836.         static color_grenades[3][21];
  837.        
  838.         get_pcvar_string(g_cvar_weapon[CSW_HEGRENADE][WEAPON_W_GLOW], color_grenades[0], charsmax(color_grenades[]));
  839.         get_pcvar_string(g_cvar_weapon[CSW_FLASHBANG][WEAPON_W_GLOW], color_grenades[1], charsmax(color_grenades[]));
  840.         get_pcvar_string(g_cvar_weapon[CSW_SMOKEGRENADE][WEAPON_W_GLOW], color_grenades[2], charsmax(color_grenades[]));
  841.        
  842.         if(!equali(color_grenades[0], "off"))
  843.         {
  844.             parse(color_grenades[0], pg_rgb[0][0], charsmax(pg_rgb[][]), pg_rgb[1][0], charsmax(pg_rgb[][]), pg_rgb[2][0], charsmax(pg_rgb[][]));
  845.            
  846.             ig_rgb[0][0] = clamp(str_to_num(pg_rgb[0][0]), 0, 255);
  847.             ig_rgb[1][0] = clamp(str_to_num(pg_rgb[1][0]), 0, 255);
  848.             ig_rgb[2][0] = clamp(str_to_num(pg_rgb[2][0]), 0, 255);
  849.         }
  850.         if(!equali(color_grenades[1], "off"))
  851.         {
  852.             parse(color_grenades[1], pg_rgb[0][1], charsmax(pg_rgb[][]), pg_rgb[1][1], charsmax(pg_rgb[][]), pg_rgb[2][1], charsmax(pg_rgb[][]));
  853.            
  854.             ig_rgb[0][1] = clamp(str_to_num(pg_rgb[0][1]), 0, 255);
  855.             ig_rgb[1][1] = clamp(str_to_num(pg_rgb[1][1]), 0, 255);
  856.             ig_rgb[2][1] = clamp(str_to_num(pg_rgb[2][1]), 0, 255);
  857.         }
  858.         if(!equali(color_grenades[2], "off"))
  859.         {
  860.             parse(color_grenades[2], pg_rgb[0][2], charsmax(pg_rgb[][]), pg_rgb[1][2], charsmax(pg_rgb[][]), pg_rgb[2][2], charsmax(pg_rgb[][]));
  861.            
  862.             ig_rgb[0][2] = clamp(str_to_num(pg_rgb[0][2]), 0, 255);
  863.             ig_rgb[1][2] = clamp(str_to_num(pg_rgb[1][2]), 0, 255);
  864.             ig_rgb[2][2] = clamp(str_to_num(pg_rgb[2][2]), 0, 255);
  865.         }
  866.     }
  867.     else
  868.     {
  869.         parse(color_all, pg_rgb[0][0], charsmax(pg_rgb[][]), pg_rgb[1][0], charsmax(pg_rgb[][]), pg_rgb[2][0], charsmax(pg_rgb[][]));
  870.        
  871.         ig_rgb[0][0] = ig_rgb[0][1] = ig_rgb[0][2] = clamp(str_to_num(pg_rgb[0][0]), 0, 255);
  872.         ig_rgb[1][0] = ig_rgb[1][1] = ig_rgb[1][2] = clamp(str_to_num(pg_rgb[1][0]), 0, 255);
  873.         ig_rgb[2][0] = ig_rgb[2][1] = ig_rgb[2][2] = clamp(str_to_num(pg_rgb[2][0]), 0, 255);
  874.     }
  875.    
  876.     if(model[9] == 'h' && model[10] == 'e') // HE Grenade
  877.     {
  878.         // Give it a glow
  879.         fm_set_rendering(entity, kRenderFxGlowShell, ig_rgb[0][0], ig_rgb[1][0], ig_rgb[2][0], kRenderNormal, 16);
  880.        
  881.         // Change Model
  882.         if(g_model_weapon[W_][CSW_HEGRENADE][0])
  883.         {
  884.             entity_set_model(entity, g_model_weapon[W_][CSW_HEGRENADE]);
  885.             return FMRES_SUPERCEDE;
  886.         }
  887.     }
  888.     else if(model[9] == 'f' && model[10] == 'l') // Flash Grenade
  889.     {
  890.         // Give it a glow
  891.         fm_set_rendering(entity, kRenderFxGlowShell, ig_rgb[0][1], ig_rgb[1][1], ig_rgb[2][1], kRenderNormal, 16);
  892.        
  893.         // Change Model
  894.         if(g_model_weapon[W_][CSW_FLASHBANG][0])
  895.         {
  896.             entity_set_model(entity, g_model_weapon[W_][CSW_FLASHBANG]);
  897.             return FMRES_SUPERCEDE;
  898.         }
  899.     }
  900.     else if(model[9] == 's' && model[10] == 'm') // Smoke Grenade
  901.     {
  902.         // Give it a glow
  903.         fm_set_rendering(entity, kRenderFxGlowShell, ig_rgb[0][2], ig_rgb[1][2], ig_rgb[2][2], kRenderNormal, 16);
  904.        
  905.         // Change Model
  906.         if(g_model_weapon[W_][CSW_SMOKEGRENADE][0])
  907.         {
  908.             entity_set_model(entity, g_model_weapon[W_][CSW_SMOKEGRENADE]);
  909.             return FMRES_SUPERCEDE;
  910.         }
  911.     }
  912.    
  913.     return FMRES_IGNORED;
  914. }
  915.  
  916. public fw_EmitSound(id, channel, const sample[], Float:volume, Float:attn, flags, pitch)
  917. {
  918.     if(!is_user_valid_connected(id))
  919.         return FMRES_IGNORED;
  920.    
  921.     new i;
  922.     for(i = 0; i < sizeof(g_sound_knife_default); i++)
  923.     {
  924.         if(equal(sample, g_sound_knife_default[i]) && g_sound_weapon[i][0])
  925.         {
  926.             emit_sound(id, channel, g_sound_weapon[i], volume, attn, flags, pitch);
  927.             return FMRES_SUPERCEDE;
  928.         }
  929.     }
  930.    
  931.     return FMRES_IGNORED;
  932. }
  933.  
  934. public fw_CmdStart(id, handle)
  935. {
  936.     if(!is_user_alive(id))
  937.         return;
  938.    
  939.     if((1 << g_weapon[id]) & SECONDARY_WEAPONS_BIT_SUM)
  940.     {
  941.         static autofire_cvar;
  942.        
  943.         if(!get_pcvar_num(g_cvar_weapon[31][WEAPON_AUTO_FIRE])) autofire_cvar = get_pcvar_num(g_cvar_weapon[g_weapon[id]][WEAPON_AUTO_FIRE]);
  944.         else autofire_cvar = 1;
  945.        
  946.         if(autofire_cvar)
  947.         {
  948.             static button;
  949.             button = get_uc(handle, UC_Buttons);
  950.            
  951.             if((button & IN_ATTACK) && g_has_ammo[id])
  952.             {
  953.                 set_uc(handle, UC_Buttons, button & ~IN_ATTACK);
  954.                 g_has_ammo[id] = 0;
  955.             }
  956.         }
  957.     }
  958. }
  959.  
  960. public message_CurWeapon(msg_id, msg_dest, msg_entity)
  961. {
  962.     if(!is_user_alive(msg_entity) || get_msg_arg_int(1) != 1)
  963.         return;
  964.    
  965.     static clip_cvar[10];
  966.     static clip_cvar_temp[10];
  967.     static clip_cvar_int;
  968.     static mode;
  969.     static weapon;
  970.    
  971.     mode = 0;
  972.     weapon = get_msg_arg_int(2);
  973.    
  974.     get_pcvar_string(g_cvar_weapon[g_weapon[msg_entity]][WEAPON_UNLIMITED_CLIP], clip_cvar, charsmax(clip_cvar));
  975.     get_pcvar_string(g_cvar_weapon[31][WEAPON_UNLIMITED_CLIP], clip_cvar_temp, charsmax(clip_cvar_temp));
  976.    
  977.     clip_cvar_int = str_to_num(clip_cvar);
  978.    
  979.     if(!equali(clip_cvar_temp, "off") || clip_cvar_int)
  980.         mode = 1;
  981.    
  982.     if(!mode)
  983.         return;
  984.    
  985.     if(g_max_bpammo[weapon] > 2)
  986.     {
  987.         static weapon_ent;
  988.         weapon_ent = get_pdata_cbase(msg_entity, OFFSET_ACTIVE_ITEM, OFFSET_LINUX);
  989.        
  990.         if(pev_valid(weapon_ent))
  991.             cs_set_weapon_ammo(weapon_ent, g_max_clip[weapon])
  992.        
  993.         set_msg_arg_int(3, get_msg_argtype(3), g_max_clip[weapon]);
  994.     }
  995. }
  996.  
  997. // Functions
  998. fn_contain_words(const string[])
  999. {
  1000.     if(contain(string, "+") != -1 ||
  1001.     contain(string, "-") != -1 ||
  1002.     contain(string, "*") != -1 ||
  1003.     contain(string, "/") != -1 ||
  1004.     contain(string, "=") != -1)
  1005.         return 1;
  1006.    
  1007.     return 0;
  1008. }
  1009. fn_replace_words(string[], len)
  1010. {
  1011.     replace(string, len, "+", "");
  1012.     replace(string, len, "-", "");
  1013.     replace(string, len, "*", "");
  1014.     replace(string, len, "/", "");
  1015.     replace(string, len, "=", "");
  1016. }
  1017. fn_load_customization()
  1018. {
  1019.     new path[64];
  1020.     get_configsdir(path, charsmax(path));
  1021.    
  1022.     format(path, charsmax(path), "%s/%s", path, g_customization_file_ini);
  1023.    
  1024.     if(!file_exists(path)) return;
  1025.    
  1026.     new linedata[1024];
  1027.     new key[64];
  1028.     new value[960];
  1029.     new weaponname[32];
  1030.     new file = fopen(path, "rt");
  1031.     new i;
  1032.     new const soundname[][] = {
  1033.         "KNIFE_DEPLOY",
  1034.         "KNIFE_HIT_1",
  1035.         "KNIFE_HIT_2",
  1036.         "KNIFE_HIT_3",
  1037.         "KNIFE_HIT_4",
  1038.         "KNIFE_HIT_WALL",
  1039.         "KNIFE_SLASH_1",
  1040.         "KNIFE_SLASH_2",
  1041.         "KNIFE_STAB"
  1042.     }
  1043.    
  1044.     while(file && !feof(file))
  1045.     {
  1046.         fgets(file, linedata, charsmax(linedata));
  1047.         replace(linedata, charsmax(linedata), "^n", "");
  1048.        
  1049.         if(!linedata[0] || linedata[0] == ';') continue;
  1050.        
  1051.         strtok(linedata, key, charsmax(key), value, charsmax(value), '=');
  1052.         trim(key);
  1053.         trim(value);
  1054.        
  1055.         // Models
  1056.         for(i = 0; i < CSW_P90+2; i++)
  1057.         {
  1058.             if(g_weapon_ent_names_all[i][0])
  1059.             {
  1060.                 // Remove weapon_ from the names
  1061.                 copy(weaponname, charsmax(weaponname), g_weapon_ent_names_all[i]);
  1062.                
  1063.                 // Get and precache V_ model
  1064.                 replace(weaponname, charsmax(weaponname), "weapon_", "V_");
  1065.                 if(!equali(g_weapon_ent_names_all[i], "weapon_thighpack"))
  1066.                 {
  1067.                     if(equali(key, weaponname)) copy(g_model_weapon[V_][i], charsmax(g_model_weapon[][]), value);
  1068.                     if(g_model_weapon[V_][i][0]) precache_model(g_model_weapon[V_][i]);
  1069.                 }
  1070.                
  1071.                 // Get and precache P_ model
  1072.                 replace(weaponname, charsmax(weaponname), "V_", "P_");
  1073.                 if(equali(key, weaponname)) copy(g_model_weapon[P_][i], charsmax(g_model_weapon[][]), value);
  1074.                 if(g_model_weapon[P_][i][0]) precache_model(g_model_weapon[P_][i]);
  1075.                
  1076.                 // Get and precache W_ model
  1077.                 replace(weaponname, charsmax(weaponname), "P_", "W_");
  1078.                 if(equali(key, weaponname)) copy(g_model_weapon[W_][i], charsmax(g_model_weapon[][]), value);
  1079.                 if(g_model_weapon[W_][i][0]) precache_model(g_model_weapon[W_][i]);
  1080.             }
  1081.         }
  1082.        
  1083.         // Knife Sounds
  1084.         for(i = 0; i < sizeof(g_sound_knife_default); i++)
  1085.         {
  1086.             if(equali(key, soundname[i])) copy(g_sound_weapon[i], charsmax(g_sound_weapon[]), value);
  1087.             if(g_sound_weapon[i][0]) precache_model(g_sound_weapon[i]);
  1088.         }
  1089.     }
  1090.    
  1091.     if(file)
  1092.         fclose(file);
  1093. }
  1094. fn_replace_weapon_models(id, weaponid)
  1095. {
  1096.     if(!is_user_alive(id))
  1097.         return;
  1098.    
  1099.     if(g_model_weapon[V_][weaponid][0]) entity_set_string(id, EV_SZ_viewmodel, g_model_weapon[V_][weaponid]);
  1100.     if(g_model_weapon[P_][weaponid][0]) entity_set_string(id, EV_SZ_weaponmodel, g_model_weapon[P_][weaponid]);
  1101.    
  1102.     new color[21];
  1103.     new color_all[21];
  1104.    
  1105.     get_pcvar_string(g_cvar_weapon[weaponid][WEAPON_P_GLOW], color, charsmax(color));
  1106.     get_pcvar_string(g_cvar_weapon[31][WEAPON_P_GLOW], color_all, charsmax(color_all));
  1107.    
  1108.     if(!equali(color, "off") || !equali(color_all, "off"))
  1109.     {
  1110.         new p_rgb[3][4];
  1111.         new i_rgb[3];
  1112.        
  1113.         if(equali(color_all, "off")) parse(color, p_rgb[0], charsmax(p_rgb[]), p_rgb[1], charsmax(p_rgb[]), p_rgb[2], charsmax(p_rgb[]));
  1114.         else parse(color_all, p_rgb[0], charsmax(p_rgb[]), p_rgb[1], charsmax(p_rgb[]), p_rgb[2], charsmax(p_rgb[]));
  1115.        
  1116.         i_rgb[0] = clamp(str_to_num(p_rgb[0]), 0, 255);
  1117.         i_rgb[1] = clamp(str_to_num(p_rgb[1]), 0, 255);
  1118.         i_rgb[2] = clamp(str_to_num(p_rgb[2]), 0, 255);
  1119.        
  1120.         fm_set_weaponmodel_ent(id, i_rgb[0], i_rgb[1], i_rgb[2]);
  1121.     }
  1122. }
  1123. public fn_refill_bpammo(const args[], id)
  1124. {
  1125.     if(!is_user_alive(id))
  1126.         return;
  1127.    
  1128.     set_msg_block(g_msg_ammopickup, BLOCK_ONCE);
  1129.     ExecuteHamB(Ham_GiveAmmo, id, g_max_bpammo[args[0]], g_ammo_type[args[0]], g_max_bpammo[args[0]]);
  1130. }
  1131.  
  1132. // Stocks
  1133. stock fm_set_weaponmodel_ent(id, red = -1, green = -1, blue = -1) // Thanks MeRcyLeZZ for the stock!
  1134. {
  1135.     static model[128];
  1136.     entity_get_string(id, EV_SZ_weaponmodel, model, charsmax(model));
  1137.    
  1138.     if(!pev_valid(g_ent_weaponmodel[id]))
  1139.     {
  1140.         g_ent_weaponmodel[id] = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"));
  1141.         if(!pev_valid(g_ent_weaponmodel[id])) return;
  1142.        
  1143.         entity_set_string(g_ent_weaponmodel[id], EV_SZ_classname, "weapon_model");
  1144.         entity_set_int(g_ent_weaponmodel[id], EV_INT_movetype, MOVETYPE_FOLLOW);
  1145.         entity_set_edict(g_ent_weaponmodel[id], EV_ENT_aiment, id);
  1146.         entity_set_edict(g_ent_weaponmodel[id], EV_ENT_owner, id);
  1147.        
  1148.         if(red != -1 || green != -1 || blue != -1)
  1149.             fm_set_rendering(g_ent_weaponmodel[id], kRenderFxGlowShell, red, green, blue, kRenderNormal, 16);
  1150.     }
  1151.    
  1152.     engfunc(EngFunc_SetModel, g_ent_weaponmodel[id], model);
  1153. }
  1154. stock fm_remove_model_ents(id) // Thanks MeRcyLeZZ for the stock!
  1155. {
  1156.     if(pev_valid(g_ent_weaponmodel[id]))
  1157.     {
  1158.         remove_entity(g_ent_weaponmodel[id]);
  1159.         g_ent_weaponmodel[id] = 0;
  1160.     }
  1161. }
  1162. stock cs_weapon_name_to_id(const weapon[]) // Simplified get_weaponid (CS only) -- Thanks MeRcyLeZZ for the stock!
  1163. {
  1164.     static i;
  1165.     for(i = 0; i < sizeof(g_weapon_ent_names) - 1; i++)
  1166.     {
  1167.         if(equal(weapon, g_weapon_ent_names[i]))
  1168.             return i;
  1169.     }
  1170.    
  1171.     return 0;
  1172. }
  1173. stock fm_get_weapon_ent_owner(ent)
  1174. {
  1175.     if(pev_valid(ent) != OFFSET_PDATA)
  1176.         return -1;
  1177.    
  1178.     return get_pdata_cbase(ent, OFFSET_WEAPON_OWNER, OFFSET_LINUX_WEAPONS);
  1179. }
He who fails to plan is planning to fail

karan
Mod Tester
Mod Tester
India
Posts: 122
Joined: 6 years ago
Location: India
Contact:

#10

Post by karan » 3 years ago

ty raheem its working if i got any problem will let u know :D
Image

johnnysins2000
Veteran Member
Veteran Member
Paraguay
Posts: 678
Joined: 7 years ago
Location: Paraguay
Contact:

#11

Post by johnnysins2000 » 3 years ago

Raheem wrote: 3 years ago Hello there :smiley:,

We will make new version of the Mod, so in this topic post:
  • Your ideas or any missing feature :bulb:
  • Any bug to be fixed :gear:
Waiting your awesome ideas :boom: :boom: :boom:.
How about a new game mode ?
Suggestion : New Game Mode will be Nemesis Mod he will have wall climbing + Leap jumps + Bunny Hopping + Energy Balls(It's like a bazooka but whenyou hit it it does high damage) . Humans will try to escape as usual and randomly instead of turning into zombies the players will automatically turn into nemesis and The Game Mode message will Pop Up ! It's Just like zp !

And new Human Classes
Suggestion: Classic Human,Raptor Human(Will activate his speed boost for limited time in which he will run fast),Jumper Human(Low Gravity),Teleport Human (He can use teleport x2 times)

Note: These human classes are already in zp508 and these are not very overpowered or very advantage to human . I think if there will be an option to disable some human classes or make these for vip or admins That would be very Good!
Nobody Is That Busy If They Make Time :roll:

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

#12

Post by Raheem » 3 years ago

johnnysins2000 wrote: 3 years ago
Raheem wrote: 3 years ago Hello there :smiley:,

We will make new version of the Mod, so in this topic post:
  • Your ideas or any missing feature :bulb:
  • Any bug to be fixed :gear:
Waiting your awesome ideas :boom: :boom: :boom:.
How about a new game mode ?
Suggestion : New Game Mode will be Nemesis Mod he will have wall climbing + Leap jumps + Bunny Hopping + Energy Balls(It's like a bazooka but whenyou hit it it does high damage) . Humans will try to escape as usual and randomly instead of turning into zombies the players will automatically turn into nemesis and The Game Mode message will Pop Up ! It's Just like zp !

And new Human Classes
Suggestion: Classic Human,Raptor Human(Will activate his speed boost for limited time in which he will run fast),Jumper Human(Low Gravity),Teleport Human (He can use teleport x2 times)

Note: These human classes are already in zp508 and these are not very overpowered or very advantage to human . I think if there will be an option to disable some human classes or make these for vip or admins That would be very Good!
The nemesis can be addon not need to be in the Mod itself. The forwards/natives that is needed for this already exists. And human classes can be same as viewtopic.php?f=15&t=3223.
karan wrote: 3 years ago ty raheem its working if i got any problem will let u know :D
OK bro :smiley:
He who fails to plan is planning to fail

johnnysins2000
Veteran Member
Veteran Member
Paraguay
Posts: 678
Joined: 7 years ago
Location: Paraguay
Contact:

#13

Post by johnnysins2000 » 3 years ago

Raheem wrote: 3 years ago
johnnysins2000 wrote: 3 years ago
Raheem wrote: 3 years ago Hello there :smiley:,

We will make new version of the Mod, so in this topic post:
  • Your ideas or any missing feature :bulb:
  • Any bug to be fixed :gear:
Waiting your awesome ideas :boom: :boom: :boom:.
How about a new game mode ?
Suggestion : New Game Mode will be Nemesis Mod he will have wall climbing + Leap jumps + Bunny Hopping + Energy Balls(It's like a bazooka but whenyou hit it it does high damage) . Humans will try to escape as usual and randomly instead of turning into zombies the players will automatically turn into nemesis and The Game Mode message will Pop Up ! It's Just like zp !

And new Human Classes
Suggestion: Classic Human,Raptor Human(Will activate his speed boost for limited time in which he will run fast),Jumper Human(Low Gravity),Teleport Human (He can use teleport x2 times)

Note: These human classes are already in zp508 and these are not very overpowered or very advantage to human . I think if there will be an option to disable some human classes or make these for vip or admins That would be very Good!
The nemesis can be addon not need to be in the Mod itself. The forwards/natives that is needed for this already exists. And human classes can be same as viewtopic.php?f=15&t=3223.
karan wrote: 3 years ago ty raheem its working if i got any problem will let u know :D
OK bro :smiley:
I think you guyz can adda thing in ze hud info

OLD ZE HAD MASTER OF SURVIVAL HUD

You should give a choice of choosing MOS HUD or Escape leader hud in ze hud info
Nobody Is That Busy If They Make Time :roll:

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

#14

Post by Raheem » 3 years ago

johnnysins2000 wrote: 3 years ago I think you guyz can adda thing in ze hud info

OLD ZE HAD MASTER OF SURVIVAL HUD

You should give a choice of choosing MOS HUD or Escape leader hud in ze hud info
This feature already exists. In zombie_escape.cfg:
    1. ze_speed_rank_mode 1            // Rank Message (0 = Disabled || 1 = Leader Mode || 2 = Rank Mode)
Use ze_speed_rank_mode 2 to see MASTER OF SURVIVAL.
He who fails to plan is planning to fail

Templaso
Senior Member
Senior Member
Romania
Posts: 119
Joined: 5 years ago
Location: Bucharest
Contact:

#15

Post by Templaso » 3 years ago

My idea is Achievements Unlock like broke 12 plates or win 10 rounds as a human or as a zombie or infect 15 people in one round.

johnnysins2000
Veteran Member
Veteran Member
Paraguay
Posts: 678
Joined: 7 years ago
Location: Paraguay
Contact:

#16

Post by johnnysins2000 » 3 years ago

Mystic Viper wrote: 3 years ago My idea is Achievements Unlock like broke 12 plates or win 10 rounds as a human or as a zombie or infect 15 people in one round.
I think You mean is Quest System

It already there for zp in which you have to do different missions

It can be done as separate addon
Nobody Is That Busy If They Make Time :roll:

Templaso
Senior Member
Senior Member
Romania
Posts: 119
Joined: 5 years ago
Location: Bucharest
Contact:

#17

Post by Templaso » 3 years ago

Yeah but this need to contain what I described there for our mode.

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

#18

Post by Raheem » 3 years ago

You can post the zp version and it can be converted to our Mod, post in public requests.
I did a system but it's private one.
He who fails to plan is planning to fail

BandiT
Member
Member
Romania
Posts: 59
Joined: 4 years ago
Contact:

#19

Post by BandiT » 3 years ago

Raheem wrote: 3 years ago You can post the zp version and it can be converted to our Mod, post in public requests.
I did a system but it's private one.
can we talk on private about that ?

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

#20

Post by Raheem » 3 years ago

BandiT wrote: 3 years ago can we talk on private about that ?
I did not sell it anymore, there is two servers I sold (Toxic-Gamers.net, [mention]czirimbolo[/mention] server). The idea was given by [mention]czirimbolo[/mention] and I coded a full system for this:
  • system.png
  • cnfgs.png
    cnfgs.png (5.23 KiB) Viewed 10038 times
    cnfgs.png
    cnfgs.png (5.23 KiB) Viewed 10038 times
Plus Web part, thanks to [mention]Mohamed Alaa[/mention]:
  • system_web.png
    system_web.png (11.24 KiB) Viewed 10039 times
    system_web.png
    system_web.png (11.24 KiB) Viewed 10039 times
AMXX Part is fully coded by me, it uses MySQL. I'm sorry it cannot be sold to more servers.
He who fails to plan is planning to fail

Locked

Who is online

Users browsing this forum: No registered users and 9 guests