Plugin Available After zombie gets killed by a human add frags

Unpaid Requests, Public Plugins
Post Reply
pirate228
Member
Member
India
Posts: 16
Joined: 1 Year Ago
Has thanked: 2 times
Been thanked: 0
Age: 19
Contact:

After zombie gets killed by a human add frags

#1

Post by pirate228 » 4 Months Ago

I need a help in creating human frags when a zombie gets killed by him ,just like zombies infect humans they get 5 frags
but I when I asked Raheem he said he will help but he didn't lol, if anyone can please pm me. :D

User avatar
Muhammet20
Veteran Member
Veteran Member
Syria
Posts: 399
Joined: 1 Year Ago
Location: Turkey
Has thanked: 36 times
Been thanked: 5 times
Age: 13
Contact:

#2

Post by Muhammet20 » 4 Months Ago

pirate228 wrote:
4 Months Ago
I need a help in creating human frags when a zombie gets killed by him ,just like zombies infect humans they get 5 frags
but I when I asked Raheem he said he will help but he didn't lol, if anyone can please pm me. :D
idk why you need this ik escape coins and xp/escapes for level is good why need to frags?
so you know why but i can't help cuz your idea is crazy bro
.::Kaya Gaming || Never Give Up || Zombie Escape::. [Server is Under The Work]
https://kaya-gaming.ga/

I just believe in two things, First thing is who i see in the mirror, second thing is who i don't see in the sky.

User avatar
Muhammet20
Veteran Member
Veteran Member
Syria
Posts: 399
Joined: 1 Year Ago
Location: Turkey
Has thanked: 36 times
Been thanked: 5 times
Age: 13
Contact:

#3

Post by Muhammet20 » 4 Months Ago

pirate228 wrote:
4 Months Ago
I need a help in creating human frags when a zombie gets killed by him ,just like zombies infect humans they get 5 frags
but I when I asked Raheem he said he will help but he didn't lol, if anyone can please pm me. :D
Frags:

Code: Select all

#include <zombie_escape>

#define PLUGIN "[ZE] Frags System"
#define VERSION "1.0"
#define AUTHOR "Kaya Gaming"

new g_Vault, g_maxplayers, g_iFrags[33]

new g_cvar_frags_per_kill
public plugin_init() 
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	register_event("DeathMsg", "EventDeathMsg", "a")
	g_maxplayers = get_maxplayers()
	
	g_cvar_frags_per_kill = register_cvar("ze_frags_per_kill","5")
}
public plugin_natives()
{
	register_native("ze_get_user_frags","native_get_user_frags",1)
	register_native("ze_set_user_frags","native_set_user_frags",1)
}
public plugin_cfg()
{
	//Open our vault and have g_Vault store the handle.
	g_Vault = nvault_open( "Frags" );

	//Make the plugin error if vault did not successfully open
	if ( g_Vault == INVALID_HANDLE )
	set_fail_state( "Error opening Frags nVault, file does not exist!" );
}
public client_connect(id)
{
	LoadFrags(id)
}
public client_disconnect(id)
{
	SaveFrags(id)
}
public EventDeathMsg()
{
	new g_attacker = read_data(1);
	new g_victim = read_data(2);
	
	if(!ze_is_user_zombie(g_attacker) && ze_is_user_zombie(g_victim))
	{
		if((1 <= g_attacker <= g_maxplayers))
		{
			if(g_victim != g_attacker)
			{
				g_iFrags[g_attacker] += get_pcvar_num(g_cvar_frags_per_kill)
			}
		}
	}
	SaveFrags(g_attacker)
}
SaveFrags(id)
{
	new szAuth[33];
	new szKey[64];
	
	get_user_name( id, szAuth , charsmax(szAuth) );
	formatex( szKey , 63 , "%s-NAME" , szAuth);
	
	new szData[256];
	formatex( szData , 255 , "%i#" ,g_iFrags[id] );
	nvault_set( g_Vault , szKey , szData );
}
LoadFrags(id)
{
	new szAuth[33];
	new szKey[40];
	
	get_user_name( id, szAuth , charsmax(szAuth) );
	formatex( szKey , 63 , "%s-NAME" , szAuth);
	
	new szData[256];

	formatex(szData , 255, "%i#", g_iFrags[id]) 

	nvault_get(g_Vault, szKey, szData, 255) 

	replace_all(szData , 255, "#", " ")
	new infects[32] 
	parse(szData, infects, 31) 
	g_iFrags[id] = str_to_num(infects)
}
public native_get_user_frags(id)
{
	return g_iFrags[id]
}
public native_set_user_frags(id, amount)
{
	g_iFrags[id] = amount
}
Frags Hud:

Code: Select all

#include <zombie_escape>
#include <ze_frags>

#define PLUGIN "[ZE] Frags Hud Info"
#define VERSION "1.0"
#define AUTHOR "Kaya Gaming"

#define TASK_SHOWHUD 100
#define ID_SHOWHUD (taskid - TASK_SHOWHUD)

