广告广告
  加入我的最爱 设为首页 风格修改
首页 首尾
 手机版   订阅   地图  繁体 
您是第 1525 个阅读者
 
发表文章 发表投票 回覆文章
  可列印版   加为IE收藏   收藏主题   上一主题 | 下一主题   
Rubbish-Nec 手机 会员卡
个人头像
个人文章 个人相簿 个人日记 个人地图
特殊贡献奖 社区建设奖 优秀管理员勋章 特殊贡献奖-2
小有名气
级别: 小有名气 该用户目前不上站
推文 x214 鲜花 x701
分享: 转寄此文章 Facebook Plurk Twitter 复制连结到剪贴簿 转换为繁体 转换为简体 载入图片
推文 x0
[1.6] 又是请大大看看我的sma
请看看吧

复制程式
#include <amxmodx>
#include <cstrike>

new g_mac_cost

public plugin_init()
{
    register_plugin ("Buy Mac" , "1.0" , "Rubbish.Nec")
    register_clcmd ( "say /buymac" , "buy_mac" ) 
    g_mac_cost = register_cvar ( "amx_mac_cost" , "16000" )
}

public buy_mac(id)
{
    if (!is_user_alive (id) || !is_user_connected (id)) 
    {  
        new money = cs_get_user_money(id)
        
        if (money < g_mac_cost)
        {
            give_item( id , "weapon_mac10" )
            cs_set_user_money ( id , money - g_mac_cost )
        }
        else
        {
            client_print( id , print_chat , "你不够钱。" )
        }
    }
} 


已成过去的中二少年。
献花 x0 回到顶端 [楼 主] From:香港城市电讯 | Posted:2009-12-29 01:10 |
a7811311622 手机
个人头像
个人文章 个人相簿 个人日记 个人地图
特殊贡献奖 优秀管理员勋章 社区建设奖
头衔:我…在工作了…我…在工作了…
版主
级别: 版主 该用户目前不上站
版区: CS提问区
推文 x771 鲜花 x2152
分享: 转寄此文章 Facebook Plurk Twitter 复制连结到剪贴簿 转换为繁体 转换为简体 载入图片

下面是引用 Rubbish-Nec 于 2009-12-29 01:10 发表的 又是请大大看看我的sma: 到引言文
请看看吧

#include <amxmodx> #include <cstrike>  new g_mac_cost  public plugin_init() {     register_plugin ("Buy Mac" , "1.0" , "Rubbish.Nec")     register_clcmd ( "say /buymac" , "buy_mac" )      g_mac_cost = register_cvar ( "amx_mac_cost" , "16000" ) }  public buy_mac(id) {     if (!is_user_alive (id) || !is_user_connected (id))      {           new money = cs_get_user_money(id)                  if (money < g_mac_cost)         {             give_item( id , "weapon_mac10" )             cs_set_user_money ( id , money - g_mac_cost )         }         else         {             client_print( id , print_chat , "你不够钱。" )         }     } } [/pre]


我怎么觉得你逻辑条件假设相反了…?表情
我是改这样:

#include <amxmodx>
#include <cstrike>
 
new g_mac_cost
 
public plugin_init()
{
    register_plugin ("Buy Mac" , "1.0" , "Rubbish.Nec")
    register_clcmd ( "say /buymac" , "buy_mac" ) 
    g_mac_cost = register_cvar ( "amx_mac_cost" , "16000" )
}
 
public buy_mac(id)
{
    if (!is_user_alive (id) || !is_user_connected (id)) 
    {  
        new money = cs_get_user_money(id)
        
        if (money < get_pcvar_num(g_mac_cost))
        {
            client_print( id , print_chat , "你不够钱。" )
            return;
        }
        give_item( id , "weapon_mac10" )
        cs_set_user_money ( id , money - get_pcvar_num(g_mac_cost) )
    }
}

话说…干脆问插件能不能像枪模一样开个研究区算了…
感觉插件的语法都还要跑来提问区问…
搞不好开个「插件研究区」后yymmychat大就能教一些很好用的语法呢~表情


尚无签名,欢迎 [新增个性化签名]
献花 x1 回到顶端 [1 楼] From:台湾教育部 | Posted:2009-12-29 11:34 |
Rubbish-Nec 手机 会员卡
个人头像
个人文章 个人相簿 个人日记 个人地图
特殊贡献奖 社区建设奖 优秀管理员勋章 特殊贡献奖-2
小有名气
级别: 小有名气 该用户目前不上站
推文 x214 鲜花 x701
分享: 转寄此文章 Facebook Plurk Twitter 复制连结到剪贴簿 转换为繁体 转换为简体 载入图片

那找aa大大吧 表情


已成过去的中二少年。
献花 x0 回到顶端 [2 楼] From:香港城市电讯 | Posted:2009-12-29 14:26 |

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