搜索
查看: 4592|回复: 11

精品 源码中文问题

[复制链接]
发表于 2016-8-22 12:26:26 来自手机 | 显示全部楼层 |阅读模式 来自 天津
谁知道源码里的中文怎么写,在游戏里能让人看见!   例如不是VIP按i 件 出现【提示】您不是VIP 无需按键!   怎么该这句话的中文?
发表于 2016-8-22 21:38:53 | 显示全部楼层 来自 广东深圳
client_cmd
register_clcmd
client_print


要用到这3个函数
回复

使用道具 举报

发表于 2016-8-23 08:05:12 | 显示全部楼层 来自 广东佛山
楼上正解,但是如果应该有了client_cmd,和register,那么就要用client_print(id,"【提示】您不是VIP 无需按键!),id是索引,建议你把源码发上来
回复

使用道具 举报

 楼主| 发表于 2016-8-23 09:48:33 | 显示全部楼层 来自 天津
#include<amxmisc>
#include<engine>
#include<hamsandwich>
#include<fakemeta>
#include<cstrike>
#include<colorChat>

new jumpnum[33]
new bool:dojump[33]

new allowMj[33]

new gCost = 800,//浠锋牸
        gAcce = ADMIN_KICK // 鏉冮檺c

public plugin_init(){
        register_plugin("[XY] Multi Jump","0.1","xy")

        RegisterHam(Ham_Spawn, "player", "fwPlayerSpawn", 1)
        register_cvar("amx_maxjumps","1")//鍙湪绌轰腑璺冲灏戞
        register_clcmd("say /mj","cmdBuyMj")
}

public fwPlayerSpawn(id) allowMj[id] = 0

public cmdBuyMj(id){
        if(!access(id,gAcce)){
                client_print(id,print_center,"姝や负浼氬憳閬撳叿,闇€鎺堟潈")
                return 1
        }

        new um = cs_get_user_money(id) - gCost
        if(um < 0){
                client_print(id,print_center,"閲戝竵涓嶈冻")
                return 1
        }

        if(allowMj[id]){
                client_print(id,print_center,"浣犲凡缁忚喘涔颁簡楂樿烦鍗?)
                return 1
        }

        allowMj[id] = 1
        cs_set_user_money(id,um)
        new name[32]
        get_user_name(id,name,31)
        ColorChat(id, GREEN, "^x04鈥荤偣鐑熸彁绀衡€籢x03 %s ^x04璐拱浜嗕竴寮燸x03銆愰珮璺冲崱銆?^x01浠栧彲鑳藉湪鏌愬闃翠汉,澶у灏忓績!",name)
        return 1
}

public client_putinserver(id){
        allowMj[id] = jumpnum[id] = 0
        dojump[id] = false
}

public client_disconnect(id)
{
        jumpnum[id] = 0
        dojump[id] = false
}

public client_PreThink(id){
        if(!allowMj[id]) return

        new nbut = get_user_button(id)
        new obut = get_user_oldbutton(id)
        if((nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))
        {
                if(jumpnum[id] < get_cvar_num("amx_maxjumps"))
                {
                        dojump[id] = true
                        ++jumpnum[id]
                        return
                }
        }
        if((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
                jumpnum[id] = 0

}

public client_PostThink(id)
{
        if(dojump[id])
        {
                new Float:velocity[3]        
                entity_get_vector(id,EV_VEC_velocity,velocity)
                velocity[2] = random_float(265.0,285.0)
                entity_set_vector(id,EV_VEC_velocity,velocity)
                dojump[id] = false
                return
        }
}
回复

使用道具 举报

 楼主| 发表于 2016-8-23 09:49:57 | 显示全部楼层 来自 天津
我想改成【ACE军团提示】
回复

使用道具 举报

发表于 2016-8-23 13:09:03 | 显示全部楼层 来自 广东佛山
本帖最后由 机子卡大叔 于 2016-8-23 13:10 编辑
15522943239 发表于 2016-8-23 09:49
我想改成【ACE军团提示】


这不是连跳卡吗?我看看,你是想改成按i就提示【ace军团提示】你不是【提示】您不是VIP无需按键!?
回复

使用道具 举报

发表于 2016-8-23 14:22:22 | 显示全部楼层 来自 广东
#include <amxmisc>
#include <engine>
#include <hamsandwich>
#include <fakemeta>
#include <cstrike>
#include <colorChat>

new jumpnum[33]
new bool:dojump[33]

new allowMj[33]

new gCost = 800,//价格
        gAcce = ADMIN_KICK // 权限c

public plugin_init(){
        register_plugin("[XY] Multi Jump","0.1","xy")

        RegisterHam(Ham_Spawn, "player", "fwPlayerSpawn", 1)
        register_cvar("amx_maxjumps","1")//可在空中跳多少次
        register_clcmd("say /mj","cmdBuyMj")
}

public fwPlayerSpawn(id) allowMj[id] = 0

public cmdBuyMj(id){
        if(!access(id,gAcce)){
                client_print(id,print_center,"【ace军团提示】您不是VIP 无需按键!")
                return 1
        }

        new um = cs_get_user_money(id) - gCost
        if(um < 0){
                client_print(id,print_center,"【ace军团提示】金币不足")
                return 1
        }

        if(allowMj[id]){
                client_print(id,print_center,"【ace军团提示】你已经购买了高跳卡")
                return 1
        }

        allowMj[id] = 1
        cs_set_user_money(id,um)
        new name[32]
        get_user_name(id,name,31)
        ColorChat(id, GREEN, "^x04【ace军团提示】^x03 %s ^x04购买了一张^x03【高跳卡】^x01他可能在某处阴人,大家小心!",name)
        return 1
}

public client_putinserver(id){
        allowMj[id] = jumpnum[id] = 0
        dojump[id] = false
}

public client_disconnect(id)
{
        jumpnum[id] = 0
        dojump[id] = false
}

public client_PreThink(id){
        if(!allowMj[id]) return

        new nbut = get_user_button(id)
        new obut = get_user_oldbutton(id)
        if((nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))
        {
                if(jumpnum[id] < get_cvar_num("amx_maxjumps"))
                {
                        dojump[id] = true
                        ++jumpnum[id]
                        return
                }
        }
        if((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
                jumpnum[id] = 0

}

public client_PostThink(id)
{
        if(dojump[id])
        {
                new Float:velocity[3]        
                entity_get_vector(id,EV_VEC_velocity,velocity)
                velocity[2] = random_float(265.0,285.0)
                entity_set_vector(id,EV_VEC_velocity,velocity)
                dojump[id] = false
                return
        }
}



另存为 UTF8-无BOM 格式,然后编译即可。
回复

使用道具 举报

 楼主| 发表于 2016-8-23 18:56:42 | 显示全部楼层 来自 天津
k1nader 发表于 2016-8-23 14:22
#include
#include
#include

厉害  你能看懂那个好像中文的代码啊?
回复

使用道具 举报

发表于 2016-8-23 20:09:02 | 显示全部楼层 来自 广东深圳
15522943239 发表于 2016-8-23 18:56
厉害  你能看懂那个好像中文的代码啊?

你这个明显是乱码了呀 , 下载一个专业的编辑器,转换下就好了。
回复

使用道具 举报

发表于 2016-8-23 21:13:56 | 显示全部楼层 来自 广东深圳
好贴!每日一赞!每日一顶!每日一日!每日一操!
回复

使用道具 举报

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

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