okok456
|
分享:
▲
▼
我虽然有点懂,但是改选单还是雾雾煞煞,我最近想改人物选单,一直爬不到文.. 复制程式
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
public plugin_init(){
register_plugin("Menu","1.0","storym88349")
register_clcmd("say peoplemenu","ShowMenu",-1,"Show Menu")
register_menucmd(register_menuid("\y人物选单:"), 1023, "MenuCMD" )
}
public ShowMenu(id){
new szMenuBody[256]
new keys
new ellna
new anna
new nLen = format( szMenuBody, 255, "\y人物选单:^n" )
nLen += format( szMenuBody[nLen], 255-nLen, "^n\w1. 人物1" )
nLen += format( szMenuBody[nLen], 255-nLen, "^n\w2. 人物2" )
nLen += format( szMenuBody[nLen], 255-nLen, "^n\w3. 应该懂!" )
nLen += format( szMenuBody[nLen], 255-nLen, "^n\w4. 不太懂!" )
nLen += format( szMenuBody[nLen], 255-nLen, "^n\w5. 修改中?" )
nLen += format( szMenuBody[nLen], 255-nLen, "^n^n\w0. 退出" )
keys = (1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<6|1<<7|1<<8|1<<9)?
show_menu( id, keys, szMenuBody, -1 )
}
public plugin_precache(){
ellna = precache_model("models/player/Ellna/Ellna.mdl")
anna = precache_model("models/player/Anna/Anna.mdl")
}
public MenuCMD( id,key ){
switch( key ){ //switch在很多地方都用的到,ex:随机选取
case 0: client_print( id, print_chat, "你的人物改变成人物1!" )
case 1: client_print( id, print_chat, "你的人物改变成人物2!" )
case 2: client_print( id, print_chat, "修改中!" )
case 3: client_print( id, print_chat, "修改中" )
case 4: client_print( id, print_chat, "修改中" )
case 9: client_print( id, print_chat, "你选了退出!" )
}
}
如果要改人物的话,是打要打甚么指令呢?请各位大大交我吧..
|
|
x0
[43 楼]
From:台湾中华电信股份有限公司 | Posted:2012-04-08 13:25 |
|
|
q949480075q
|
分享:
▲
▼
public ShowMenu(id){ //这里是输入命令时的事件,在这里显示选单的内容 new szMenuBody[256] //以new选告szMenuBody为变数,以此作为载体来储存选单内容 new keys //宣告按键 new nLen = format( szMenuBody, 255, "\y选单教学:^n" ) //选单标题、内容 nLen += format( szMenuBody[nLen], 255-nLen, "^n\w1. 有点懂!" ) nLen += format( szMenuBody[nLen], 255-nLen, "^n\w2. 好像懂!" ) nLen += format( szMenuBody[nLen], 255-nLen, "^n\w3. 应该懂!" ) nLen += format( szMenuBody[nLen], 255-nLen, "^n\w4. 不太懂!" ) nLen += format( szMenuBody[nLen], 255-nLen, "^n\w5. 你说啥?" ) nLen += format( szMenuBody[nLen], 255-nLen, "^n^n\w0. 退出" ) keys = (1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<6|1<<7|1<<8|1<<9) //设定按键,这不难懂吧? show_menu( id, keys, szMenuBody, -1 ) //显示选单 }
中的nLen += format 、 255-nLen 分别代表什么?
|
|
x0
[48 楼]
From:浙江 | Posted:2013-01-25 13:19 |
|
|
|