Descriere:
Pluginul original a fost facut pentru grenazi, dar acesta este pentru arme.
Cu acest plugin pe server-ul dvs., atunci cand aruncati o arma, aceasta va lasa in urma ei o dara/urma/ colorata.
Daca arma este aruncata de buna voi (g) culoarea este aleatorie/random/la intamplare.
Daca arma este arunca atunci cand muriti, culoarea este rosie pentru terro si albastra pentru ct.
Cand arma atinge pamantul, se formeaza un efect de lumina in jurul acesteia. (cvar)
Cand arma este arunca, velocitatea acesteia este schimbata iar aceasta o ia in alta parte (cvar)
sursa:
- | Afiseaza codul
#include <amxmodx>
#include <fakemeta>
#define PLUGIN "Weapon Trail"
#define VERSION "2.0"
#define AUTHOR "anakin_cstrike"
#define MAX_PLAYERS 32
#define OFFSET_ENT_TO_INDEX 43
enum droptype
{
droptype_manual,
droptype_ondeath
}
new
toggle,light,vel,g_max_clients,g_max_entities;
new const g_drop[] = "drop";
new const g_wbox_class[] = "weaponbox";
new const g_wbox_model[] = "models/w_weaponbox.mdl";
new const g_wbox_model_prefix[] = "models/w_";
new const g_start_client_index = 1;
new g_command[MAX_PLAYERS + 1][sizeof g_drop + 1];
new g_trail,r,g,b;
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_forward(FM_SetModel, "fw_setmodel");
register_forward(FM_Touch,"fw_touch");
toggle = register_cvar("weapontrail","1");
light = register_cvar("weapontrail_light","1");
vel = register_cvar("weapontrail_vel","1");
g_max_clients = global_get(glb_maxClients);
g_max_entities = global_get(glb_maxEntities);
}
public plugin_precache()
g_trail = precache_model("sprites/smoke.spr");
public client_command(id)
read_argv(0, g_command[id], sizeof g_drop);
public fw_setmodel(ent, const model[])
{
if(get_pcvar_num(toggle) != 1)
return FMRES_IGNORED;
if(!pev_valid(ent) || !equal(model, g_wbox_model_prefix, sizeof g_wbox_model_prefix - 1) || equal(model, g_wbox_model))
return FMRES_IGNORED;
new id = pev(ent, pev_owner)
if(!(g_start_client_index <= id <= g_max_clients))
return FMRES_IGNORED;
static class[32],i;
pev(ent,pev_classname,class, sizeof class - 1)
if(!equal(class,g_wbox_class))
return FMRES_IGNORED;
for(i = g_max_clients + 1;i < g_max_entities;++i)
{
if(!pev_valid(i) || ent != pev(i, pev_owner))
continue;
new wid = get_pdata_int(i,OFFSET_ENT_TO_INDEX);
if(wid != CSW_C4)
{
new droptype:drop_type;
if(!is_user_alive(id))
drop_type = droptype_ondeath;
else if(equal(g_command[id], g_drop))
drop_type = droptype_manual;
else
return FMRES_IGNORED;
switch(drop_type)
{
case droptype_ondeath: {
if(get_user_team(id) == 1){r=255;g=0;b=0;}
else if(get_user_team(id) == 2){r=0;g=0;b=255;}
}
case droptype_manual: {
r = random(255);
g = random(255);
b = random(255);
}
}
if(get_pcvar_num(vel) == 1)
{
new Float:vel[3];
vel[0] = float(random(300));
vel[1] = float(random(300));
vel[2] = float(random(300));
set_pev(ent,pev_velocity,vel);
}
message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
write_byte(TE_BEAMFOLLOW);
write_short(ent);
write_short(g_trail);
write_byte(5);
write_byte(5);
write_byte(r);
write_byte(g);
write_byte(b);
write_byte(195);
message_end();
}
}
return FMRES_IGNORED;
}
public fw_touch(touched, toucher)
{
if(get_pcvar_num(toggle) != 1)
return FMRES_IGNORED;
if(get_pcvar_num(light) != 1)
return FMRES_IGNORED;
static class[32];
pev(toucher, pev_classname, class, sizeof class - 1);
if(containi(class, "weapon") != -1 && !touched)
{
new Float:origin[3];
pev(toucher, pev_origin, origin);
message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
write_byte(TE_DLIGHT);
write_coord(floatround(origin[0]));
write_coord(floatround(origin[1]));
write_coord(floatround(origin[2]));
write_byte(20);
write_byte(r);
write_byte(g);
write_byte(b);
write_byte(5);
write_byte(20);
message_end();
}
return FMRES_IGNORED;
}
Descarcare:
Click!
Link oficial:
Click!
Nume: Weapon Trail
Autor: anakin_cstrike
Versiune: 2.0
Schimbare
[2.0]
- am schimbat cvar-ul general si am adaugat inca 2 cvar-uri
- am adaugat optiune de efect de lumina
- am adaugat optiune de schimbare velocitate la arme
[1.0]
- prima publicare
Credite:
* VEN - pentru functiile de la drop
* Alka - modifcare adusa forwar-ului Touched + idee schimbare velocitate
Instalare:
1. Fisierul
WeaponTrail.sma il puneti in
addons/amxmodx/scripting
2. Fisierul
WeaponTrail.amxx il puneti in
addons/amxmodx/plugins
3. Intrati in fisierul
addons/amxmodx/configs/plugins.ini si adaugati la urma:
Cvars:
weapontrail 1/0 - activat/dezactivat (default 1)
weapontrail_light 1/0 - activeaza/dezactiveaza lumina la contact cu pamantul (default 1)
weapontrail_vel 1/0 - activeaza/dezactiveaza schimbare velocitate (default 1)
Module: Fakemeta
Imagini: Multumesc lui Scorpions