|
本帖最后由 kikooo 于 2009-5-12 01:34 编辑
国外论坛找个发弹药包插件
方便 潜力选手 收藏 先发 代码了
- #include <amxmodx>
- #include <amxmisc>
- #include <zombieplague>
- public plugin_init ()
- {
- register_plugin ( "Give Ammo", "1.0.0", "Quantum" );
- register_clcmd ( "zp_giveap", "CmdGiveAP", ADMIN_RCON, "- zp_giveap <name> <amount> : Give Ammo Packs" );
- }
-
- public CmdGiveAP ( id, level, cid )
- {
- if ( !cmd_access ( id, level, cid, 3 ) )
- {
- return PLUGIN_HANDLED;
- }
-
- new s_Name[ 32 ], s_Amount[ 4 ];
-
- read_argv ( 1, s_Name, charsmax ( s_Name ) );
- read_argv ( 2, s_Amount, charsmax ( s_Amount ) );
-
- new i_Target = cmd_target ( id, s_Name, 2 );
-
- if ( !i_Target )
- {
- client_print ( id, print_console, "(!) Player not found" );
- return PLUGIN_HANDLED;
- }
-
- zp_set_user_ammo_packs ( i_Target, max ( 1, str_to_num ( s_Amount ) ) );
-
- return PLUGIN_HANDLED;
- }
复制代码 复制代码使用说明
插件使用权限 ADMIN_RCON
命令 zp_giveap ID 弹药包数量
例 zp_giveap dcoo 100 即给予 dcoo 100 弹药包 |
|