new g_increase_zombie[32][5]
new g_money[32], g_inf_money[32]
new const g_g_increase_zombie_name[][] =
register_plugin(NAME_PL, VERSION, AUTHOR)
register_clcmd("increase_zombie", "increase_zombie")
register_clcmd("say /increase_zombie", "increase_zombie")
register_menu("Increase Zombie Menu", (1<<0|1<<1|1<<2|1<<3|1<<3|1<<4|1<<5|1<<6|1<<7|1<<8|1<<9), "menu_increase_zombie")
RegisterHam(Ham_TraceAttack, "player", "fw_TraceAttack")
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")
//public client_putinserver(id)
//public client_disconnect(id)
public zp_user_infected_post(id)
if(is_user_connected(id) && zp_get_user_zombie(id))
fm_set_user_health(id, pev(id, pev_health) + (PLUS_HEALTH*g_increase_zombie[id][0]))
fm_set_user_gravity(id, pev(id, pev_gravity) - ((PLUS_GRAVIRY*g_increase_zombie[id][1])*0.05))
fm_set_user_maxspeed(id, pev(id, pev_maxspeed) + (PLUS_SPEED*g_increase_zombie[id][2]) + 0.0)
public fw_TraceAttack(victim, attacker, Float:damage, Float:direction[3], tracehandle, damage_type)
if(victim == attacker || !zp_get_user_zombie(victim))
pev(victim, pev_velocity, velocity)
xs_vec_mul_scalar(direction, damage - (PLUS_NOKNOCK*g_increase_zombie[victim][3])*5, direction)
xs_vec_add(velocity, direction, direction)
direction[2] = velocity[2]
set_pev(victim, pev_velocity, direction)
public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
if(victim == attacker || zp_get_user_zombie(victim))
if(is_user_connected(attacker) && zp_get_user_zombie(attacker))
pev(victim, pev_armorvalue, armor)
if(armor - damage + (PLUS_ARMOR_DM*g_increase_zombie[attacker][4]) > 0.0)
set_pev(victim, pev_armorvalue, armor - damage + (PLUS_ARMOR_DM*g_increase_zombie[attacker][4]))
cs_set_user_armor(victim, 0, CS_ARMOR_NONE)
public fw_PlayerKilled(victim, attacker, shouldgib)
if(zp_get_user_zombie(attacker))
if(g_inf_money[attacker]==INF_HUMAN)
public increase_zombie(id)
if(!is_user_connected(id))
static iMenu[512], iLen, iKeys = (1<<0|1<<1|1<<2|1<<3|1<<4|1<<9)
iLen += formatex(iMenu[iLen], charsmax(iMenu) - iLen, "\r[ZP] \wПрокачка зомби^n")
iLen += formatex(iMenu[iLen], charsmax(iMenu) - iLen, "\r[ZP] \wМонет: \y%d^n", g_money[id])
iLen += formatex(iMenu[iLen], charsmax(iMenu) - iLen, "\dИзменение вступит, после смерти.^n^n", g_money[id])
if((LIMIT_HEALTH-g_increase_zombie[id][0])==0)
iLen += formatex(iMenu[iLen], charsmax(iMenu) - iLen, "\r[1] \dЗдоровье \y(+%d) \r[LIMIT]^n", PLUS_HEALTH)
iLen += formatex(iMenu[iLen], charsmax(iMenu) - iLen, g_money[id]>=MONEY_HEALTH ? "\r[1] \wЗдоровье \d(+%d) \r[%d] \d(М: %d)^n" : "\r[1] \dЗдоровье \d(+%d) \r[%d] \y(М: %d)^n", PLUS_HEALTH, (LIMIT_HEALTH-g_increase_zombie[id][0]), MONEY_HEALTH)
if((LIMIT_GRAVIRY-g_increase_zombie[id][1])==0)
iLen += formatex(iMenu[iLen], charsmax(iMenu) - iLen, "\r[2] \dГравитация \y(+%d) \r[LIMIT]^n", PLUS_GRAVIRY)
iLen += formatex(iMenu[iLen], charsmax(iMenu) - iLen, g_money[id]>=MONEY_GRAVIRY ? "\r[2] \wГравитация \d(+%d) \r[%d] \d(М: %d)^n" : "\r[2] \dГравитация \d(+%d) \r[%d] \y(М: %d)^n", PLUS_GRAVIRY, (LIMIT_GRAVIRY-g_increase_zombie[id][1]), MONEY_GRAVIRY)
if((LIMIT_SPEED-g_increase_zombie[id][2])==0)
iLen += formatex(iMenu[iLen], charsmax(iMenu) - iLen, "\r[3] \dСкорость \y(+%d) \r[LIMIT]^n", PLUS_SPEED)
iLen += formatex(iMenu[iLen], charsmax(iMenu) - iLen, g_money[id]>=MONEY_SPEED ? "\r[3] \wСкорость \d(+%d) \r[%d] \d(М: %d)^n" : "\r[3] \dСкорость \d(+%d) \r[%d] \y(М: %d)^n", PLUS_SPEED, (LIMIT_SPEED-g_increase_zombie[id][2]), MONEY_SPEED)
if((LIMIT_NOKNOCK-g_increase_zombie[id][3])==0)
iLen += formatex(iMenu[iLen], charsmax(iMenu) - iLen, "\r[4] \dАнти-отброс \y(+%d) \r[LIMIT]^n^n", PLUS_NOKNOCK)
iLen += formatex(iMenu[iLen], charsmax(iMenu) - iLen, g_money[id]>=MONEY_NOKNOCK ? "\r[4] \wАнти-отброс \d(+%d) \r[%d] \d(М: %d)^n^n" : "\r[4] \dАнти-отброс \d(+%d) \r[%d] \y(М: %d)^n^n", PLUS_NOKNOCK, (LIMIT_NOKNOCK-g_increase_zombie[id][3]), MONEY_NOKNOCK)
if((LIMIT_ARMOR_DM-g_increase_zombie[id][4])==0)
iLen += formatex(iMenu[iLen], charsmax(iMenu) - iLen, "\r[5] \dУрон по броне \y(+%d) \r[LIMIT]^n", PLUS_ARMOR_DM)
iLen += formatex(iMenu[iLen], charsmax(iMenu) - iLen, g_money[id]>=MONEY_ARMOR_DM ? "\r[5] \wУрон по броне \d(+%d) \r[%d] \d(М: %d)^n" : "\r[5] \dУрон по броне \d(+%d) \r[%d] \y(М: %d)^n", PLUS_ARMOR_DM, (LIMIT_ARMOR_DM-g_increase_zombie[id][4]), MONEY_ARMOR_DM)
iLen += formatex(iMenu[iLen], charsmax(iMenu) - iLen, "^n\r[0] \wВыход")
show_menu(id, iKeys, iMenu, -1, "Increase Zombie Menu")
public menu_increase_zombie(id, key)
if(!is_user_connected(id))
if((LIMIT_HEALTH-g_increase_zombie[id][0])==0)
if(g_off_on_menu==OFF_ON_MENU)
zp_color_chat(id, NOT_INCREASE)
g_increase_zombie[id][0]++
zp_color_chat(id, INCREASE, g_g_increase_zombie_name[0], (LIMIT_HEALTH-g_increase_zombie[id][0]))
if((LIMIT_GRAVIRY-g_increase_zombie[id][1])==0)
if(g_off_on_menu==OFF_ON_MENU)
zp_color_chat(id, NOT_INCREASE)
g_increase_zombie[id][1]++
zp_color_chat(id, INCREASE, g_g_increase_zombie_name[1], (LIMIT_GRAVIRY-g_increase_zombie[id][1]))
if((LIMIT_SPEED-g_increase_zombie[id][2])==0)
if(g_off_on_menu==OFF_ON_MENU)
zp_color_chat(id, NOT_INCREASE)
g_increase_zombie[id][2]++
zp_color_chat(id, INCREASE, g_g_increase_zombie_name[2], (LIMIT_SPEED-g_increase_zombie[id][2]))
if((LIMIT_NOKNOCK-g_increase_zombie[id][3])==0)
if(g_off_on_menu==OFF_ON_MENU)
zp_color_chat(id, NOT_INCREASE)
g_increase_zombie[id][3]++
zp_color_chat(id, INCREASE, g_g_increase_zombie_name[3], (LIMIT_NOKNOCK-g_increase_zombie[id][3]))
if((LIMIT_ARMOR_DM-g_increase_zombie[id][4])==0)
if(g_off_on_menu==OFF_ON_MENU)
zp_color_chat(id, NOT_INCREASE)
g_increase_zombie[id][4]++
zp_color_chat(id, INCREASE, g_g_increase_zombie_name[4], (LIMIT_ARMOR_DM-g_increase_zombie[id][4]))
if(g_off_on_menu==OFF_ON_MENU)
stock zp_color_chat(const id, const input[], any:...)
new count = 1, players[32]
vformat(msg, 190, input, 3)
replace_all(msg, 190, "!g", "^4")
replace_all(msg, 190, "!y", "^1")
replace_all(msg, 190, "!t", "^3")
if (id) players[0] = id; else get_players(players, count, "ch")
for (new i = 0; i < count; i++)
if (is_user_connected(players[i]))
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
new Handle:g_hDBHandle, Handle:g_hDBInfo
new ID[32], NAME[32], IP[32]
get_user_authid(id, ID, charsmax(ID))
get_user_ip(id, IP, charsmax(IP))
get_user_name(id, NAME, charsmax(NAME))
new Handle:hQuery = SQL_PrepareQuery(g_hDBHandle, "SELECT `Money`, `Health`, `Graviry`, `Speed`, `NoKnock`, `ArmorDm` FROM `increase_zombie_data` WHERE steamid = '%s'", ID)
SQL_QueryError(hQuery, Error, charsmax(Error))
if(!SQL_NumResults(hQuery))
get_user_ip(id, ip, charsmax(ip), 1)
hQuery = SQL_PrepareQuery(g_hDBHandle, "INSERT INTO `increase_zombie_data` (`name`, `steamid`, `ip`, `Money`, `Health`, `Graviry`, `Speed`, `NoKnock`, `ArmorDm`) VALUES ('%s', '%s', '%s', '%d', '%d', '%d', '%d', '%d', '%d')", NAME, ID, IP, 0, 0, 0, 0, 0, 0)
if (!SQL_Execute(hQuery))
server_print("Error due increase!");
g_money[id] = SQL_ReadResult(hQuery, 0)
g_increase_zombie[id][0] = SQL_ReadResult(hQuery, 1)
g_increase_zombie[id][1] = SQL_ReadResult(hQuery, 2)
g_increase_zombie[id][2] = SQL_ReadResult(hQuery, 3)
g_increase_zombie[id][3] = SQL_ReadResult(hQuery, 4)
g_increase_zombie[id][4] = SQL_ReadResult(hQuery, 5)
g_hDBInfo = SQL_MakeDbTuple(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME)
g_hDBHandle = SQL_Connect(g_hDBInfo, errno, Error, charsmax(Error))
SQL_FreeHandle(g_hDBInfo)
if(g_hDBHandle == Empty_Handle)
new Handle:ResultT=SQL_PrepareQuery(g_hDBHandle, "CREATE TABLE IF NOT EXISTS `increase_zombie_data` (`name` VARCHAR(35) NOT NULL default '', `steamid` VARCHAR(25) NOT NULL default '', `ip` VARCHAR(20) NOT NULL default '', `Money` INT(6) NOT NULL, `Health` INT(6) NOT NULL, `Graviry` INT(6) NOT NULL, `Speed` INT(6) NOT NULL, `NoKnock` INT(6) NOT NULL, `ArmorDm` INT(6) NOT NULL)")
if(!SQL_Execute(ResultT))
SQL_QueryError(ResultT,Error,127)
get_user_authid(id, ID, charsmax(ID))
new Handle:hQuery = SQL_PrepareQuery(g_hDBHandle, "UPDATE `increase_zombie_data` SET `Money`='%i', `Health`='%i', `Graviry`='%i', `Speed`='%i', `NoKnock`='%i', `ArmorDm`='%i' WHERE `steamid` = '%s'", g_money[id], g_increase_zombie[id][0], g_increase_zombie[id][1], g_increase_zombie[id][2], g_increase_zombie[id][3], g_increase_zombie[id][4], ID)
if (!SQL_Execute(hQuery))
SQL_QueryError(hQuery, Error, charsmax(Error))
SQL_FreeHandle(g_hDBHandle)