引用 | 編輯
fggabc
2011-09-13 22:28 |
樓主
▼ |
||
x1
[ sell=1] (事先聲明:最好有一點寫sma基礎的人才看,否則看不明) 所謂cvar,就是一些儲存在遊戲伺服器內的遊戲數據,例如mp_startmoney(唔記得係唔係) 16000是設定cs玩家一開始$有16000,廢話不說開始教學: 例如我要設定一開始反恐有X血(CVAR設定)": #include <amxmodx> #include <cstrike> #include <fun> #define PLUGIN "health" #define VERSION "1.0" #define AUTHOR "fggabc" public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) // 註冊插件 register_event("ResetHUD", "hpap" ,"b") //事件 register_cvar("amx_ct_start_hp", "100")//註冊cvar,一開始默認設定100血 } public hpap(id) { if(cs_get_user_team(id) == CS_TEAM_CT) // 如果玩家是反恐的話...... { set_user_health(id, get_cvar_num("amx_ct_start_hp")) // 設定ct血為"amx_ct_start_hp"的值(默認設定100血) } } 使用方法: 在addons/amxmodx/configs/amxx.cfg 打上amx_ct_start_hp 100 ct血便是100了 要改就改100這個值 期他amxx的cvar都是這樣加和改 如果喜歡這篇教學,就推和花花吧!! [/sell] x2
|
引用 | 編輯
su0922168060
2011-12-08 18:08 |
10樓
▲ ▼ |
最近想研究SMA
插件懂很多了 我學校也在交VB有一點關連巴 x0 |
引用 | 編輯
Crea*dar
2012-02-20 18:34 |
12樓
▲ ▼ |
#include <amxmodx>
#include <cstrike> #include <fun> #define PLUGIN "health" #define VERSION "1.0" #define AUTHOR "fggabc" 是什麼東西0.0 x0 |
引用 | 編輯
jackson2011
2012-02-25 20:34 |
13樓
▲ ▼ |
那個
便是ct是用那個與法嗎 if(cs_get_user_team(id) == CS_TEAM_CT) 還有 設定血是 set_user_health(id, get_cvar_num("amx_ct_start_hp 血")) 控一行在輸入血的數值嗎 x0 |
引用 | 編輯
jeffrey1239
2012-07-25 21:22 |
14樓
▲ ▼ |
支持!支持!支持!
x0 |
引用 | 編輯
dpes964211
2013-09-28 14:28 |
16樓
▲ ▼ |
看起來簡單 卻大有來歷 (推
x0 |
引用 | 編輯
gn00855790
2014-04-13 17:53 |
17樓
▲ ▼ |
設定反控一開始有x血
好像不錯喔 感謝大大提供這個教學讓我學會這個 x0 |