new g_msgHudSync1
public plugin_init() 
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	g_msgHudSync1 = CreateHudSyncObj();
}
public client_disconnect(id)
{
	remove_task(id+TASK_SHOWHUD)
}
public client_putinserver(id)
{
	set_task(0.1, "ShowHUD", id+TASK_SHOWHUD, _, _, "b")
}
public ShowHUD(taskid)
{
	new id = ID_SHOWHUD
	if(!ze_is_user_zombie(id)) 
	{	
		set_hudmessage(0, 255, 255, -1.0, 0.85, 0, 6.0, 0.1)
		ShowSyncHudMsg(id,g_msgHudSync1,"Frags: %i",ze_get_user_frags)
	}
}
for include file:
cstrike.rar
ze_frags.inc include file
(462 Bytes) Downloaded 12 times
cstrike.rar
ze_frags.inc include file
(462 Bytes) Downloaded 12 times
info: this plugin is by me i hope working with you i tested it working but let's see if it will work with you
.::Kaya Gaming || Never Give Up || Zombie Escape::. [Server is Under The Work]
https://kaya-gaming.ga/

I just believe in two things, First thing is who i see in the mirror, second thing is who i don't see in the sky.

pirate228
Member
Member
India
Posts: 16
Joined: 1 Year Ago
Has thanked: 2 times
Been thanked: 0
Age: 19
Contact:

#4

Post by pirate228 » 4 Months Ago

not working

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1972
Joined: 2 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 108 times
Age: 22
Contact:

#5

Post by Raheem » 4 Months Ago

Use this ze_effects_frags.sms instead of original one, use new CVAR: ze_human_kils_frags 4
    1. #include <zombie_escape>
    2.  
    3. // Variables
    4. new g_iMaxClients
    5.  
    6. // Cvars
    7. new g_pCvarHumanInfectedFrags,
    8.     g_pCvarEscapeSuccessFrags,
    9.     g_pCvarInfectionDeaths,
    10.     g_pCvarHumanKillsFrags
    11.  
    12. public plugin_init()
    13. {
    14.     register_plugin("[ZE] Frags Awards/Death Effects", ZE_VERSION, AUTHORS)
    15.    
    16.     RegisterHookChain(RG_CBasePlayer_Killed, "Fw_PlayerKilled_Post", 1)
    17.    
    18.     // Cvars
    19.     g_pCvarHumanInfectedFrags = register_cvar("ze_human_infected_frags", "1")
    20.     g_pCvarInfectionDeaths = register_cvar("ze_infection_deaths", "1")
    21.     g_pCvarEscapeSuccessFrags = register_cvar("ze_escape_success_frags", "3")
    22.     g_pCvarHumanKillsFrags = register_cvar("ze_human_kils_frags", "4")
    23.    
    24.     // Static Values
    25.     g_iMaxClients = get_member_game(m_nMaxPlayers)
    26. }
    27.  
    28. public Fw_PlayerKilled_Post(iVictim, iAttacker)
    29. {
    30.     if (!ze_is_user_zombie(iAttacker))
    31.     {
    32.         UpdateFrags(iAttacker, 0, get_pcvar_num(g_pCvarHumanKillsFrags), 0, 1)
    33.     }
    34. }
    35.  
    36. public ze_user_infected(iVictim, iInfector)
    37. {
    38.     if (iInfector == 0) // Block Awards for Zombies Chosen by the Server
    39.         return
    40.    
    41.     // Award Zombie Who infected, And Increase Deaths of the infected human
    42.     UpdateFrags(iInfector, iVictim, get_pcvar_num(g_pCvarHumanInfectedFrags), get_pcvar_num(g_pCvarInfectionDeaths), 1)
    43.    
    44.     // Adding Infection icon on Victim Screen
    45.     InfectionIcon(iVictim)
    46.    
    47.     // Fix Dead Attribute (Delay needed)
    48.     set_task(0.1, "Fix_DeadAttrib", _, _, _, "a", 6)
    49. }
    50.  
    51. public ze_roundend(WinTeam)
    52. {
    53.     if (WinTeam == ZE_TEAM_HUMAN)
    54.     {
    55.         for (new id = 1; id <= g_iMaxClients; id++)
    56.         {
    57.             // Skip All Dead Players or Zombies
    58.             if (!is_user_alive(id) || get_member(id, m_iTeam) == TEAM_TERRORIST)
    59.                 continue
    60.            
    61.             // + Frags for All humans Who are Alive
    62.             UpdateFrags(id, 0, get_pcvar_num(g_pCvarEscapeSuccessFrags), 0, 1)
    63.         }
    64.     }
    65. }
    66.  
    67. public Fix_DeadAttrib()
    68. {
    69.     for (new id = 1; id <= g_iMaxClients; id++)
    70.     {
    71.         // Skip All Dead And Humans
    72.         if (!is_user_alive(id) || get_member(id, m_iTeam) == TEAM_CT)
    73.             continue
    74.        
    75.         // Fix the Dead Attribute
    76.         FixDeadAttrib(id)
    77.     }
    78. }
You don't know? Learn and you will know.

Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests