|
发表于 2005-2-17 01:14:18
|
显示全部楼层
来自 中国–广西
呵呵~~看见难得的好贴了!
我改了一个,想用于CS1.5用的,但是有三处错误,能帮指教一下吗?
) return PLUGIN_HANDLED
slay_player(id,player,type)
}
return PLUGIN_HANDLED
}
explode(vec1[3]) {
// blast circles
message_begin( MSG_BROADCAST,SVC_TEMPENTITY,vec1)
write_byte( 21 )
write_coord(vec1[0])
write_coord(vec1[1])
write_coord(vec1[2] + 16)
write_coord(vec1[0])
write_coord(vec1[1])
write_coord(vec1[2] + 1936)
write_short( s2white )
write_byte( 0 ) // startframe
write_byte( 0 ) // framerate
write_byte( 2 ) // life
write_byte( 16 ) // width
write_byte( 0 ) // noise
write_byte( 188 ) // r
write_byte( 220 ) // g
write_byte( 255 ) // b
write_byte( 255 ) //brightness
write_byte( 0 ) // speed
message_end()
//Explosion2
message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
write_byte( 12 )
write_coord(vec1[0])
write_coord(vec1[1])
write_coord(vec1[2])
write_byte( 188 ) // byte (scale in 0.1's)
write_byte( 10 ) // byte (framerate)
message_end()
//s2smoke
message_begin( MSG_BROADCAST,SVC_TEMPENTITY,vec1) write_byte( 5 )
write_coord(vec1[0])
write_coord(vec1[1])
write_coord(vec1[2])
write_short( s2smoke )
write_byte( 2 )
write_byte( 10 )
message_end()
}
blood(vec1[3]) {
//LAVASPLASH
message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
write_byte( 10 )
write_coord(vec1[0])
write_coord(vec1[1])
write_coord(vec1[2])
message_end()
}
lightning(vec1[3],vec2[3]) {
//Lightning
message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
write_byte( 0 )
write_coord(vec1[0])
write_coord(vec1[1])
write_coord(vec1[2])
write_coord(vec2[0])
write_coord(vec2[1])
write_coord(vec2[2])
write_short( light )
write_byte( 1 ) // framestart
write_byte( 5 ) // framerate
write_byte( 2 ) // life
write_byte( 20 ) // width
write_byte( 30 ) // noise
write_byte( 200 ) // r, g, b
write_byte( 200 ) // r, g, b
write_byte( 200 ) // r, g, b
write_byte( 200 ) // brightness
write_byte( 200 ) // speed
message_end()
//Sparks
message_begin( MSG_PVS, SVC_TEMPENTITY,vec2)
write_byte( 9 )
write_coord( vec2[0] )
write_coord( vec2[1] )
write_coord( vec2[2] )
message_end()
//s2smoke
message_begin( MSG_BROADCAST,SVC_TEMPENTITY,vec2)
write_byte( 5 )
write_coord(vec2[0])
write_coord(vec2[1])
write_coord(vec2[2])
write_short( s2smoke )
write_byte( 10 )
write_byte( 10 )
message_end()
}
//ADMIN FIRE v1.0.0 by f117bomb
//=========================================================
new gmsgDamage,smoke,mflash
new onfire[33]
public ignite_effects(skIndex[]) {
new kIndex = skIndex[0]
gmsgDamage = get_user_msgid("Damage")
if (is_user_alive(kIndex) && onfire[kIndex] ) {
new korigin[3]
get_user_origin(kIndex,korigin)
//TE_SPRITE - additive sprite, plays 1 cycle
message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
write_byte( 17 )
write_coord(korigin[0]) // coord, coord, coord (position)
write_coord(korigin[1])
write_coord(korigin[2])
write_short( mflash ) // short (sprite index)
write_byte( 20 ) // byte (scale in 0.1's)
write_byte( 200 ) // byte (brightness)
message_end()
//Smoke
message_begin( MSG_BROADCAST,SVC_TEMPENTITY,korigin)
write_byte( 5 )
write_coord(korigin[0])// coord coord coord (position)
write_coord(korigin[1])
write_coord(korigin[2])
write_short( smoke )// short (sprite index)
write_byte( 20 ) // byte (scale in 0.1's)
write_byte( 15 ) // byte (framerate)
message_end()
set_task(0.2, "ignite_effects" , 0 , skIndex, 2)
}
else {
if( onfire[kIndex] ) {
emit_sound(kIndex,CHAN_AUTO, "scientist/scream21.wav", 0.6, ATTN_NORM, 0, PITCH_HIGH)
onfire[kIndex] = 0
}
}
return PLUGIN_CONTINUE
}
public ignite_player(skIndex[]) {
new kIndex = skIndex[0]
if (is_user_alive(kIndex) && onfire[kIndex] ) {
new korigin[3]
new players[32], inum = 0
new pOrigin[3]
new kHeath = get_user_health(kIndex)
get_user_origin(kIndex,korigin)
//create some damage
set_user_health(kIndex,kHeath - 10)
message_begin(MSG_ONE, gmsgDamage, {0,0,0}, kIndex)
write_byte(30) // dmg_save
write_byte(30) // dmg_take
write_long(1<<21) // visibleDamageBits
write_coord(korigin[0]) // damageOrigin.x
write_coord(korigin[1]) // damageOrigin.y
write_coord(korigin[2]) // damageOrigin.z
message_end()
//create some sound
emit_sound(kIndex,CHAN_ITEM, "ambience/flameburst1.wav", 0.6, ATTN_NORM, 0, PITCH_NORM)
//Ignite Others
get_players(players,inum,"a")
for(new i = 0 ;i < inum; ++i) {
get_user_origin(players,pOrigin)
if( get_distance(korigin,pOrigin) < 100 ) {
if( !onfire[players] ) {
new spIndex[2]
spIndex[0] = players
new pName[32], kName[32]
get_user_name(players,pName,31)
get_user_name(kIndex,kName,31)
emit_sound(players,CHAN_WEAPON ,"scientist/scream07.wav", 1.0, ATTN_NORM, 0, PITCH_HIGH)
client_print(0,3,"* [AMXX] OH! NO! fire %s let %s give !",kName,pName)
onfire[players] =1
ignite_player(players)
ignite_effects(players)
}
}
}
players[0] = 0
pOrigin[0] = 0
korigin[0] = 0
//Call Again in 2 seconds
set_task(2.0, "ignite_player" , 0 , skIndex, 2)
}
return PLUGIN_CONTINUE
}
public fire_player(id,level,cid) {
if (!cmd_access(id,level,cid,2))
return PLUGIN_HANDLED
new arg[32]
read_argv(1,arg,31)
new victim = cmd_target(id,arg,7)
if (!victim)
return PLUGIN_HANDLED
new skIndex[2]
skIndex[0] = victim
new name[32]
get_user_name(victim,name,31)
onfire[victim] = 1
ignite_effects(skIndex)
ignite_player(skIndex)
new adminname[32]
get_user_name(id,adminname,31)
switch(get_cvar_num("amx_show_activity")) {
case 2: client_print(0,print_chat,"[AMXX] OP %s: 对 %s fire.",adminname,name)
case 1: client_print(0,print_chat,"[AMXX] OP: 对 %s fire.",name)
}
console_print(id,"Client ^"%s^" has been set on fire...",name)
log_amx("ADMIN FIRE - this command was issued by %s. Admin has set fire to %s",adminname,name)
return PLUGIN_HANDLED
}
//ADMIN ROCKET v1.3 by f117bomb
//=========================================================
new m_blueflare2,rmflash,rgmsgDamage,white,rsmoke,rocket_z[33]
public rocket_liftoff(svictim[]) {
new victim = svictim[0]
set_user_gravity(victim,-0.50)
client_cmd(victim,"+jump;wait;wait;-jump")
emit_sound(victim, CHAN_VOICE, "weapons/rocket1.wav", 1.0, 0.5, 0, PITCH_NORM)
rocket_effects(svictim)
return PLUGIN_CONTINUE
}
public rocket_effects(svictim[]) {
new victim = svictim[0]
if ( is_user_alive(victim) ) {
new vorigin[3]
get_user_origin(victim,vorigin)
message_begin(MSG_ONE, rgmsgDamage, {0,0,0}, victim)
write_byte(30) // dmg_save
write_byte(30) // dmg_take
write_long(1<<16) // visibleDamageBits
write_coord(vorigin[0]) // damageOrigin.x
write_coord(vorigin[1]) // damageOrigin.y
write_coord(vorigin[2]) // damageOrigin.z
message_end()
if(rocket_z[victim] == vorigin[2])
rocket_explode(svictim)
rocket_z[victim] = vorigin[2]
//Draw Trail and effects
//TE_SPRITETRAIL - line of moving glow sprites with gravity, fadeout, and collisions
message_begin( MSG_BROADCAST, SVC_TEMPENTITY )
write_byte( 15 )
write_coord( vorigin[0]) // coord, coord, coord (start)
write_coord( vorigin[1])
write_coord( vorigin[2])
write_coord( vorigin[0]) // coord, coord, coord (end)
write_coord( vorigin[1])
write_coord( vorigin[2] - 30)
write_short( m_blueflare2 ) // short (sprite index)
write_byte( 5 ) // byte (count)
write_byte( 1 ) // byte (life in 0.1's)
write_byte( 1 ) // byte (scale in 0.1's)
write_byte( 10 ) // byte (velocity along vector in 10's)
write_byte( 5 ) // byte (randomness of velocity in 10's)
message_end()
//TE_SPRITE - additive sprite, plays 1 cycle
message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
write_byte( 17 )
write_coord(vorigin[0]) // coord, coord, coord (position)
write_coord(vorigin[1])
write_coord(vorigin[2] - 30)
write_short( rmflash ) // short (sprite index)
write_byte( 15 ) // byte (scale in 0.1's)
write_byte( 255 ) // byte (brightness)
message_end()
set_task(0.2, "rocket_effects" , 0 , svictim, 2)
}
return PLUGIN_CONTINUE
}
public rocket_explode(svictim[]) {
new victim = svictim[0]
if ( is_user_alive(victim) ) { /*If user is alive create effects and user_kill */
new vec1[3]
get_user_origin(victim,vec1)
// blast circles
message_begin( MSG_BROADCAST,SVC_TEMPENTITY,vec1)
write_byte( 21 )
write_coord(vec1[0])
write_coord(vec1[1])
write_coord(vec1[2] - 10)
write_coord(vec1[0])
write_coord(vec1[1])
write_coord(vec1[2] + 1910)
write_short( white )
write_byte( 0 ) // startframe
write_byte( 0 ) // framerate
write_byte( 2 ) // life
write_byte( 16 ) // width
write_byte( 0 ) // noise
write_byte( 188 ) // r
write_byte( 220 ) // g
write_byte( 255 ) // b
write_byte( 255 ) //brightness
write_byte( 0 ) // speed
message_end()
//Explosion2
message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
write_byte( 12 )
write_coord(vec1[0])
write_coord(vec1[1])
write_coord(vec1[2])
write_byte( 188 ) // byte (scale in 0.1's)
write_byte( 10 ) // byte (framerate)
message_end()
//rsmoke
message_begin( MSG_BROADCAST,SVC_TEMPENTITY,vec1)
write_byte( 5 )
write_coord(vec1[0])
write_coord(vec1[1])
write_coord(vec1[2])
write_short( rsmoke )
write_byte( 2 )
write_byte( 10 )
message_end()
user_kill(victim,1)
}
//stop_sound
emit_sound(victim, CHAN_VOICE, "weapons/rocket1.wav", 0.0, 0.0, (1<<5), PITCH_NORM)
set_user_maxspeed(victim,1.0)
set_user_gravity(victim,1.00)
return PLUGIN_CONTINUE
}
public rocket_player(id,level,cid) {
if (!cmd_access(id,level,cid,2))
return PLUGIN_HANDLED
new arg[32],arg2[3]
read_argv(1,arg,31)
read_argv(2,arg2,2)
if (arg[0]=='@') {
new players[32], inum , name[32]
get_players(players,inum,"ae",arg[1])
if (inum==0){
console_print(id,"[AMXX] No clients in such team")
return PLUGIN_HANDLED
}
for(new a=0;a<inum;++a){
if (get_user_flags(players[a])&ADMIN_IMMUNITY){
get_user_name(players[a],name,31)
console_print(id,"[AMXX] Skipping ^"%s^" because client has immunity",name)
continue
}
new sPlayer[2]
sPlayer[0] = players[a]
emit_sound(players[a],CHAN_WEAPON ,"weapons/rocketfire1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
set_user_maxspeed(players[a],0.01)
set_task(1.2, "rocket_liftoff" , 0 , sPlayer, 2)
}
}
else {
new player = cmd_target(id,arg,7)
if (!player)
return PLUGIN_HANDLED
new sPlayer[2]
sPlayer[0] = player
emit_sound(player,CHAN_WEAPON ,"weapons/rocketfire1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
set_user_maxspeed(player,0.01)
set_task(1.2, "rocket_liftoff" , 0 , sPlayer, 2)
new playername[32]
get_user_name(player,playername,31)
new name[32]
get_user_name(id,name,31)
switch(get_cvar_num("amx_show_activity")){
case 2: client_print(0,print_chat,"[AMXX] OP %s: let %s rocket",name,playername)
case 1: client_print(0,print_chat,"[AMXX] OP: let %s rocket",playername)
}
console_print(id,"[AMXX] Client ^"%s^" has been set to explode...",playername)
log_amx("ADMIN ROCKET - this command was issued by %s. Admin has created a rocket out of %s",name,playername)
}
rgmsgDamage = get_user_msgid("Damage")
return PLUGIN_HANDLED
}
public plugin_precache() {
mflash = precache_model("sprites/muzzleflash.spr")
smoke = precache_model("sprites/steam1.spr")
rmflash = precache_model("sprites/muzzleflash.spr")
m_blueflare2 = precache_model( "sprites/blueflare2.spr")
rsmoke = precache_model("sprites/steam1.spr")
white = precache_model("sprites/white.spr")
light = precache_model("sprites/lgtning.spr")
s2smoke = precache_model("sprites/steam1.spr")
s2white = precache_model("sprites/white.spr")
precache_sound( "ambience/thunder_clap.wav")
precache_sound( "weapons/headshot2.wav")
precache_sound("ambience/flameburst1.wav")
precache_sound("scientist/scream21.wav")
precache_sound("scientist/scream07.wav")
precache_sound("weapons/rocketfire1.wav")
precache_sound("weapons/rocket1.wav")
return PLUGIN_CONTINUE
} |
|