搜索
查看: 2107|回复: 9

发布一个 投票刀子竞技场 插件要的顶!

[复制链接]
发表于 2007-1-18 00:03:25 | 显示全部楼层 |阅读模式 来自 广东中山
安装方法:
放在cstrike\addons\amxmodx\plugins 目录下
在plugins.ini里加上amx_knivesonly.amxx
在menu菜单中加入say /voteknivesonly   注意权限普通
在游戏中menu看效果

需要的大家帮忙顶下,高手有这原代码的发布下,或修改下此插件也行,!!!

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注个册吧

×
发表于 2007-1-18 09:02:08 | 显示全部楼层 来自 天津

回复: 发布一个 投票刀子竞技场 插件要的顶!

需要权限吗?支持原创!!顶!为什么不发源码?
回复

使用道具 举报

发表于 2007-1-18 09:56:59 | 显示全部楼层 来自 广东深圳

回复: 发布一个 投票刀子竞技场 插件要的顶!

Post by CGstorm
需要权限吗?支持原创!!顶!为什么不发源码?

原贴地址http://forums.alliedmods.net/showthread.php?p=170215
  1. /****************************************************
  2. * AMX Mod X Script for Counter-Strike 1.6                        *
  3. * by "SilverTide"                                                                        *
  4. * Knives Only                                                                                *
  5. * Version 0.1a                                                                                *
  6. * Email = miketomasello@gmail.com                                        *
  7. * http://warcraft3server.com                                                *
  8. *                                                                                                         *
  9. * Credits:                                                                                        *
  10. *  Billythekid - I had to use his knifes only      *
  11. *                plugin as a reference.                        *
  12. *                                                                                                        *
  13. * Admin Commands -                                                                        *
  14. * amx_knivesonly <1|0> (Default: 0)                                *
  15. *  [ Enables or Disables knives only mode ]                *
  16. *                                                                                                         *
  17. * Client Commands-                                                                        *
  18. * say /voteknivesonly                                                                *
  19. *  [ Starts a vote for knives only mode ]                        *
  20. *                                                                                                         *
  21. *                                                                                                         *
  22. * PLUGIN DESCRIPTION : -----------------                        *
  23. * Users will be forced to use knives                                *
  24. * only, any other weapons will be                                        *
  25. * removed.                                                                                        *
  26. *                                                                                                        *
  27. ****************************************************/

  28. #include <amxmodx>
  29. #include <amxmisc>
  30. #include <fun>

  31. new knifeonly = 0;
  32. new choice[2];
  33. new voteknivesonly[] = "\yKnives Only?\w^n^n1. On^n2. Off";

  34. public plugin_init () {
  35.         register_plugin ( "Knives Only", "0.1a", "SilverTide" );
  36.         register_concmd ( "amx_knivesonly", "cmdknives_only", ADMIN_LEVEL_A, "- Turns on or off Knives Only." );
  37.         register_concmd ( "amx_voteknivesonly", "cmdvoteknives_only", ADMIN_VOTE, "- Begins a vote to enable Knives Only." );
  38.         register_concmd ( "say /voteknivesonly", "cmdvote", ADMIN_VOTE, "- Begins a vote to enable Knives Only." );
  39.         register_menucmd ( register_menuid("\yKnives Only?"), (1<<0)|(1<<1), "count_votes" );
  40.         register_event ( "CurWeapon", "knife", "b" );
  41. }

  42. public cmdknives_only ( id ) {
  43.         new arg[2];
  44.         read_argv ( 1, arg, 1 );
  45.         set_hudmessage ( 200, 100, 0, -1.0, 0.25, 0, 1.0, 5.0, 0.1, 0.2, 2 );
  46.        
  47.         if ( equal ( arg, "1" ) ) {
  48.                 knifeonly = 1;
  49.                 client_cmd ( id, "weapon_knife" );
  50.                 console_print ( id, "Knives Only has been turned on." );
  51.                 show_hudmessage ( 0, "Knives Only has been turned on." );
  52.         } else if ( equal ( arg, "0" ) ) {
  53.                 knifeonly = 0
  54.                 console_print ( id, "Knives Only has been turned off." );
  55.                 show_hudmessage ( 0, "Knives Only has been turned off." );
  56.         } else {
  57.                 if ( knifeonly == 0 ){
  58.                         console_print ( id, "Usage: amx_knivesonly 1 = 0n 0 = off Currently: OFF" );
  59.                 }
  60.                 if ( knifeonly == 1 ){
  61.                         console_print ( id, "Usage: amx_knivesonly 1 = 0n 0 = off Currently: ON" );
  62.                 }
  63.         }
  64.        
  65.         return PLUGIN_CONTINUE;
  66. }

  67. public knife ( id ) {
  68.         if ( knifeonly == 0 ) {
  69.             // Do Nothing;
  70.         }
  71.         if ( knifeonly == 1 ) {
  72.             new clip, ammo;
  73.             new usersweapon = get_user_weapon ( id, clip, ammo );
  74.             
  75.             if ( usersweapon == CSW_KNIFE ) {
  76.                 // Do Nothing
  77.             } else {
  78.                                 // Bury player and strip of weapons, then return to starting position
  79.                                 new origin[3];
  80.                                 get_user_origin ( id, origin );
  81.                                 origin[2] -= 500;
  82.                                 set_user_origin ( id, origin );
  83.                                 new iwpn, iwpns[32], nwpn[32];
  84.                                 get_user_weapons ( id, iwpns, iwpn );
  85.                                 for ( new a = 0; a < iwpn; ++a ) {
  86.                                         get_weaponname ( iwpns[a], nwpn, 31 );
  87.                                         engclient_cmd ( id, "drop", nwpn );
  88.                                 }
  89.                                 new origin2[3];
  90.                                 get_user_origin ( id, origin2 );
  91.                                 origin2[2] += 500;
  92.                                 set_user_origin ( id, origin2 );
  93.                                 // Select the knife
  94.                                 client_cmd ( id, "weapon_knife" );
  95.             }
  96.         }
  97.         return PLUGIN_CONTINUE;
  98. }

  99. public cmdvote ( id ) {
  100.     new Float:voting = get_cvar_float ( "amx_last_voting" );
  101.     if ( voting > get_gametime () ) {
  102.         client_print ( id, print_chat, "*A vote has already been cast.*" );
  103.         return PLUGIN_HANDLED;
  104.     }
  105.     if ( voting && voting + get_cvar_float ( "amx_vote_delay" ) > get_gametime() ) {
  106.         client_print ( id, print_chat, "*Please wait for a short while before you are able to vote again.*" );
  107.         return PLUGIN_HANDLED;
  108.     }
  109.     new menu_msg[256];
  110.     new name[32];
  111.     format ( menu_msg, 255, voteknivesonly );
  112.     new Float:votetime = get_cvar_float("amx_vote_time") + 10.0;
  113.     get_user_info ( id, "name", name, 31 );
  114.     set_cvar_float ( "amx_last_voting", get_gametime() + votetime );
  115.     show_menu ( 0, (1<<0)|(1<<1), menu_msg, floatround ( votetime ) );
  116.     set_hudmessage ( 200, 0, 0, 0.05, 0.65, 2, 0.02, 30.0, 0.03, 0.3, 2 );
  117.                
  118.     show_hudmessage ( 0, "%s has started the Vote for knivesonly", name );
  119.     set_task ( votetime, "check_the_votes" );
  120.     choice[0] = choice[1] = 0;
  121.     return PLUGIN_HANDLED;
  122. }

  123. public cmdvoteknives_only ( id ) {
  124.     new Float:voting = get_cvar_float ( "amx_last_voting" );
  125.     if ( voting > get_gametime () ) {
  126.         client_print ( id, print_chat, "*A vote has already been cast.*" );
  127.         return PLUGIN_HANDLED;
  128.     }
  129.     if ( voting && voting + get_cvar_float( "amx_vote_delay" ) > get_gametime () ) {
  130.         client_print ( id, print_chat, "*Please wait for a short while before you are able to vote again.*" );
  131.         return PLUGIN_HANDLED;
  132.     }
  133.     new menu_msg[256];
  134.     format ( menu_msg, 255, voteknivesonly );
  135.     new Float:votetime = get_cvar_float ( "amx_vote_time" ) + 10.0;
  136.     set_cvar_float ( "amx_last_voting", get_gametime() + votetime );
  137.     show_menu ( 0, (1<<0)|(1<<1), menu_msg, floatround ( votetime ) );
  138.     set_task ( votetime, "check_the_votes" );
  139.     client_print ( 0, print_chat, "*Voting has started.*" );
  140.     choice[0] = choice[1] = 0;
  141.     return PLUGIN_HANDLED;
  142. }

  143. public count_votes ( id, key ) {
  144.     if ( get_cvar_float ( "amx_vote_answers" ) ) {
  145.         new name[32];
  146.         get_user_name ( id, name, 31 );
  147.         client_print ( 0, print_chat, "* %s voted %s", name, key ? "against knives only" : "for knives only" );
  148.     }
  149.     ++choice[key];
  150.     return PLUGIN_HANDLED;
  151. }

  152. public check_the_votes ( id ) {
  153.     if ( choice[0] > choice[1] ) {
  154.         server_cmd ( "amx_knivesonly 1" );
  155.         client_print ( 0, print_chat, "* Knives Only Mode has been voted on. (On ^"%d^") (Off ^"%d^"). *", choice[0], choice[1] );
  156.     } else {
  157.         server_cmd ( "amx_knivesonly 0" );
  158.         client_print ( 0, print_chat, "* Knives Only Mode has been voted off. (On ^"%d^") (Off ^"%d^"). *", choice[0], choice[1] );
  159.     }
  160.     return PLUGIN_CONTINUE;
  161. }
