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.
After zombie gets killed by a human add frags
-
- Veteran Member
- Posts: 408
- Joined: 5 years ago
- Contact:
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
-
- Veteran Member
- Posts: 408
- Joined: 5 years ago
- Contact:
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
}
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)
}
}
Use this ze_effects_frags.sms instead of original one, use new CVAR:
ze_human_kils_frags 4
- #include <zombie_escape>
- // Variables
- new g_iMaxClients
- // Cvars
- new g_pCvarHumanInfectedFrags,
- g_pCvarEscapeSuccessFrags,
- g_pCvarInfectionDeaths,
- g_pCvarHumanKillsFrags
- public plugin_init()
- {
- register_plugin("[ZE] Frags Awards/Death Effects", ZE_VERSION, AUTHORS)
- RegisterHookChain(RG_CBasePlayer_Killed, "Fw_PlayerKilled_Post", 1)
- // Cvars
- g_pCvarHumanInfectedFrags = register_cvar("ze_human_infected_frags", "1")
- g_pCvarInfectionDeaths = register_cvar("ze_infection_deaths", "1")
- g_pCvarEscapeSuccessFrags = register_cvar("ze_escape_success_frags", "3")
- g_pCvarHumanKillsFrags = register_cvar("ze_human_kils_frags", "4")
- // Static Values
- g_iMaxClients = get_member_game(m_nMaxPlayers)
- }
- public Fw_PlayerKilled_Post(iVictim, iAttacker)
- {
- if (!ze_is_user_zombie(iAttacker))
- {
- UpdateFrags(iAttacker, 0, get_pcvar_num(g_pCvarHumanKillsFrags), 0, 1)
- }
- }
- public ze_user_infected(iVictim, iInfector)
- {
- if (iInfector == 0) // Block Awards for Zombies Chosen by the Server
- return
- // Award Zombie Who infected, And Increase Deaths of the infected human
- UpdateFrags(iInfector, iVictim, get_pcvar_num(g_pCvarHumanInfectedFrags), get_pcvar_num(g_pCvarInfectionDeaths), 1)
- // Adding Infection icon on Victim Screen
- InfectionIcon(iVictim)
- // Fix Dead Attribute (Delay needed)
- set_task(0.1, "Fix_DeadAttrib", _, _, _, "a", 6)
- }
- public ze_roundend(WinTeam)
- {
- if (WinTeam == ZE_TEAM_HUMAN)
- {
- for (new id = 1; id <= g_iMaxClients; id++)
- {
- // Skip All Dead Players or Zombies
- if (!is_user_alive(id) || get_member(id, m_iTeam) == TEAM_TERRORIST)
- continue
- // + Frags for All humans Who are Alive
- UpdateFrags(id, 0, get_pcvar_num(g_pCvarEscapeSuccessFrags), 0, 1)
- }
- }
- }
- public Fix_DeadAttrib()
- {
- for (new id = 1; id <= g_iMaxClients; id++)
- {
- // Skip All Dead And Humans
- if (!is_user_alive(id) || get_member(id, m_iTeam) == TEAM_CT)
- continue
- // Fix the Dead Attribute
- FixDeadAttrib(id)
- }
- }
He who fails to plan is planning to fail
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute
Sign in
Who is online
Users browsing this forum: No registered users and 2 guests