求:谁能发个随机彩色弹痕的插件
谁能发个随机彩色弹痕的插件。找了好久找不到。Please help me:cry:回复: 求:谁能发个随机彩色弹痕的插件
手雷拖尾,还是子弹??????????????回复: 求:谁能发个随机彩色弹痕的插件
是子弹的弹痕,以前用过现在找不到了:cold:回复: 求:谁能发个随机彩色弹痕的插件
/* AMX Mod X script.
*
* tracer_fire by jon
*
* based on war weapon tracers.
*
* latest fixes:
*- found get_user_origin mode 4, for cs only.
* this allows us to draw the tracer to where the bullet actually
* went instead of where the player was aiming.
*
* features solid, random, weapon class, and team color(s)
* and a new option to prevent player from seeing their own tracer.
*
********************************************************************************
*
* Ported By KingPin( kingpin@onexfx.com ). I take no responsibility
* for this file in any way. Use at your own risk. No warranties of any kind.
*
********************************************************************************
*
*
* TODO:
*- read default colors from a cfg or ini or something
*- save colors/mode between map changes instead of loading defaults
*/
#include <amxconst>
#include <amxmodx>
#include <amxmisc>
#include <string>
/* current version */
static const CURR_VERSION[] = "1.6"
/* mode nomenclature */
static const modenames[] = { "disabled", "uniform", "random", "weapon-class", "player-team" }
/***************** some shiz *****************/
/* color tables. */
static weap_colors
static rand_colors
/* table stores ammo count and last weapon id. */
new lastammo
new lastweap
/* cached beam sprite */
new spriteidx
/***************** more shiz *****************/
/* gamemode:
* 0 - disabled
* 1 - use nCOLOR vars for color (defaults to pink 255,0,204)
* 2 - random color from fixed table for every shot
* 3 - use weapon table for colors
* 4 - team based. CT=blue, T=red
*/
new gamemode
/* option_all
* 0 - send individual messages. player does not 'see' his/her own tracer. bots do not 'see' tracers.
* 1 - MSG_ALL every tracer.
*/
new option_all = 1
/* nCOLOR: - store rgb values for solid tracer. */
new nred
new ngreen
new nblue
/***************** still more shiz *****************/
public tracer_setmode(id, level, cid)
{
if (!cmd_access(id,level,cid,1))
return PLUGIN_HANDLED
new bool:nochange = false
new args
read_argv(1, args, 1)
if (equal(args,"0")) gamemode = 0
else if (equal(args,"1")) gamemode = 1
else if (equal(args,"2")) gamemode = 2
else if (equal(args,"3")) gamemode = 3
else if (equal(args,"4")) gamemode = 4
else nochange = true
console_print(id, "tracer mode is: %s", modenames)
// didn't change gamemode, don't display anything.
if (nochange) {
console_print(id, "usage: 'amx_tracers <0-4>' where: 0=off, 1=uniform, 2=random, 3=weapons, 4=teams")
return PLUGIN_HANDLED
}
set_hudmessage(255, 255, 255, 0.05, 0.65, 0, 0.00, 6.0, 0.01, 4.0, 3)
show_hudmessage(0, "tracer mode is: %s", modenames)
return PLUGIN_HANDLED
}
public tracer_setall(id, level, cid)
{
if (!cmd_access(id,level,cid,1))
return PLUGIN_HANDLED
new bool:nochange = false
new args
read_argv(1, args, 1)
if (equal(args,"0")) option_all = 0
else if (equal(args,"1")) option_all = 1
else nochange = true
console_print(id, "tracer option_all is: %s", ((option_all==1) ? "on" : "off"))
// didn't change option_all, don't display anything.
if (nochange) {
console_print(id, "usage: 'amx_tracers_all <0-1>' where 0=dont draw own tracer, 1=draw all tracers")
return PLUGIN_HANDLED
}
set_hudmessage(255, 255, 255, 0.05, 0.65, 0, 0.00, 6.0, 0.01, 4.0, 3)
show_hudmessage(0, "tracer option_all is: %s", ((option_all==1) ? "on" : "off"))
return PLUGIN_HANDLED
}
public tracer_setcolor(id, level, cid)
{
if (!cmd_access(id,level,cid,3))
return PLUGIN_HANDLED
new ared, agreen, ablue
new tnred, tngreen, tnblue
// get args
read_argv(1, ared, 3)
read_argv(2, agreen, 3)
read_argv(3, ablue, 3)
// convert to int
tnred = str_to_num(ared)
tngreen = str_to_num(agreen)
tnblue = str_to_num(ablue)
// check bounds
if (tnred < 0) tnred = 0
if (tngreen < 0) tngreen = 0
if (tnblue < 0) tnblue = 0
if (tnred > 255) tnred = 255
if (tngreen > 255) tngreen = 255
if (tnblue > 255) tnblue = 255
// values ok, update application
nred = tnred
ngreen = tngreen
nblue = tnblue
return PLUGIN_HANDLED
}
public draw_tracer_for(pl, pteam[], vec1, vec2, weap)
{
new rval
message_begin(((pl==0) ? MSG_ALL : MSG_ONE), SVC_TEMPENTITY, vec1, pl)
write_byte(0) // TE_BEAMPOINTS
write_coord(vec1) // start point
write_coord(vec1)
write_coord(vec1)
write_coord(vec2) // end point
write_coord(vec2)
write_coord(vec2)
write_short(spriteidx) // sprite to draw (precached below)
write_byte(0) // starting frame
write_byte(0) // frame rate
write_byte(4) // life in 0.1s
write_byte(1) // line width in 0.1u
write_byte(0) // noise in 0.1u
switch (gamemode) {
case 4: {
if (equali(pteam,"CT")) write_byte(0); else write_byte(255)
write_byte(0)
if (equali(pteam,"CT")) write_byte(255); else write_byte(0)
}
case 3: {
write_byte(weap_colors)
write_byte(weap_colors)
write_byte(weap_colors)
}
case 2: {
rval = random_num(0, 22)
write_byte(rand_colors)
write_byte(rand_colors)
write_byte(rand_colors)
}
default: {
write_byte(nred)
write_byte(ngreen)
write_byte(nblue)
}
}
write_byte(120) // brightness
write_byte(50) // scroll speed
message_end()
return PLUGIN_CONTINUE
}
public make_tracer(id)
{
if (gamemode == 0) return PLUGIN_CONTINUE
new weap = read_data(2) // id of the weapon
new ammo = read_data(3) // ammo left in clip
new pteam
new players
new i, n
get_user_team(id, pteam, 15)
/* if no lastweap is set, you'll miss the first tracer!
weap is never zero.
*/
if (lastweap == 0) { lastweap = weap; }
/* fire this event only if the ammo has changed but the weapon has not.
this prevents a tracer from being drawn when you switch from a weapon
with a larger clip to one with a smaller clip.
also, new ammo setting must be less.. otherwise a tracer is fired on reload.
*/
if ((lastammo > ammo) && (lastweap == weap)) {
new vec1, vec2
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)
vec1 -= 6
if (option_all==1)
{
// MSG_ALL
draw_tracer_for(0, pteam, vec1, vec2, weap)
}
else
{
// MSG_ONE
get_players(players, n, "c")
for(i = 0; i < n; i++)
if ((id != players) && (is_user_connected(players)))
draw_tracer_for(players, pteam, vec1, vec2, weap)
}
}
lastammo = ammo
lastweap = weap
return PLUGIN_CONTINUE
}
public plugin_init()
{
gamemode = 1
nred = 255
ngreen = 0
nblue = 204
rand_colors= {0, 255, 255} // cyan
rand_colors= {255, 0, 255} // magenta
rand_colors= {255, 255, 204}// lt yellow
rand_colors= {255, 255, 0} // yellow
rand_colors= {153, 153, 0} // dark yellow/gold
rand_colors= {204, 204, 255}// lt blue
rand_colors= {0, 0, 255} // blue
rand_colors= {0, 0, 102} // dark blue
rand_colors= {255, 204, 255}// lt purple
rand_colors= {204, 0, 204} // purple
rand_colors = {102, 0, 102} // dark purple
rand_colors = {255, 102, 102}// lt red
rand_colors = {255, 0, 0} // red
rand_colors = {102, 0, 0} // dark red
rand_colors = {0, 255, 0} // lt green
rand_colors = {0, 153, 0} // green
rand_colors = {0, 102, 0} // dark green
rand_colors = {255, 204, 153}// lt orange
rand_colors = {255, 153, 0} // orange
rand_colors = {153, 102, 0} // brown
rand_colors = {102, 102, 102}// gray
rand_colors = {204, 204, 204}// lt gray
rand_colors = {255, 255, 255}// white
weap_colors = { 0, 0, 255 } // blue
weap_colors = { 0, 0, 255 }
weap_colors = { 0, 0, 255 }
weap_colors = { 0, 0, 255 }
weap_colors = { 0, 0, 255 }
weap_colors = { 0, 0, 255 }
weap_colors = { 255, 255, 0 } // yellow
weap_colors = { 255, 255, 0 }
weap_colors = { 255, 153, 0 } // orange
weap_colors = { 255, 153, 0 }
weap_colors = { 255, 153, 0 }
weap_colors = { 255, 153, 0 }
weap_colors = { 255, 153, 0 }
weap_colors = { 102, 0, 0 } // dark red
weap_colors = { 102, 0, 0 }
weap_colors = { 102, 0, 0 }
weap_colors = { 102, 0, 0 }
weap_colors = { 102, 0, 0 }
weap_colors = { 102, 0, 0 }
weap_colors = { 102, 102, 102 } // lt gray
weap_colors = { 204, 204, 204 } // gray
weap_colors = { 0, 255, 0 } // lt green
register_concmd("amx_tracers", "tracer_setmode", ADMIN_LEVEL_B, "<0-4> - 0:off,1:uniform,2:random,3:weapons,4:teams")
register_concmd("amx_tracers_all", "tracer_setall", ADMIN_LEVEL_B, "<0-1> - 0:dont draw own tracer,1:draw all tracers")
register_concmd("amx_tracers_colors", "tracer_setcolor", ADMIN_LEVEL_B, "<0-255> <0-255> <0-255> - RGB color values")
register_plugin("tracer_fire", CURR_VERSION, "jon")
register_event("CurWeapon", "make_tracer", "be", "1=1", "3>0")
return PLUGIN_CONTINUE
}
public plugin_precache()
{
spriteidx = precache_model("sprites/laserbeam.spr");
return PLUGIN_CONTINUE
}
回复: 求:谁能发个随机彩色弹痕的插件
哦,学到了获取弹点位置 origin 方法,谢谢回复: 求:谁能发个随机彩色弹痕的插件
谢谢,辛苦了:burn:回复: 求:谁能发个随机彩色弹痕的插件
但是,请问怎么用啊:sweat:
页:
[1]