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 |
|
|
|