Como diz o titulo se alguém pode me passa agradeço
GeForce9876 escreveu:Gente esse plugin uma vez eu achei pra DK faz 2 anos,tem la na AlliedModders,ta aki o link.
https://forums.alliedmods.net/showthread.php?t=115839
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)
set_hudmessage(255, 100, 255, -1.0, -1.0, 0, 6.0, 5.0)
show_hudmessage(id, "O Soteio de Bala infinita^nSera Feito em %d segundos", get_pcvar_num(cvar_delay))
}
}
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, 100, 255, -1.0, -1.0, 0, 6.0, 5.0)
show_hudmessage(id, "O Jogador %s Ganhou Bala Infinita^nNo Sorteio", name)
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);
}
|
|