Venho posta esse plugin,por quer parei com cs,addons,plugin,etc... intão resolvir posta esse plugin para todos da zplague e quero quer todos use ele
#Obrigado Pela Ajuda Perfect & Odair
SMA:
Include
Models,Sounds Vcs acha-o por ai
Bom Aproveito ^^
#Obrigado Pela Ajuda Perfect & Odair
SMA:
Código:
/*==================================================================================================
* Includes
==================================================================================================*/
#include <amxmodx>
#include <zombieplague>
#include <fakemeta_util>
#include <engine>
#include <SupplyBox>
/*==================================================================================================
* Defines
* Cvars
==================================================================================================*/
#define PLUGIN "[ZP] SupplyBox Puladora"
#define VERSION "1.0"
#define AUTHOR "Dexter"
#define FLAG_ACESS ADMIN_LEVEL_V
new Menu_SB, Rastro_Puladora
new g_supplybox_count
new cvar_limit_box
new const item_class_name[] = "SB_Puladora"
new g_models[][] = {"models/[ZP]Evento/[ZP]SupplyBox.mdl"}
new g_sound[] = {"supplybox.wav"}
/*==================================================================================================
* Precache
==================================================================================================*/
public plugin_precache()
{
for (new i = 0; i < sizeof g_models; i++)
precache_model(g_models[i])
precache_sound(g_sound)
Rastro_Puladora = precache_model( "sprites/smoke.spr" )
}
/*==================================================================================================
* Registro do Plugin
==================================================================================================*/
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_forward(FM_Touch, "fwd_Touch")
register_logevent("logevent_round_start", 2, "1=Round_Start")
register_clcmd("say /menubox", "SB_Puladora", FLAG_ACESS, "SupplyBox Puladora")
cvar_limit_box = register_cvar("zp_sb_puladora_limite", "25")
Menu_SB = menu_create("\r-= \dMenu SupplyBox Puladora \r=-","menu_item")
menu_additem(Menu_SB, "\r-= \dAdicionar SupplyBox \r=-", "1")
menu_additem(Menu_SB, "\r-= \dDeleta SupplyBox \r=-", "2")
}
/*==================================================================================================
* Pra não haver BUGS
==================================================================================================*/
public zp_round_started()
{
new ent = FM_NULLENT
static string_class[] = "classname"
while ((ent = engfunc(EngFunc_FindEntityByString, ent, string_class, item_class_name)))
set_pev(ent, pev_flags, FL_KILLME)
g_supplybox_count = 0
remove_task()
}
public zp_round_ended()
{
new ent = FM_NULLENT
static string_class[] = "classname"
while ((ent = engfunc(EngFunc_FindEntityByString, ent, string_class, item_class_name)))
set_pev(ent, pev_flags, FL_KILLME)
g_supplybox_count = 0
remove_task()
}
/*==================================================================================================
* Bang Do Menu
==================================================================================================*/
public SB_Puladora(id)
{
if(get_user_flags(id) & FLAG_ACESS)
{
menu_display(id, Menu_SB, 0)
return PLUGIN_HANDLED
}
else
{
client_printcolor(id, "!g[PROTECAO]!t Voce Nao Pode Te Acesso a Este !yMenu !tApenas !g FUNDADORES")
}
return PLUGIN_CONTINUE
}
/*==================================================================================================
* Ira aparece todo round
==================================================================================================*/
public logevent_round_start()
client_printcolor(0, "!y-= !tSupplyBox Puladora BY !gDexter.!y -=")
/*==================================================================================================
* Menu
==================================================================================================*/
public menu_item(id, menu, item)
{
if( item < 0 )
return PLUGIN_CONTINUE
new cmd[3]
new maccess, callback
menu_item_getinfo(menu, item, maccess, cmd,2,_,_, callback)
new iChoice = str_to_num(cmd)
switch(iChoice)
{
case 1:
{
if(g_supplybox_count >= get_pcvar_num(cvar_limit_box))
{
client_printcolor(id, "!g[ANT BUG]!t Maximo De Box No MAPA")
return PLUGIN_CONTINUE
}
new origin[3]
get_user_origin(id, origin, 3)
add_box(origin)
}
case 2:
del_box()
}
menu_display(id, Menu_SB, 0)
return PLUGIN_CONTINUE
}
/*==================================================================================================
* Quanta Box No Mapa
==================================================================================================*/
public show_supplybox_count()
{
set_hudmessage(255, 255, 255, -1.0, -1.0, 1, 0.0, 5.0, 1.0, 1.0, -1)
show_hudmessage(0, "SupplyBox No Mapa: ^n[%d]", g_supplybox_count)
set_task(0.1,"show_supplybox_count")
}
/*==================================================================================================
* ADD A Box
==================================================================================================*/
public add_box(origin[3])
{
set_hudmessage(0, 255, 0, -1.0, 0.17, 1, 0.0, 5.0, 1.0, 1.0, -1)
show_hudmessage(0, "[SupplyBox Puladora] Evento Comeco")
new ent = fm_create_entity("info_target")
set_pev(ent, pev_classname, item_class_name)
engfunc(EngFunc_SetModel,ent, g_models[random_num(0, sizeof g_models - 1)])
set_pev(ent,pev_mins,Float:{-10.0,-10.0,0.0})
set_pev(ent,pev_maxs,Float:{10.0,10.0,25.0})
set_pev(ent,pev_size,Float:{-10.0,-10.0,0.0,10.0,10.0,25.0})
engfunc(EngFunc_SetSize,ent,Float:{-10.0,-10.0,0.0},Float:{10.0,10.0,25.0})
set_pev(ent,pev_solid,SOLID_BBOX)
set_pev(ent,pev_movetype, MOVETYPE_BOUNCE)
g_supplybox_count++
new Float:fOrigin[3]
IVecFVec(origin, fOrigin)
set_pev(ent, pev_origin, fOrigin)
new Float:fAim[3] , Float:fVelocity[3];
VelocityByAim(ent , 99999 , fAim);
fVelocity[0] = fAim[0];
fVelocity[1] = fAim[1];
fVelocity[2] = fAim[2];
message_begin (MSG_BROADCAST,SVC_TEMPENTITY)
write_byte (TE_BEAMFOLLOW)
write_short (ent)
write_short (Rastro_Puladora)
write_byte (2)
write_byte (13)
write_byte (255)
write_byte (255)
write_byte (255)
write_byte (999)
message_end()
set_user_velocity(ent , fVelocity);
set_pev(ent,pev_renderfx,kRenderFxGlowShell)
set_task(0.1,"show_supplybox_count")
set_task(0.1,"creditos")
set_pev(ent,pev_rendercolor,Float:{255.255,255.255,255.255})
}
/*==================================================================================================
* Remover A Box
==================================================================================================*/
public del_box()
{
set_hudmessage(0, 255, 0, -1.0, 0.17, 1, 0.0, 5.0, 1.0, 1.0, -1)
show_hudmessage(0, "[SupplyBox Puladora] As SupplyBox Foram Deletada")
remove_task()
new ent = FM_NULLENT
static string_class[] = "classname"
while ((ent = engfunc(EngFunc_FindEntityByString, ent, string_class, item_class_name)))
set_pev(ent, pev_flags, FL_KILLME)
g_supplybox_count = 0
}
/*==================================================================================================
* Creditos
==================================================================================================*/
public creditos()
{
set_hudmessage(0, 0, 255, -1.0, 0.89, 1, 0.0, 5.0, 1.0, 1.0, -1)
show_hudmessage(0, "SupplyBox Pulador BY:Dexter")
set_task(0.1,"creditos")
}
/*==================================================================================================
* Pra pode pega a box e mais bangs
==================================================================================================*/
public fwd_Touch(toucher, touched)
{
if (!is_user_alive(toucher) || !pev_valid(touched))
return FMRES_IGNORED
new classname[32]
pev(touched, pev_classname, classname, 31)
if (!equal(classname, item_class_name))
return FMRES_IGNORED
give_item(toucher)
set_pev(touched, pev_effects, EF_NODRAW)
set_pev(touched, pev_solid, SOLID_NOT)
emit_sound(toucher, CHAN_AUTO, g_sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
return FMRES_IGNORED
}
/*==================================================================================================
* Quando pega a box
==================================================================================================*/
public give_item(id)
{
new ap_quantity
ap_quantity = random_num(0,350)
zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) + ap_quantity)
client_printcolor(id, "!g[SupplyBox Puladora]!t Ganhou !g%d!t Pack Por Pega A SupplyBox", ap_quantity)
g_supplybox_count--
}
/*==================================================================================================
* Stocks
==================================================================================================*/
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();
}
}
}
}
Include
Código:
#if defined _SupplyBox_included
#endinput
#endif
#define _SupplyBox_included
#define ADMIN_LEVEL_V (1<<21) /* flag "v" */
Models,Sounds Vcs acha-o por ai
Bom Aproveito ^^