明天试一下能不能该,今天已经太晚了,我还要上学耶!
我明天还要考english!!!! 麻烦大家了 所有的雷都有轨迹的代码如下:(在amxx下通过)
#include <amxmodx>
#include <engine>
/*
The cvar is controlled like this
sv_grentrail 0 = No Grentrail
sv_grentrail 1 = All Green Trails
sv_grentrail 2 = Random Colors
sv_grentrail 3 = Team Specific (Tested In CS...)
*/
#define TE_BEAMFOLLOW 22
//new const HEGRENADE_MODEL[] = "models/w_hegrenade.mdl"
new m_iTrail
public plugin_init()
{
register_plugin("Grentrail","1.2","AssKicR")
register_event("TextMsg","TextMsg","b","2&#Game_radio", "4&#Fire_in_the_hole")
register_cvar("sv_grentrail","0")
}
public plugin_precache() {
m_iTrail = precache_model("sprites/smoke.spr")
}
public TextMsg()
{
if(get_cvar_num("sv_grentrail") == 0)
return PLUGIN_HANDLED
new name
read_data(3, name, 31)
new id = get_user_index(name)
set_task(1.0, "grenid", id)
return PLUGIN_HANDLED
}
public grenid(id){
new string, grenadeid = 0
grenadeid = get_grenade(id)
entity_get_string(grenadeid,EV_SZ_model,string,31)
if (grenadeid) { /* && equali(HEGRENADE_MODEL,string)*/
message_begin( MSG_BROADCAST, SVC_TEMPENTITY )
write_byte( TE_BEAMFOLLOW )
write_short(grenadeid) // entity
write_short(m_iTrail)// model
write_byte( 10 ) // life
write_byte( 5 ) // width
if (get_cvar_num("sv_grentrail")==1) {
write_byte( 0 ) // r, g, b
write_byte( 255 ) // r, g, b
write_byte( 0 ) // r, g, b
}
else if (get_cvar_num("sv_grentrail")==2)
{
new red = random_num(0,255)
new green = random_num(0,255)
new blue = random_num(0,255)
write_byte( red ) // r, g, b
write_byte( green ) // r, g, b
write_byte( blue ) // r, g, b
}
else if (get_cvar_num("sv_grentrail")==3)
{
if (get_user_team(id)==1) // Terrorist
{
write_byte( 255 ) // r, g, b
write_byte( 0 ) // r, g, b
write_byte( 0 ) // r, g, b
}
else // Counter-Terrorist
{
write_byte( 0 ) // r, g, b
write_byte( 0 ) // r, g, b
write_byte( 255 ) // r, g, b
}
}
else
{
write_byte( 0 ) // r, g, b
write_byte( 0 ) // r, g, b
write_byte( 0 ) // r, g, b
}
switch (random_num(0,2))
{
case 0:write_byte( 64 ) // brightness
case 1:write_byte( 128 ) // brightness
case 2:write_byte( 192 ) // brightness
}
message_end() // move PHS/PVS data sending into here (SEND_ALL, SEND_PVS, SEND_PHS)
}
} 谢谢,我去试试 的确可以用~不过要雷仍出半天后才有轨迹,都是绿色的 amx0.98下编译不成功!!!!!!!!!!!!!!
楼上的应该看清楚
该插件是可以设置的,你可以设置成第3模式,就是随机颜色
页:
1
[2]