Quem pode me ajudar, a fazer uma include que fassa um tutorial ai ou se preferir fassa pra mim nessa pra que eu possa entender oque foi modificado
- Código:
/*===========================================================================================================
[Modo Turbooo! Max Steel]
* Modo Max Steel novas coisas
* Plugin Editado Por: [D]etonado[R] & [P]erfec[T] [S]cr[@]s[H]
=============================================================================================================*/
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include < fun >
#include <fakemeta>
#include <fakemeta_util>
#include <zombieplague>
#include <fakemeta_util>
#include <maxsteel>
#define PLUGIN "[ZP Max Steel] "
#define VERSION "1.0"
#define AUTHOR "[D]etonado[R] & [P]erfec[T] [S]cr[@]s[H]"
// 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_itemid, g_maxs_selected[33], cvar_maxs_cost, cvar_maxs_armor, cvar_maxs_hp, cvar_maxs_speed, cvar_maxs_delay, cvar_maxs_power_time, gTrail,new g_itemid, g_armalaser_selected[33], cvar_armalaser_cost, cvar_armalaser_dmg, cvar_alien_x_armor, cvar_armalaser_hp, cvar_armalaser_uclip, cvar_armalaser_tracer, bullets[33], m_spriteTexture, new cvar_red, cvar_green, cvar_blue i_cooldown_time[33]
new g_speeded[33] = 0
new g_abil_one_used[33] = 0
new Float:g_normspeed = 300.0
new const sound_maxs_sprint[] = "zombie_plague/maxsteel_mode_sounds/sprint.wav"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("ability1", "use_ability_one")
register_concmd("ability1", "use_ability_one")
register_clcmd("say /binds", "mostrar_binds")
register_clcmd("say binds", "mostrar_binds")
register_clcmd("say .binds", "mostrar_binds")
register_forward( FM_PlayerPreThink, "client_prethink" )
register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
register_event("CurWeapon", "make_tracer", "be", "1=1", "3>0")
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
register_message(get_user_msgid("CurWeapon"), "message_cur_weapon")
cvar_maxs_cost= register_cvar("zp_maxsteel_maxs_cost", "60") // Preço do Modo Turbooo
cvar_maxs_armor = register_cvar("zp_maxsteel_maxs_armor", "75") // Quantidade de Colete do Modo Turbooo
cvar_maxs_hp = register_cvar("zp_maxsteel_maxs_hp", "210") // Quantidade de Vida do Modo Turbooo
cvar_maxs_speed = register_cvar("zp_maxsteel_maxs_power_speed", "1000.0") // Velocidade do Modo Turboo ao usar a Habilidade
cvar_maxs_delay = register_cvar("zp_maxsteel_maxs_power_cooldown", "10") // Tempo Para usar o Poder Novamente
cvar_maxs_power_time = register_cvar("zp_maxsteel_maxs_power_duration", "5") // Tempo Que o Poder De Correr Dura
cvar_armalaser_cost= register_cvar("zp_armalaser_cost", "100") // Preço da arma de laser
cvar_armalaser_tracer = register_cvar("zp_armalaser_rastro", "1") // Rastro do da arma de Laser (0 - Desligado | 1 - Ligado)
cvar_armalaser_dmg = register_cvar("zp_armalaserbullets_dmg", "4.0") // Dmg dos tiros da Laser
cvar_armalaser_armor = register_cvar("zp_armalaser_armor", "200") // Quantidade de Colete da Arma Laser
cvar_armalaser_hp = register_cvar("zp_armalaser_hp", "700") // Quantidade de Vida da Arma de Laser
cvar_armalaser_uclip = register_cvar("zp_armalaser_uclip", "1") // Bala Infinita Da arma de Laser (0 - Desligado | 1 - Ligado)
cvar_red = register_cvar ("zp_maxs_glow_R", "000")
cvar_green = register_cvar ("zp_maxs_glow_G", "255")
cvar_blue = register_cvar ("zp_maxs_glow_B", "0")
g_itemid = maxsteel_register_alien("Modo Turbooo", "Pode Correr Muito Rapido", get_pcvar_num(cvar_maxs_cost), MAXSTEEL_TEAM_HUMAN)
g_itemid = maxsteel_register_alien("Arma De Laser", "Tem muito danos nas armas + Bala infinita", get_pcvar_num(cvar_maxsteel_armalaser_cost), BEN10_TEAM_HUMAN)
}
public plugin_precache()
{
// Os esquemas do maxs
precache_sound(sound_maxs_sprint)
gTrail = precache_model( "sprites/smoke.spr" )
// Rastro da Bala
m_spriteTexture = precache_model("sprites/dot.spr")
}
/*=========================================================================
[Prevenções de Bugs]
==========================================================================*/
public event_round_start()
{
for(new id = 1; id <= get_maxplayers(); id++)
{
g_armalaser_selected[id] = false
}
}
public client_connect(id)
{
g_armalaser_selected[id] = false
}
public client_disconnect(id)
{
g_armalaser_selected[id] = false
}
public zp_user_infected_post(id)
{
g_armalaser_selected[id] = false
}
public zp_user_infected_pre(id)
{
g_armalaser_selected[id] = false
}
public zp_user_humanized_post(id)
{
g_armalaser_selected[id] = false
}
public zp_user_humanized_pre(id)
{
g_armalaser_selected[id] = false
}
public maxsteel_armalaser_selected(id, itemid)
{
/*===============================================================================
[Bala Infinita da Arma de Laser]
================================================================================*/
public message_cur_weapon(msg_id, msg_dest, msg_entity)
{
if(get_pcvar_num(cvar_armalaser_uclip))
{
// Player doesn't have the unlimited clip upgrade
if (!g_armalaser_selected[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])
}
}
}
}
if(itemid == g_itemid)
{
new name[32]
g_alienX_selected[id] = true
fm_set_user_armor(id, get_user_armor(id) + get_pcvar_num(cvar_armalaser_armor))
fm_set_user_health(id, get_user_health(id) + get_pcvar_num(cvar_armalaser_hp))
client_printcolor(id, "/g[ZP]/t Voce possui uma arma de laser. MUHUHUHUH !!!")
client_printcolor(id, "/g[ZP] PODER: /tDano /g%dX/t de Todas As Armas /y|/g HP: /t%d /y|/g COLETE: /t%d",get_pcvar_num(cvar_alien_x_dmg), get_pcvar_num(cvar_alien_x_hp), get_pcvar_num(cvar_alien_x_armor))
client_printcolor(id, "/g[ZP] /tVisite:/g zplague.forumeiro.com/y ||/t Plugin Criado Por:/g [D]etonado[R] & [P]erfec[T] [S]cr[@]s[H]")
set_hudmessage(127, 132, 124, -1.0, 0.17, 1, 0.0, 5.0, 1.0, 1.0, -1)
get_user_name(id, name, 31)
show_hudmessage(0, "FUDEU !!!!!^nO Jogador %s Recebeu uma arma de laser, fuja-se zms !!!", name)
}
}
/*===============================================================================
[O Poder e o Rastro da Arma de Laser]
================================================================================*/
public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
{
if (is_user_connected(attacker) && g_armalaser_selected[attacker])
{
SetHamParamFloat(4, damage * get_pcvar_float(cvar_armalaser_dmg))
}
}
public make_tracer(id)
{
if (get_pcvar_num(cvar_armalaser_tracer))
{
new clip
new pteam[16]
new buttons = pev(id, pev_button)
new oldbuttons = pev(id, pev_oldbuttons)
new vec1[3], vec2[3]
get_user_origin(id, vec1, 1) // origin; your camera point.
get_user_origin(id, vec2, 4) // termina; where your bullet goes (4 is cs-only)
get_user_team(id, pteam, 15)
if(buttons & IN_ATTACK || oldbuttons & IN_ATTACK)
{
if(g_alienX_selected[id])
{
//BEAMENTPOINTS
message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
write_byte (0) //TE_BEAMENTPOINTS 0
write_coord(vec1[0])
write_coord(vec1[1])
write_coord(vec1[2])
write_coord(vec2[0])
write_coord(vec2[1])
write_coord(vec2[2])
write_short( m_spriteTexture )
write_byte(1) // framestart
write_byte(5) // framerate
write_byte(2) // life
write_byte(10) // width
write_byte(0) // noise
write_byte(255) // r, g, b
write_byte(255) // r, g, b
write_byte(255) // r, g, b
write_byte(200) // brightness
write_byte(150) // speed
message_end()
}
bullets[id] = clip
}
}
}
public event_round_start()
{
for(new id = 1; id <= get_maxplayers(); id++)
{
g_maxs_selected[id] = false
i_cooldown_time[id] = floatround(get_pcvar_float(cvar_maxs_delay))
g_abil_one_used[id] = 0
g_speeded[id] = 0
remove_task(id)
}
}
public maxsteel_alien_selected(id, itemid)
{
if(itemid == g_itemid)
{
new name[32]
g_maxs_selected[id] = true
fm_set_user_armor(id, get_user_armor(id) + get_pcvar_num(cvar_maxs_armor))
fm_set_user_health(id, get_user_health(id) + get_pcvar_num(cvar_maxs_hp))
client_printcolor(id, "/g[ZP]/t Voce Comecou o /gModo Turbooo!!!")
client_printcolor(id, "/g[ZP] PODER: /tPressione /gF1/t Para Correr Muito Rapido /y|/g HP: /t%d /y|/g COLETE: /t%d", get_pcvar_num(cvar_maxs_hp), get_pcvar_num(cvar_maxs_armor))
client_printcolor(id, "/g[ZP] /tVisite:/g zplague.forumeiro.com/y ||/t Plugin Criado Por:/g [D]etonado[R] & [P]erfec[T] [S]cr[@]s[H]")
client_cmd(id, "bind F1 ability1")
i_cooldown_time[id] = floatround(get_pcvar_float(cvar_maxs_delay))
remove_task(id)
g_speeded[id] = 0
g_abil_one_used[id] = 0
set_hudmessage(0, 0, 255, -1.0, 0.17, 1, 0.0, 5.0, 1.0, 1.0, -1)
get_user_name(id, name, 31)
show_hudmessage(0, "O Jogador %s Comecou o Modo Turbooo Fuja-se zms HUAHUA!!!", name)
fm_set_rendering(id, kRenderFxGlowShell, (cvar_red), (cvar_green), (cvar_blue), kRenderNormal, 16);
}
}
/*===============================================================================
[O Poder do Modo Turboo]
=================================================================================*/
public client_prethink(id)
{
if (g_maxs_selected[id])
{
if(is_user_alive(id) && !zp_get_user_zombie(id))
Action(id);
}
}
public Action(id)
{
if (g_speeded[id] == 1)
{
set_user_maxspeed(id , get_pcvar_float(cvar_maxs_speed));
}
else
{
set_user_maxspeed(id , g_normspeed);
}
return PLUGIN_HANDLED;
}
public ShowHUD(id)
{
if(is_user_alive(id))
{
i_cooldown_time[id] = i_cooldown_time[id] - 1;
set_hudmessage(0, 100, 255, -1.0, -1.0, 0, 1.0, 1.1, 0.0, 0.0, -1)
show_hudmessage(id, "Aguarde %d Para usar Seu poder novamente",i_cooldown_time[id])
}else{
remove_task(id)
}
}
public use_ability_one(id)
{
if (is_user_alive(id) && g_maxs_selected[id])
{
if(g_abil_one_used[id] == 0)
{
client_cmd(id,"cl_forwardspeed 1600")
client_cmd(id,"cl_sidespeed 1600")
client_cmd(id,"cl_backspeed 1600")
set_cvar_num("sv_maxspeed", 9999)
message_begin (MSG_BROADCAST,SVC_TEMPENTITY)
write_byte (TE_BEAMFOLLOW)
write_short (id)
write_short (gTrail)
write_byte (2)
write_byte (10)
write_byte (0)
write_byte (0)
write_byte (255)
write_byte (220)
message_end()
g_speeded[id] = 1
emit_sound(id, CHAN_STREAM, sound_maxs_sprint, 1.0, ATTN_NORM, 0, PITCH_NORM)
g_abil_one_used[id] = 1
set_task(get_pcvar_float(cvar_maxs_power_time),"set_normal_speed",id)
i_cooldown_time[id] = floatround(get_pcvar_float(cvar_maxs_delay))
set_task(1.0, "ShowHUD", id, _, _, "a",i_cooldown_time[id])
}
}
}
public set_normal_speed(id)
{
if (g_maxs_selected[id])
{
g_speeded[id] = 0
client_cmd(id,"cl_forwardspeed 400")
client_cmd(id,"cl_sidespeed 400")
client_cmd(id,"cl_backspeed 400")
set_task(get_pcvar_float(cvar_maxs_delay),"set_ability_one_cooldown",id)
}
}
public set_ability_one_cooldown(id)
{
if (g_maxs_selected[id])
{
g_abil_one_used[id] = 0
client_printcolor(id, "/g[ZP]/t Sua Habilidade de Correr do /gModo Turbooo/t Esta pronta Novamente. /g[Pressione F1 Para Correr Novamente]")
}
}
/*===============================================================================
[Ação do Comando /binds]
================================================================================*/
public mostrar_binds(id)
{
client_printcolor(id, "/g[Max Steel]/y Bind Do :Modo Turbooo /tbind (tecla) ability1")
}
/*===============================================================================
[Mensagem Colorida (client_printcolor)]
=================================================================================*/
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") // Chat Verde
replace_all(msg, 190, "/y", "^1") // Chat Normal
replace_all(msg, 190, "/t", "^3") // Chat Do Time Tr=Vermelho Ct=Azul Spec=Branco
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();
}
}
}
}