|
楼主 |
发表于 2007-1-17 03:02:22
|
显示全部楼层
来自 中国–天津–天津
回复: 关于人物发光
- public plugin_init() {
- mode = 3
- register_plugin("Grentrail","1.3","AssKicR")
- register_event("SendAudio","FireInTheHole","bc")
- register_concmd("amx_trail", "admin_trail", ADMIN_LEVEL_B, "<0-4> - 0:off,1:all,2:random,3:team")
-
- }
- public admin_trail(id, level, cid){
- if (!cmd_access(id,level,cid,1))
- return PLUGIN_HANDLED
- new args[2]
- read_argv(1, args, 1)
-
- if (equal(args,"?")) {
- console_print(id,"amx_trail 0 or 1 or 2 or 3")
- return PLUGIN_HANDLED
- }
-
- mode = str_to_num(args)
- return PLUGIN_HANDLED
-
- }
- public plugin_precache() {
- m_iTrail = precache_model("sprites/smoke.spr")
- }
- public FireInTheHole(id) {
- if(mode == 0) return PLUGIN_HANDLED
- set_task(0.1, "grenid", id)
- return PLUGIN_HANDLED
- }
- public grenid(id){
- new grenadeid = get_grenade(id)
-
- if (!grenadeid) return PLUGIN_HANDLED // no model
-
- message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
- write_byte( TE_BEAMFOLLOW )
- write_short(grenadeid) // entity
- write_short(m_iTrail) // model
- write_byte( 20 ) // life
- write_byte( 5 ) // width
-
- switch (mode) {
- case 1: {
- write_byte( 255 ) // r, g, b
- write_byte( 255 ) // r, g, b
- write_byte( 0 ) // r, g, b
- }
- case 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
- }
- case 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( 255 ) // r, g, b
- write_byte( 0 ) // r, g, b
- }
- }
- default:{
- write_byte( 0 ) // r, g, b
- write_byte( 0 ) // r, g, b
- write_byte( 0 ) // r, g, b
- }
- }
-
- write_byte( 192 ) // brightness
-
- message_end() // move PHS/PVS data sending into here (SEND_ALL, SEND_PVS, SEND_PHS)
-
- return PLUGIN_HANDLED
- }
-
复制代码 这个是我改的一个手雷拖尾插件,问题是当我和bot打时只有我的手雷有尾巴,电脑的没有,我不知道怎么才能让bot的手雷也有效果,请指教。
这个get_grenade(id)函数我在论坛的amx函数查询器里找不到,但是amx认,请问他是那个inc文件的。
有没有一个函数可以查到手雷的种类闪的、炸得、烟的。
代码没有完全看到没有关系因为看不到的只是message_begin(MSG_BROADCAST,SVC_TEMPENTITY)、write_byte之类的。 |
|