Post by Abhinash ( Bboy NeO ) on Aug 1, 2016 12:50:19 GMT
Hello .
I think here everyone has played in Zombie Plague 6.2/6.0 and Zombie Outstanding servers.
So, my question is - What difference do you see with the above mods and what we see in the default bullet damage plugin posted in Alliedmodders.net ?
Ans- In the above mod's bullet damage dosent show for zombies ( including nemesis and Assassin ) and Snipers.
Advantage - This function make the server more good and also dosent flood the players HUD while they are being Zombie or Sniper.
So, in this tutorial i will teach you how to do it inthe default bullet damage plugin.
Lets Begin.
First .
Code of default bullet damage plugin --
Now, go below the public Event_Damage ( iVictim ) and below this code --
Add a code that blocks to show the bullet damage to Zombies and Snipers .
This is the code --
So, here we are done .
The final code should look this this --
------ Explanations ------
1. What does the new code does ?
Ans. The new code just blocks the bullet damage show function for Zombies and Snipers.
2. What is the meaning of the new code ?
Ans. The meaning of the new code is - if the attacker is Zombie and Sniper, the code will block bullet damage show functions for them
Thats it.
Dont forget to give me karma after using this tutorial.
Hope you got help from my this tutorial.
Have a nice day.
Regards
Abhinash
Thanks.
I think here everyone has played in Zombie Plague 6.2/6.0 and Zombie Outstanding servers.
So, my question is - What difference do you see with the above mods and what we see in the default bullet damage plugin posted in Alliedmodders.net ?
Ans- In the above mod's bullet damage dosent show for zombies ( including nemesis and Assassin ) and Snipers.
Advantage - This function make the server more good and also dosent flood the players HUD while they are being Zombie or Sniper.
So, in this tutorial i will teach you how to do it inthe default bullet damage plugin.
Lets Begin.
First .
Code of default bullet damage plugin --
#include <amxmodx>
#include <zombie_plague62>
#define PLUGIN "Bullet Damage"
#define AUTHOR "ConnorMcLeod"
#define VERSION "0.0.1"
#define MAX_PLAYERS 32
new const Float:g_flCoords[][] =
{
{0.50, 0.40},
{0.56, 0.44},
{0.60, 0.50},
{0.56, 0.56},
{0.50, 0.60},
{0.44, 0.56},
{0.40, 0.50},
{0.44, 0.44}
}
new g_iPlayerPos[MAX_PLAYERS+1]
new g_iMaxPlayers
new g_pCvarEnabled
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
g_pCvarEnabled = register_cvar("bullet_damage", "1")
register_event("Damage", "Event_Damage", "b", "2>0", "3=0")
g_iMaxPlayers = get_maxplayers()
}
public Event_Damage( iVictim )
{
if( get_pcvar_num(g_pCvarEnabled) && (read_data(4) || read_data(5) || read_data(6)) )
{
new id = get_user_attacker(iVictim)
if( (1 <= id <= g_iMaxPlayers) && is_user_connected(id) )
{
new iPos = ++g_iPlayerPos[id]
if( iPos == sizeof(g_flCoords) )
{
iPos = g_iPlayerPos[id] = 0
}
set_hudmessage(0, 40, 80, Float:g_flCoords[iPos][0], Float:g_flCoords[iPos][1], 0, 0.1, 2.5, 0.02, 0.02, -1)
show_hudmessage(id, "%d", read_data(2))
}
}
}
Now, go below the public Event_Damage ( iVictim ) and below this code --
if( (1 <= id <= g_iMaxPlayers) && is_user_connected(id) )
Add a code that blocks to show the bullet damage to Zombies and Snipers .
This is the code --
if (zp_get_user_sniper(id) || zp_get_user_zombie(id)) return;
So, here we are done .
The final code should look this this --
/* Copyright © 2009, ConnorMcLeod
Bullet Damage is free software;
you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Bullet Damage; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <amxmodx>
#include <zombie_plague62>
#define PLUGIN "Bullet Damage"
#define AUTHOR "ConnorMcLeod"
#define VERSION "0.0.1"
#define MAX_PLAYERS 32
new const Float:g_flCoords[][] =
{
{0.50, 0.40},
{0.56, 0.44},
{0.60, 0.50},
{0.56, 0.56},
{0.50, 0.60},
{0.44, 0.56},
{0.40, 0.50},
{0.44, 0.44}
}
new g_iPlayerPos[MAX_PLAYERS+1]
new g_iMaxPlayers
new g_pCvarEnabled
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
g_pCvarEnabled = register_cvar("bullet_damage", "1")
register_event("Damage", "Event_Damage", "b", "2>0", "3=0")
g_iMaxPlayers = get_maxplayers()
}
public Event_Damage( iVictim )
{
if( get_pcvar_num(g_pCvarEnabled) && (read_data(4) || read_data(5) || read_data(6)) )
{
new id = get_user_attacker(iVictim)
if( (1 <= id <= g_iMaxPlayers) && is_user_connected(id) )
if (zp_get_user_sniper(id) || zp_get_user_zombie(id)) return;
{
new iPos = ++g_iPlayerPos[id]
if( iPos == sizeof(g_flCoords) )
{
iPos = g_iPlayerPos[id] = 0
}
set_hudmessage(0, 40, 80, Float:g_flCoords[iPos][0], Float:g_flCoords[iPos][1], 0, 0.1, 2.5, 0.02, 0.02, -1)
show_hudmessage(id, "%d", read_data(2))
}
}
}
------ Explanations ------
1. What does the new code does ?
Ans. The new code just blocks the bullet damage show function for Zombies and Snipers.
2. What is the meaning of the new code ?
Ans. The meaning of the new code is - if the attacker is Zombie and Sniper, the code will block bullet damage show functions for them
Thats it.
Dont forget to give me karma after using this tutorial.
Hope you got help from my this tutorial.
Have a nice day.
Regards
Abhinash
Thanks.