Raised This Month: $ Target: $400
 0% 

[ HELP ] How to fix the code?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 11-19-2015 , 14:12   [ HELP ] How to fix the code?
Reply With Quote #1

I have a little problem this plugin, it multiplies the damage pattern of a gun by the number of cvars, but not working, what's wrong? and I can improve the code?

Code:
#include < amxmodx > #include < hamsandwich > #include < zombieplague > new const VERSION[] = "1.1"; new g_hamczbots, cvar_botquota, Float:cvar_increase_damage_x, cvar_gmode_increase_damage[5]; public plugin_init() {     register_plugin("[ZP43] Addon: Increase Damage", VERSION, "CrazY");     cvar_botquota = get_cvar_pointer("bot_quota");     cvar_gmode_increase_damage[0] = register_cvar("zp_infection_mod_damage_x", "1.0")     cvar_gmode_increase_damage[1] = register_cvar("zp_nemesis_mod_damage_x", "1.0")     cvar_gmode_increase_damage[3] = register_cvar("zp_survivor_mod_damage_x", "1.0")     cvar_gmode_increase_damage[4] = register_cvar("zp_swarm_mod_damage_x", "1.0")     cvar_gmode_increase_damage[5] = register_cvar("zp_plague_mod_damage_x", "1.0")     RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage"); } public client_putinserver(id) {     if (is_user_bot(id) && g_hamczbots && cvar_botquota)         set_task(0.1, "register_ham_bots", id); } public register_ham_bots(id) {     if (g_hamczbots || !is_user_connected(id) || !get_pcvar_num(cvar_botquota))         return;     RegisterHamFromEntity(Ham_TakeDamage, id, "fw_TakeDamage");         g_hamczbots = true; } public zp_round_started(mode) {     new attacker = read_data(2);         if(!zp_get_user_zombie(attacker))     {         switch (mode)         {             case MODE_INFECTION: // Infection mode             {                 cvar_increase_damage_x = get_pcvar_float(cvar_gmode_increase_damage[0]);             }             case MODE_MULTI: // Multi-Infection mode             {                 cvar_increase_damage_x = get_pcvar_float(cvar_gmode_increase_damage[0]);             }             case MODE_NEMESIS: // Nemesis mode             {                 cvar_increase_damage_x = get_pcvar_float(cvar_gmode_increase_damage[1]);             }             case MODE_SURVIVOR: // Survivor mode             {                 cvar_increase_damage_x = get_pcvar_float(cvar_gmode_increase_damage[2]);             }             case MODE_SWARM: // Swarm mode             {                 cvar_increase_damage_x = get_pcvar_float(cvar_gmode_increase_damage[3]);             }             case MODE_PLAGUE: // Plague mode             {                 cvar_increase_damage_x = get_pcvar_float(cvar_gmode_increase_damage[4]);             }         }     } } public fw_TakeDamage(attacker, victim, inflictor, Float:damage) {     if (is_user_alive(attacker) && is_user_alive(victim))     {         SetHamParamFloat(4, damage * cvar_increase_damage_x);     } }
__________________








CrazY. is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:04.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode