Olá galera venhoo postar o sorteio de Bala infinita e o Happy Hour tao pedido no skype...
Sma :
Não iremos esquecer do happy Hour :)
Sma :
AJUDEI ? GOSTOU ? REP ++
Sma :
Código:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta_util>
#include <zombieplague>
#define PLUGIN "[ZP] Addon: Sorteio de Bala Infinita"
#define VERSION "1.0"
#define AUTHOR "[P]erfec[T] [S]cr[@]s[H] | ZP Dev Team"
// CS Offsets
#if cellbits == 32
const OFFSET_CLIPAMMO = 51
#else
const OFFSET_CLIPAMMO = 65
#endif
const OFFSET_LINUX_WEAPONS = 4
// Max Clip for weapons
new const MAXCLIP[] = { -1, 13, -1, 10, 1, 7, -1, 30, 30, 1, 30, 20, 25, 30, 35, 25, 12, 20,
10, 30, 100, 8, 30, 30, 20, 2, 7, 30, 30, -1, 50 }
new g_MaxPlayers
new g_TargetPlayer
new cvar_delay
new g_has_unlimited_clip[33]
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
cvar_delay = register_cvar ("zp_bala_inf_delay", "7.0")
register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
register_message(get_user_msgid("CurWeapon"), "message_cur_weapon")
g_MaxPlayers = get_maxplayers()
}
public event_round_start()
{
for (new id; id <= g_MaxPlayers; id++)
{
g_has_unlimited_clip[id] = false;
set_task(get_pcvar_float(cvar_delay), "ganhar_infinita", id)
}
}
public client_disconnect(id)
{
if (g_has_unlimited_clip[id])
{
g_has_unlimited_clip[id] = false
}
}
// Quando o Jogador Vira ZM
public zp_user_infected_post(id, infected, infector)
{
if (g_has_unlimited_clip[id])
{
g_has_unlimited_clip[id] = false
}
}
// Quando o Jogador Usa Antidoto
public zp_user_humanized_post(id, human)
{
if (g_has_unlimited_clip[id])
{
g_has_unlimited_clip[id] = false
}
}
// Quando o Jogador Virar Survivor ou Sniper
public zp_user_humanized_pre(id)
{
if (g_has_unlimited_clip[id])
{
g_has_unlimited_clip[id] = false
}
}
public ganhar_infinita(id)
{
g_TargetPlayer = (id == 1) ? GetRandomAlive(random_num(1, GetAliveCount())) : id
new name[32]
get_user_name(g_TargetPlayer, name, charsmax(name))
set_hudmessage(255, 0, 0, 0.19, 0.38, 0, 6.0, 12.0)
show_hudmessage(id, "O Jogador %s Ganhou Bala Infinita^nNo Sorteio")
g_has_unlimited_clip[g_TargetPlayer] = true
}
public message_cur_weapon(msg_id, msg_dest, msg_entity)
{
// Player doesn't have the unlimited clip upgrade
if (!g_has_unlimited_clip[msg_entity])
return;
// Player not alive or not an active weapon
if (!is_user_alive(msg_entity) || get_msg_arg_int(1) != 1)
return;
static weapon, clip
weapon = get_msg_arg_int(2) // get weapon ID
clip = get_msg_arg_int(3) // get weapon clip
// Unlimited Clip Ammo
if (MAXCLIP[weapon] > 2) // skip grenades
{
set_msg_arg_int(3, get_msg_argtype(3), MAXCLIP[weapon]) // HUD should show full clip all the time
if (clip < 2) // refill when clip is nearly empty
{
// Get the weapon entity
static wname[32], weapon_ent
get_weaponname(weapon, wname, sizeof wname - 1)
weapon_ent = fm_find_ent_by_owner(-1, wname, msg_entity)
// Set max clip on weapon
fm_set_weapon_ammo(weapon_ent, MAXCLIP[weapon])
}
}
}
// Get Alive Count -returns alive players number-
GetAliveCount()
{
new iAlive, id
for (id = 1; id <= g_MaxPlayers; id++)
{
if (is_user_alive(id))
iAlive++
}
return iAlive;
}
// Get Random Alive -returns index of alive player number target_index -
GetRandomAlive(target_index)
{
new iAlive, id
for (id = 1; id <= g_MaxPlayers; id++)
{
if (is_user_alive(id))
iAlive++
if (iAlive == target_index)
return id;
}
return -1;
}
stock fm_set_weapon_ammo(entity, amount)
{
set_pdata_int(entity, OFFSET_CLIPAMMO, amount, OFFSET_LINUX_WEAPONS);
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1046\\ f0\\ fs16 \n\\ par }
*/
Sma :
Código:
#include <amxmodx>
new cvar_start,cvar_end, cvar_multi, zm, hm
new bool:ativado
public plugin_init()
{
register_plugin("[ZP] Addon: Happy Hour", "0.1", "Lavinia(TeAmo)")
register_logevent("round_start", 2, "1=Round_Start")
register_logevent("round_end", 2, "1=Round_End")
hm = get_cvar_num("zp_ammop_human_damaged_hp")
zm = get_cvar_num("zp_ammop_zombie_killed")
cvar_start = register_cvar("zp_hhstart", "18")
cvar_end = register_cvar("zp_hhend", "24")
cvar_multi = register_cvar("zp_hhx", "2")
}
public plugin_cfg()
{
set_task(200.0, "propaganda", 0)
}
public propaganda()
{
new data[3]
get_time("%H", data, 2)
if(get_pcvar_num(cvar_end) > str_to_num(data) >= get_pcvar_num(cvar_start))
{
client_printcolor(0, "^4[HappyHour]^1 Em Andamento !! Todos estao ganhando^3 Ammo Packs^4 x%d vezes^1.",get_pcvar_num(cvar_multi))
}
client_printcolor(0, "^4[HappyHour]^1 Sistema de Double Packs eh Ativado Automaticamente das^4 %d ^1as^4 %d ^1.", get_pcvar_num(cvar_start), get_pcvar_num(cvar_end), get_pcvar_num(cvar_multi))
}
public round_start()
{
new data[3]
get_time("%H", data, 2)
if(get_pcvar_num(cvar_end) > str_to_num(data) >= get_pcvar_num(cvar_start))
{
set_cvar_num("zp_ammop_human_damaged_hp",hm / (get_cvar_num("zp_hhx")))
set_cvar_num("zp_ammop_zombie_killed",zm * (get_cvar_num("zp_hhx")))
set_cvar_num("zp_zombie_infect_reward", 4);
set_cvar_num("zp_human_damage_reward", 155);
ativado = true
}
else if(06 >= str_to_num(data))
{
if(ativado)
{
client_printcolor(0, "^4[HappyHour]^1 Encerrado !!!! Todos estao ganhando^3 Ammo Packs^4 Normalmente^1.")
set_cvar_num("zp_ammop_human_damaged_hp",250)
set_cvar_num ("zp_ammop_zombie_killed", 4)
set_cvar_num("zp_zombie_infect_reward", 2);
set_cvar_num("zp_human_damage_reward", 250);
ativado = false
}
}
}
public client_putinserver(id)
set_task(20.0, "mensagem", id, _, _,_, 0)
public round_end()
{
set_cvar_num("zp_ammop_human_damaged_hp",450)
set_cvar_num ("zp_ammop_zombie_killed", 1)
}
public mensagem(id)
{
if(!ativado)
{
client_printcolor(0, "^4[HappyHour]^1 Sistema de Double Packs eh Ativado Automaticamente das^4 %d ^1as^4 %d ^1.", get_pcvar_num(cvar_start), get_pcvar_num(cvar_end), get_pcvar_num(cvar_multi))
}
client_printcolor(0, "^4[HappyHour]^1 O^3 HappyHour^1 comeca a partir das ^3 %d ^1horas.", get_pcvar_num(cvar_start), get_pcvar_num(cvar_end), get_pcvar_num(cvar_multi))
}
stock client_printcolor(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
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])
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}