搜索
查看: 3629|回复: 5

寻求帮助,解决任务失败处死插件问题

[复制链接]
发表于 2008-8-11 16:01:35 | 显示全部楼层 |阅读模式 来自 中国–广东–深圳
L 08/11/2008 - 12:54:41: Start of error session.
L 08/11/2008 - 12:54:41: Info (map "de_train") (logfile "error_081108.log")
L 08/11/2008 - 12:54:41: [FUN] Invalid player 1
L 08/11/2008 - 12:54:41: [AMXX] Displaying debug trace (plugin "team_objectives.amxx")
L 08/11/2008 - 12:54:41: [AMXX] Run time error 10: native error (native "set_user_maxspeed")
L 08/11/2008 - 12:54:41: [AMXX]    [0] team_objectives.sma::rocket_explode (line 127)
插件源码
#include <amxmod>
#include <amxmodx>
#include <amxmisc>
#include <fun>
public slaylosers(param[]) {
if(get_cvar_num("cds_xdcheck") == 1) return PLUGIN_HANDLED
new players[32], playersnum,type

get_players(players,playersnum,"ea",(param[7] == 't') ? "CT" : "TERRORIST" )
type = get_cvar_num("cds_slayloser")

for(new a = 0; a < playersnum; ++a){
  if(get_cvar_num("cds_slayloser") == 0 || get_cvar_num("cds_slayloser") >5)
   type = random_num(1,5)
  
  switch(type){
   case 1:Rocket(players[a])
   case 2:TimeBomb(players[a])
   case 3:Raise(players[a])
   case 4:Fire(players[a])
   case 5:SlapFly(players[a])
  }
}
return PLUGIN_CONTINUE
}
//--------------------------------------------------------------------------------------------------
//矪籃穨
new gmsgShake
new gmsgDamage
new gmsgHealth
new gmsgBattery
new gmsgFade
new gmsgDeathMsg
new r_trail
new mflash
new smoke
new countdown[33]
new light
new white
new fire
new m_fireball
/********************************** SlapFly  *****************************/
public SlapFly(player){
if(is_user_alive(player)){
  user_slap(player,5)
  set_task(0.1,"SlapFly2",player)
}
}
public SlapFly2(player){
if(is_user_alive(player)){
  user_slap(player,10)
  set_task(0.1,"SlapFly",player)
}
}
/********************************** ROCKET  *****************************/
public Rocket(player){
if(is_user_alive(player)){
  emit_sound(player, CHAN_VOICE, "cds/t_o/charging.wav", 1.0, 0.5, 0, PITCH_NORM)
  set_user_maxspeed(player, 1.2)
  rocket_sfx(player)
}
}
public rocket_sfx(player){
if(!is_user_alive(player))
  return PLUGIN_HANDLED

set_user_gravity(player, -1.00)
client_cmd(player, "+jump;wait;wait;-jump")
rocket_rise(player)
message_begin(MSG_ONE,gmsgShake, {0,0,0}, player)
write_short(1<<15) // shake amount
write_short(1<<15) // shake lasts this long
write_short(1<<15) // shake noise frequency
message_end()
// Rocket Trail
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(22) // TE_BEAMFOLLOW
write_short(player)
write_short(r_trail)
write_byte(30)
write_byte(2)
write_byte(250)
write_byte(250)
write_byte(250)
write_byte(250)
message_end()

return PLUGIN_CONTINUE
}
public rocket_rise(player){
if(is_user_alive(player)){
  new origin[3]
  get_user_origin(player, origin)
  draw_fire(origin)
  
  message_begin(MSG_ONE, gmsgDamage, {0,0,0}, player)
  write_byte(30) // dmg_save
  write_byte(30) // dmg_take
  write_long(1<<16) // visibleDamageBits
  write_coord(origin[0]) // damageOrigin.x
  write_coord(origin[1]) // damageOrigin.y
  write_coord(origin[2]) // damageOrigin.z
  message_end()
  
  set_task(0.1, "rocket_rise",player)
  set_task(1.23, "rocket_explode",player)
}
}
public rocket_explode(player){
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(99) // TE_KILLBEAM
write_short(player)
message_end()

slay(player,2)
//emit_sound(player, CHAN_VOICE, "cds/t_o/charging.wav", 0.0, 0.0, (1<<5), PITCH_NORM)
set_user_maxspeed(player, 1.0)
set_user_gravity(player, 1.00)
}
/********************************** FIRE  *****************************/
public Fire(player){
ignite_effects(player)
ignite_player(player)
}
public ignite_effects(player){
if(is_user_alive(player)){
  new korigin[3]
  get_user_origin(player, korigin)
  draw_fire(korigin)
  set_task(0.2, "ignite_effects", player)
}
}
public ignite_player(player){
if(is_user_alive(player)){
  new korigin[3]
  //new kHeath = get_user_health(player)
  get_user_origin(player, korigin)
  // Create some damage
  //set_user_health(player, kHeath - 50)
  message_begin(MSG_ONE, gmsgDamage, {0,0,0}, player)
  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(player, CHAN_ITEM, "ambience/flameburst1.wav", 0.6, ATTN_NORM, 0, PITCH_NORM)
  set_task(0.5, "ignite_player", player)
  set_task(1.3,"fire_slay",player)
}
}
public fire_slay(player){
slay(player,3)
}
/* FIRE SPECIAL EFFECTS */
draw_fire(vec1[3]){
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(17) // TE_SPRITE
write_coord(vec1[0])
write_coord(vec1[1])
write_coord(vec1[2])
write_short(mflash)
write_byte(20)
write_byte(200)
message_end()
// Smoke
message_begin(MSG_BROADCAST, SVC_TEMPENTITY, vec1)
write_byte(5) // TE_SMOKE
write_coord(vec1[0])
write_coord(vec1[1])
write_coord(vec1[2])
write_short(smoke)
write_byte(20)
write_byte(15)
message_end()
}
/********************************** TIME BOMB *****************************/
public TimeBomb(player){
countdown[player] = 5
set_task(0.5,"TimeBombLoop",player)
}
public TimeBombLoop(player){
if(!is_user_alive(player)){
  set_player_rendering(player, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 255, 0)
  return PLUGIN_HANDLED
}

new speak[6][] = {"fire!", "one", "two", "three", "four", "five"}
new red = random_num(0, 255)
new green = random_num(0, 255)
new blue = random_num(0, 255)
new alpha = random_num(100, 255)
new kName[32]
new players[32], inum
get_user_name(player, kName, 31)
set_hudmessage(red, green, blue, -1.0, 0.25, 0, 1.2, 1.2, 0.5, 0.15, 5)

if(countdown[player] > 0){
  // Glow Me
  set_player_rendering(player, kRenderFxGlowShell, red, green, blue, kRenderTransAlpha, alpha, 1)
  // Annouce Me
  get_players(players, inum, "c")
  
  for(new i = 0; i < inum; ++i){
   client_cmd(players, "speak ^"fvox/%s^"", speak[countdown[player]])
   show_hudmessage(0, "%L", LANG_PLAYER, "EXPLODE_MSG", kName, countdown[player])
  }
  message_begin(MSG_ONE, gmsgHealth, {0,0,0}, player)
  write_byte(countdown[player])
  message_end()
  message_begin(MSG_ONE, gmsgBattery, {0,0,0}, player)
  write_short(countdown[player])
  message_end()
  countdown[player]--
  // Call Again
  set_task(0.3, "TimeBombLoop", player)
} else {    //explode
  set_player_rendering(player, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 255, 1)
  get_players(players, inum, "c")
  
  for(new i = 0; i < inum; ++i){
   client_cmd(players, "speak ^"hgrunt/%s^"", speak[countdown[player]])
   message_begin(MSG_ONE, gmsgShake, {0,0,0}, players)
   write_short(1<<14) // shake amount
   write_short(1<<14) // shake lasts this long
   write_short(1<<14) // shake noise frequency
   message_end()
  }
  // FIRE!
  show_hudmessage(0, "%L", LANG_PLAYER, "TIMEBOMB_FIRE_MSG")
  slay(player, 3)
  // Fade to red, for bomber
  message_begin(MSG_ONE, gmsgFade, {0,0,0}, player)
  write_short(1<<15)
  write_short(1<<10)
  write_short(1<<1)
  write_byte(100)
  write_byte(0)
  write_byte(0)
  write_byte(255)
  message_end()
  
  if(get_cvar_num("atac_bomb_mode")){
   get_players(players, inum, "a")
  
   for(new i = 0; i < inum; ++i){
    new pOrigin[3]
    new kOrigin[3]
    get_user_origin(players, pOrigin)
    get_user_origin(player, kOrigin)
    if(get_cvar_num("atac_bomb_range") > get_distance(kOrigin, pOrigin)){
     // Death Msg
     message_begin(MSG_ALL, gmsgDeathMsg)
     write_byte(player)
     write_byte(players)
     write_byte(0)
     write_string("ATAC Timebomb")
     message_end()
     slay(players, 0)
      // Fade to red, for everyone within bomb explosion
     message_begin(MSG_ONE, gmsgFade, {0,0,0}, player)
     write_short(1<<15)
     write_short(1<<10)
     write_short(1<<1)
     write_byte(100)
     write_byte(0)
     write_byte(0)
     write_byte(255)
     message_end()
    }
   }
  }
}
return PLUGIN_HANDLED
}
slay(player,type){
if(is_user_alive(player) && is_user_connected(player)){
  new origin[3]
  get_user_origin(player, origin)
  
  switch(type){
   case 1:{
    lightning(origin)
    emit_sound(player,CHAN_ITEM, "ambience/thunder_clap.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
   }
   case 2:{
    explode(origin)
    emit_sound(player,CHAN_ITEM, "cds/t_o/energy_sing_explosion2.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
   }
   case 3:{
    fireball(origin)
    emit_sound(player,CHAN_ITEM, "cds/t_o/rocketfire1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
   }
  }
  user_kill(player, 0)
}
}
/* SLAYING SPECIAL EFFECTS */
lightning(vec1[3]){
// Lightning
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(0) // TE_BEAMPOINTS
write_coord(vec1[0])
write_coord(vec1[1])
write_coord(vec1[2])
write_coord(vec1[0] + 150)
write_coord(vec1[1] + 150)
write_coord(vec1[2] + 400)
write_short(light)
write_byte(1)
write_byte(5)
write_byte(2)
write_byte(20)
write_byte(30)
write_byte(200)
write_byte(200)
write_byte(200)
write_byte(200)
write_byte(200)
message_end()
// Sparks
message_begin(MSG_PVS, SVC_TEMPENTITY, vec1)
write_byte(9) // TE_SPARKS
write_coord(vec1[0])
write_coord(vec1[1])
write_coord(vec1[2])
message_end()
// Smoke
message_begin(MSG_BROADCAST, SVC_TEMPENTITY, vec1)
write_byte(5) // TE_SMOKE
write_coord(vec1[0])
write_coord(vec1[1])
write_coord(vec1[2])
write_short(smoke)
write_byte(10)
write_byte(10)
message_end()
}
explode(vec1[3]){
// Blast Circles
message_begin(MSG_BROADCAST, SVC_TEMPENTITY, vec1)
write_byte(21) // TE_BEAMCYLINDER
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(white)
write_byte(0)
write_byte(0)
write_byte(2)
write_byte(16)
write_byte(0)
write_byte(188)
write_byte(220)
write_byte(255)
write_byte(255)
write_byte(0)
message_end()
// Explosion2
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(12) // TE_EXPLOSION2
write_coord(vec1[0])
write_coord(vec1[1])
write_coord(vec1[2])
write_byte(188)
write_byte(10)
message_end()
// Smoke
message_begin(MSG_BROADCAST, SVC_TEMPENTITY, vec1)
write_byte(5) // TE_SMOKE
write_coord(vec1[0])
write_coord(vec1[1])
write_coord(vec1[2])
write_short(smoke)
write_byte(2)
write_byte(10)
message_end()
}
fireball(vec1[3])
{
message_begin(MSG_BROADCAST, SVC_TEMPENTITY, vec1)
write_byte(17) // TE_BEAMSPRITE
write_coord(vec1[0])
write_coord(vec1[1])
write_coord(vec1[2] +256)
write_short(fire)
write_byte(120)
write_byte(255)
message_end()
// Implosion
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(14) // TE_IMPLOSION
write_coord(vec1[0])
write_coord(vec1[1])
write_coord(vec1[2])
write_byte(100)
write_byte(20)
write_byte(5)
message_end()
// Random Explosions
message_begin(MSG_PVS, SVC_TEMPENTITY, vec1)
write_byte(3) // TE_EXPLOSION
write_coord(vec1[0])
write_coord(vec1[1])
write_coord(vec1[2])
write_short(m_fireball)
write_byte(30)
write_byte(12)
write_byte(0) // TE_EXPLFLAG_NONE
message_end()
// Lots of Smoke
message_begin(MSG_PVS, SVC_TEMPENTITY, vec1)
write_byte(5) // TE_SMOKE
write_coord(vec1[0])
write_coord(vec1[1])
write_coord(vec1[2])
write_short(smoke)
write_byte(60)
write_byte(10)
message_end()
}
/********************************** DROP  *****************************/
public Raise(player){
if(is_user_alive(player)){
  set_user_gravity(player, -4.0)
  client_cmd(player, "+jump;wait;wait;-jump")
  set_task(0.6, "Drop", player)
}
else{
  set_user_gravity(player, 1.0)
}
return PLUGIN_CONTINUE
}
public Drop(player){
if(is_user_alive(player)){
  set_user_gravity(player, 50.0)
  set_task(0.4, "Raise", player)
  slay(player,1)
}
else{
  set_user_gravity(player, 1.0)
}
return PLUGIN_CONTINUE
}
/**********************************  PUNISHMENTS  ********************************/
set_player_rendering(player, fx, r, g, b, render, amount, alive){
// Alive = 1 mean check if player is alive. Alive = 0 mean don't check if player is alive.
if(is_user_connected(player) && is_user_alive(player) && (alive == 1))
  set_user_rendering(player, fx, r, g, b, render, amount)
else if(is_user_connected(player) && (alive == 0))
  set_user_rendering(player, fx, r, g, b, render, amount)
}
public delayslay(){
new param[32]
new len = read_data(2,param,31)
set_task(0.3,"slaylosers",0,param, len + 1)
}
public all_slay(){
slaylosers("CT")
slaylosers("TERRORIST")
}
public plugin_init(){
register_plugin("Team Objectives","2.0","Bhunji Weasber")
register_event("SendAudio","delayslay","a","2=%!MRAD_terwin","2=%!MRAD_ctwin","2=%!MRAD_rounddraw")
register_cvar("cds_slayloser","0")
register_concmd("cds_slayloser","all_slay",ADMIN_IMMUNITY)

gmsgShake = get_user_msgid("ScreenShake")
gmsgDamage = get_user_msgid("Damage")
gmsgHealth = get_user_msgid("Health")
gmsgBattery = get_user_msgid("Battery")
gmsgFade = get_user_msgid("ScreenFade")
gmsgDeathMsg = get_user_msgid("DeathMsg")
}
public plugin_precache(){
m_fireball = precache_model("sprites/zerogxplode.spr")
mflash = precache_model("sprites/muzzleflash.spr")
r_trail = precache_model("sprites/smoke.spr")
light = precache_model("sprites/lgtning.spr")
smoke = precache_model("sprites/steam1.spr")
white = precache_model("sprites/white.spr")
fire = precache_model("sprites/xfireball3.spr")
precache_sound("ambience/thunder_clap.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")
precache_sound("cds/t_o/rocketfire1.wav")
precache_sound("cds/t_o/energy_sing_explosion2.wav")
precache_sound("cds/t_o/charging.wav")
}

望会修改的朋友能帮个忙。谢谢!!
发表于 2008-8-11 18:14:18 | 显示全部楼层 来自 中国–湖北–襄阳

回复: 寻求帮助,解决任务失败处死插件问题

至于么,那么长。。。。
[PHP]
#include <amxmod>
#include <cstrike>

public plugin_init(){
        register_plugin("Team Objectives","0.9","default")
        register_event("SendAudio","delayslay","a","2=%!MRAD_terwin","2=%!MRAD_ctwin")
}

public delayslay(){
        new param[32]
        new len = read_data(2,param,31)
        set_task(1.0,"slaylosers",0,param, len + 1)
}

public slaylosers(param[]) {
        new players[32], playersnum
        get_players(players,playersnum,"ea",(param[7] == 't') ? "CT" : "TERRORIST" )
        for(new a = 0; a < playersnum; ++a)
        {
                user_kill(players[a],1)
                cs_set_user_deaths( players[a], cs_get_user_deaths (players[a]) - 1 )
        }
        if (playersnum)
                client_cmd(0,"spk ambience/mgun_burst2")
        client_print(0,print_center,"Killing losing team!!!")
}
[/PHP]
回复

使用道具 举报

发表于 2008-8-11 19:02:19 | 显示全部楼层 来自 中国–广东–深圳

回复: 寻求帮助,解决任务失败处死插件问题

Post by '[Grief.QQ
']至于么,那么长。。。。
[php]
#include <amxmod>
#include <cstrike>

public plugin_init(){
    register_plugin("Team Objectives","0.9","default")
    register_event("SendAudio","delayslay","a","2=%!MRAD_terwin","2=%!MRAD_ctwi...

他那个代码好像有很多特效,呵呵。:D
回复

使用道具 举报

发表于 2008-8-11 23:54:45 | 显示全部楼层 来自 中国–湖北–襄阳

回复: 寻求帮助,解决任务失败处死插件问题

死就死了,谁还去看怎么死的!
回复

使用道具 举报

 楼主| 发表于 2008-8-13 16:13:03 | 显示全部楼层 来自 中国–广东–深圳

回复: 寻求帮助,解决任务失败处死插件问题

简单的我找到有,但我喜欢这种多种方式处死的样式
回复

使用道具 举报

发表于 2008-8-28 22:59:08 | 显示全部楼层 来自 中国–山东–济南

回复: 寻求帮助,解决任务失败处死插件问题

cstrike\addons\amxmodx\configs中的PLUGINS.INI文件中关闭 slaylosers.amxx也就是在前面加;
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表