随身笔记

amxx常用笔记

\g 空格才可以有颜色
 hamsandwich和fakemeta一般是注册动作,事件用的
注册一些被触发的事件 
写插件注意区分变量和语句,还有()里面的数据是否对应。

常用函数
client_connect ( id ):当客户端连接的时候响应

client_putinserver ( id ):当玩家加入游戏时响应

equal ( const a[], const b[], [ c ] ):检查两个字串是否匹配,如果有[C]参数,则仅仅匹配[C]的内容

get_pcvar_num是拿plugin_init裡面的cvar 

&是和的意思
get_user_flags(id)&权限    //玩家包含某权限
!(get_user_flags(id)&权限)   //玩家不包含某权限

str_to_num ( const string[] )返回字串转换成数

 () 的东西是没办法用 = 改的

 g_jbpacks[id]=cs_get_user_money(id),检测同时,这样才行 。




get_pcvar_num是从索引获取参数的值
get_cvar_num是直接获取参数的值

Pawn注意语句顺序,顺序影响程序。


 goto next;
跳到next下的语句。
next:

 /* The actual return value of the function, use these instead of PLUGIN_HANDLED etc when
 * returning from registered forwards.
 */
#define FMRES_IGNORED 1 // Calls target function, returns normal value
#define FMRES_HANDLED 2 // Tells metamod you did something, still calls target function and returns normal value
#define FMRES_OVERRIDE 3 // Supposed to still call the target function but return your value instead
// however this does not work properly with metamod; use supercede instead.
#define FMRES_SUPERCEDE 4 // Block the target call, and use your return value (if applicable) 
 #define PLUGIN_CONTINUE 0 /* Results returned by public functions */
#define PLUGIN_HANDLED 1 /* stop other plugins */
#define PLUGIN_HANDLED_MAIN 2 /* to use in client_command(), continue all plugins but stop the command */ 

"Variable" Constants:  
AMXX_VERSION		//AMXx Version
AMXX_VERSION_STRN	//AMXx Version as string

Admin Level Constants:  
ADMIN_ALL		0	//Everyone
ADMIN_IMMUNITY		1	//Flag "a", immunity
ADMIN_RESERVATION	2	//Flag "b", reservation
ADMIN_KICK		4	//Flag "c", kick
ADMIN_BAN		8	//Flag "d", ban
ADMIN_SLAY		16	//Flag "e", slay
ADMIN_MAP		32	//Flag "f", map change
ADMIN_CVAR		64	//Flag "g", cvar change
ADMIN_CFG		128	//Flag "h", config execution
ADMIN_CHAT		256	//Flag "i", chat
ADMIN_VOTE		512	//Flag "j", vote
ADMIN_PASSWORD		1024	//Flag "k", sv_password
ADMIN_RCON		2048	//Flag "l", rcon access
ADMIN_LEVEL_A		4096	//Flag "m", custom
ADMIN_LEVEL_B		8192	//Flag "n", custom
ADMIN_LEVEL_C		16384	//Flag "o", custom
ADMIN_LEVEL_D		32768	//Flag "p", custom
ADMIN_LEVEL_E		65536	//Flag "q", custom
ADMIN_LEVEL_F		131072	//Flag "r", custom
ADMIN_LEVEL_G		262144	//Flag "s", custom
ADMIN_LEVEL_H		524288	//Flag "t", custom
ADMIN_MENU		1048576	//Flag "u", menus
ADMIN_ADMIN		16777216	//Flag "y", default admin
ADMIN_USER		33554432	//Flag "z", default user

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值