复制代码
回复

使用道具 举报

 楼主| 发表于 2007-1-18 19:18:21 | 显示全部楼层 来自 广东中山

回复: 发布一个 投票刀子竞技场 插件要的顶!

非常感谢3楼发布的原代码!!!!!!跟你合作愉快,哈哈!
回复

使用道具 举报

发表于 2007-1-21 18:58:27 | 显示全部楼层 来自 福建漳州

回复: 发布一个 投票刀子竞技场 插件要的顶!

看看 还可以。。。。。
回复

使用道具 举报

发表于 2007-3-7 21:45:14 | 显示全部楼层 来自 广东揭阳

回复: 发布一个 投票刀子竞技场 插件要的顶!

顶................................
回复

使用道具 举报

发表于 2007-3-10 06:03:28 | 显示全部楼层 来自 福建泉州

回复: 发布一个 投票刀子竞技场 插件要的顶!

如果是第一局只能用刀的插件呢,,找来找去怎么没有一个能在AMXX1.76C下面支持的呢?
回复

使用道具 举报

发表于 2007-3-12 16:48:39 | 显示全部楼层 来自 广西南宁

回复: 发布一个 投票刀子竞技场 插件要的顶!

好象不大实用!!!!!!!!!!
回复

使用道具 举报

发表于 2007-3-12 20:34:14 | 显示全部楼层 来自 广东深圳

回复: 发布一个 投票刀子竞技场 插件要的顶!

试用下先。。。。。。。。。。。。
回复

使用道具 举报

发表于 2011-3-4 17:22:49 | 显示全部楼层 来自 安徽合肥
找来找去怎么没有一个能在AMXX1.76C下面支持的
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表