广告广告
  加入我的最爱 设为首页 风格修改
首页 首尾
 手机版   订阅   地图  繁体 
您是第 1625 个阅读者
 
发表文章 发表投票 回覆文章
  可列印版   加为IE收藏   收藏主题   上一主题 | 下一主题   
23208367
个人文章 个人相簿 个人日记 个人地图
小人物
级别: 小人物 该用户目前不上站
推文 x24 鲜花 x29
分享: 转寄此文章 Facebook Plurk Twitter 复制连结到剪贴簿 转换为繁体 转换为简体 载入图片
推文 x0
[1.6][插件] sma的问题
我写了一个插件,用在nst大乱斗的

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>
#define PLUGIN "zbu_tr"
#define VERSION "1.0"
#define AUTHOR "kevin"
new icon
new color=255
public plugin_init()
{
    register_plugin( PLUGIN, VERSION, AUTHOR )
    register_event( "HLTV" , "event_round_start" , "a" , "1=0" , "2=0" )
    icon=get_user_msgid("StatusIcon")
}
public event_round_start()
{
       if(get_user_team(1) == CS_TEAM_T)
       {
          begin_spr(0)
       }
}
public begin_spr(id)
{
        remove_task(id)
        message_begin(MSG_ONE,icon,{0,0,0},id)
        write_byte(0)
        write_string("zbu_tr")
        write_byte(0)
        write_byte(0)
        write_byte(0)
        message_end()
        set_task(0.1,"show_spr",id,"",0,"b")
}
public show_spr(id)
{
        color-=5
               
        if(color>0)
        {
                message_begin(MSG_ONE,icon,{0,0,0},id)
                write_byte(1)
                write_string("zbu_tr")
                write_byte(color)
                write_byte(color)
                write_byte(color)
                message_end()
        }
        else
        {
                color=0
                message_begin(MSG_ONE,icon,{0,0,0},id)
                write_byte(0)
                write_string("zbu_tr")
                write_byte(color)
                write_byte(color)
                write_byte(color)
                message_end()
                remove_task(id)
        }
}


可是,一进游戏选了tr以后,就被弹了出来(选ct不会)
说:Host_Error: WriteDest_Parm: not a clien
这是什么问题,amxx的问题吗??



献花 x0 回到顶端 [楼 主] From:香港特别行政区 | Posted:2011-03-26 11:14 |
Abcdzxc555
个人文章 个人相簿 个人日记 个人地图
初露锋芒
级别: 初露锋芒 该用户目前不上站
推文 x71 鲜花 x83
分享: 转寄此文章 Facebook Plurk Twitter 复制连结到剪贴簿 转换为繁体 转换为简体 载入图片

把public event_round_start()
改成
public event_round_start()
{
    for (new id = 1; id <= 32; id++)
    {
        if (is_user_connected(id) && cs_get_user_team(id) == CS_TEAM_T)
            begin_spr(id)
    }
}
试试看


献花 x0 回到顶端 [1 楼] From:香港网上行 | Posted:2011-03-26 14:50 |
史来姆
个人文章 个人相簿 个人日记 个人地图
特殊贡献奖
小有名气
级别: 小有名气 该用户目前不上站
推文 x370 鲜花 x529
分享: 转寄此文章 Facebook Plurk Twitter 复制连结到剪贴簿 转换为繁体 转换为简体 载入图片

begin_spr(0)
这个就是问题所在吧
玩家id是介乎 1-32
你把function执行在id = 0
当然会出错了,,,


献花 x0 回到顶端 [2 楼] From:香港网上行 | Posted:2011-03-26 23:27 |
23208367
个人文章 个人相簿 个人日记 个人地图
小人物
级别: 小人物 该用户目前不上站
推文 x24 鲜花 x29
分享: 转寄此文章 Facebook Plurk Twitter 复制连结到剪贴簿 转换为繁体 转换为简体 载入图片

2楼的方法ok了


献花 x0 回到顶端 [3 楼] From:香港特别行政区 | Posted:2011-03-27 12:55 |

首页  发表文章 发表投票 回覆文章
Powered by PHPWind v1.3.6
Copyright © 2003-04 PHPWind
Processed in 0.018232 second(s),query:16 Gzip disabled
本站由 瀛睿律师事务所 担任常年法律顾问 | 免责声明 | 本网站已依台湾网站内容分级规定处理 | 连络我们 | 访客留言