搜索
查看: 9554|回复: 14

【求】高手看下findCheater源码不能编译

[复制链接]
发表于 2011-8-28 10:29:52 | 显示全部楼层 |阅读模式 来自 中国–四川–成都
本帖最后由 homework 于 2011-8-29 09:57 编辑
你发代码也不是这样发的吧。。。。既然太长就直接打包上来有那么难吗
rsdtt 发表于 2011-8-28 15:43

我怕下载扣DTB啊,哈哈,既然r版说了,那我就直接上源码咯。
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <engine>
  4. #include <fun>
  5. #include <cstrike>
  6. #define KEY8 (1<<7)
  7. #define KEY9 (1<<8)
  8. #define MAXSPEED 290
  9. #define MAXCHECKTIME 12
  10. #define MAXHODESEC 15

  11. new g_playerSpeedFlag[33]={0,...};
  12. new dot;
  13. new g_bodyStr[7][10]={"@","head","gun","back","left arm","right arm","foot"};

  14. //for count
  15. new g_playerSpeedWarn[33]
  16. new g_playerThWallWarn[33]
  17. new bool:g_playerFlashed[33]
  18. new g_playerFlashWarn[33]

  19. //for vote
  20. new g_startVoteType=0;
  21. new g_voteCount[2];
  22. new g_voteResStr[2][12]={"Yes.","No."};
  23. new Float:holdTime;
  24. new curMap[32];

  25. public client_color(playerid, colorid, msg[])
  26. {
  27. message_begin(playerid?MSG_ONE:MSG_ALL,get_user_msgid("SayText"),_,playerid)
  28. write_byte(colorid)
  29. write_string(msg)
  30. message_end()
  31. }

  32. public plugin_init()
  33. {
  34. register_plugin("FindCheater", "0.4", "Enigmaya");
  35. register_event("ScreenFade", "eventFlash", "be","2>6000","4=255", "5=255", "6=255", "7=255")
  36. register_event("DeathMsg", "death_msg", "a");

  37. register_cvar("fc_enable", "1");
  38. register_cvar("fc_beam_holdtime", "150");
  39. register_cvar("fc_checkflash", "1");
  40. register_cvar("fc_checkspeed", "1");
  41. register_cvar("fc_checkthwall", "1");
  42. register_cvar("fc_speedwarntime", "2");
  43. register_cvar("fc_thwallwarntime", "10");
  44. register_cvar("fc_flashwarntime", "3");
  45. register_cvar("fc_startvote", "1");
  46. register_cvar("fc_record", "1");
  47. register_cvar("fc_voterate", "0.6");
  48. register_cvar("fc_cmdstr","amx_pcheater #%userid% 6");

  49. register_menucmd(register_menuid("VoteMenu"), KEY8|KEY9, "actionMenu");
  50. register_clcmd("say /fc", "disInfo")

  51. get_mapname(curMap,31);

  52. }

  53. public plugin_precache()
  54. {
  55. dot = precache_model("sprites/dot.spr");
  56. }

  57. public client_connect(id)
  58. {
  59. g_playerSpeedWarn[id]=0;
  60. g_playerThWallWarn[id]=0;
  61. g_playerFlashed[id]=false;
  62. g_playerFlashWarn[id]=0;
  63. }

  64. public eventFlash(id)
  65. {
  66. if( get_cvar_num("fc_enable") & get_cvar_num("fc_checkflash") )
  67. {
  68. read_data(2,holdTime);
  69. holdTime*=0.0002;
  70. set_task(0.5,"startCheck",id);
  71. }
  72. }

  73. public startCheck(id)
  74. {
  75. g_playerFlashed[id]=true;
  76. set_task(holdTime,"endCheck",id);
  77. }

  78. public endCheck(id)
  79. {
  80. g_playerFlashed[id]=false;
  81. }

  82. public client_PreThink ( id )
  83. {
  84. if( get_cvar_num("fc_enable") & get_cvar_num("fc_checkspeed") && is_user_alive(id) && entity_is_on_ground(id) )
  85. {
  86. new curSpe=get_speed (id);
  87. if( curSpe>MAXSPEED ){

  88. if( g_playerSpeedFlag[id]++ > MAXCHECKTIME ){
  89. new pname[32],Msg[512];
  90. get_user_name(id,pname,31);

  91. g_playerSpeedWarn[id]++;
  92. format(Msg,511,"^x04【征战检测】^x03%s^x04的移動速度是^x03(%i)^x04太快了(警告:^x03%d^x04次)",pname,curSpe,g_playerSpeedWarn[id])
  93. client_color(0, id, Msg);
  94. if( get_cvar_num("fc_record") )
  95. recordEvent(Msg);

  96. set_hudmessage(200, 100, 0, 0.0, 0.7, 0, 2.0, 2.0, 0.5, 0.15, 1);
  97. show_hudmessage(0,"%s",Msg);

  98. g_playerSpeedFlag[id]=0;
  99. if( g_playerSpeedWarn[id]>=get_cvar_num("fc_speedwarntime") ){
  100. g_startVoteType=0;
  101. InitVote(id);
  102. g_playerSpeedWarn[id]=0;
  103. }
  104. }
  105. }
  106. else if(g_playerSpeedFlag[id])g_playerSpeedFlag[id]--;
  107. }
  108. }

  109. stock entity_is_on_ground(entity){
  110.       return entity_get_int(entity, EV_INT_flags) FL_ONGROUND
  111.       }
  112.       
  113. public death_msg()
  114. {
  115. if( !get_cvar_num("fc_enable") )
  116. return PLUGIN_HANDLED;

  117. new killer = read_data(1);
  118. new victim = read_data(2);

  119. if( killer==victim || read_data(5) )
  120. return PLUGIN_HANDLED;

  121. new weapon[32];
  122. read_data(4, weapon, 31)

  123. if( equal(weapon,"c4") || equal(weapon,"grenade") || equal(weapon,"knife") )
  124. return PLUGIN_HANDLED;

  125. if( g_playerFlashed[killer] ){
  126. g_playerFlashWarn[killer]++;

  127. new kName[32],vName[32];
  128. get_user_name(killer,kName,31);
  129. get_user_name(victim,vName,31);
  130. new str[512];
  131. format(str,511,"^x04【征战检测】^x03%s^x04在被閃時殺了^x03%s^x04與^x03%s^x04(警告:^x03%d^x04次)",kName,vName,weapon,g_playerFlashWarn[killer])
  132. client_color(0, killer, str);

  133. if( get_cvar_num("fc_record") )
  134. recordEvent(str);

  135. client_print(0,print_chat,"%s",str);

  136. if( g_playerFlashWarn[killer]>=get_cvar_num("fc_flashwarntime") ){
  137. g_startVoteType=2;
  138. InitVote(killer);
  139. g_playerFlashWarn[killer]=0;
  140. }
  141. g_playerFlashed[killer]=false;

  142. return PLUGIN_HANDLED;
  143. }

  144. if( !get_cvar_num("fc_checkthwall") )
  145. return PLUGIN_HANDLED;

  146. /* check killer's aiming at first */
  147. new target,body;
  148. get_user_aiming(killer,target,body);
  149. if( target==victim )
  150. return PLUGIN_HANDLED;

  151. /* trace from kill's eye to victim's origin */
  152. new Float:vicOri[3],Float:kilOri[3],Float:viewOff[3],Float:hitOri[3];
  153. entity_get_vector(victim,EV_VEC_origin,vicOri);

  154. entity_get_vector(killer, EV_VEC_origin, kilOri);
  155. entity_get_vector(killer, EV_VEC_view_ofs, viewOff);
  156. kilOri[0]+=viewOff[0];
  157. kilOri[1]+=viewOff[1];
  158. kilOri[2]+=viewOff[2];

  159. if( victim==trace_line(killer, kilOri, vicOri, hitOri) )
  160. return PLUGIN_HANDLED;

  161. new kName[32];
  162. get_user_name(killer,kName,31);
  163. new str[512];
  164. new retV=checkPoint(killer,victim,kilOri,vicOri)
  165. if( retV ){
  166. format(str,511,"^x04【征战检测】^x03%s^x04看見您的[^x03%s^x04]",kName,g_bodyStr[retV])
  167. client_color(victim, killer, str);
  168. //client_print(victim,print_chat,"^x04%s^x01看見您^x04%s",kName,g_bodyStr[retV]);
  169. return PLUGIN_HANDLED;
  170. }

  171. //draws a beam form killer's eyes to the victim's hitplace
  172. VelocityByAim ( killer,floatround( vector_distance(kilOri,vicOri) ),hitOri);
  173. vicOri[0]=kilOri[0] + hitOri[0];
  174. vicOri[1]=kilOri[1] + hitOri[1];
  175. vicOri[2]=kilOri[2] + hitOri[2];

  176. /* if there is no wall,use following to get hit position: */
  177. //get_user_origin(killer,vicOri,3);

  178. new start[3],end[3];
  179. FVecIVec(kilOri,start);
  180. FVecIVec(vicOri,end);

  181. new players[32],num;
  182. get_players(players,num,"bc")
  183. for(new i=0;i<num;i++){
  184. if( is_user_connected(players) )
  185. drawBeam(players,start,end);
  186. }
  187. //drawBeam(victim,start,end);

  188. g_playerThWallWarn[killer]++;

  189. new vName[32];
  190. get_user_name(victim,vName,31);
  191. new str[512];

  192. format(str,511,"^x04【征战检测】^x03%s^x04使用^x03%s^x04穿牆殺死了^x03%s^x04(警告:^x03%d^x04次)",kName,weapon,vName,g_playerThWallWarn[killer])
  193. client_color(0, killer, str);
  194. if( get_cvar_num("fc_record") )
  195. recordEvent(str);

  196. //client_print(0,print_chat,"%s",str);
  197. //client_print(0,print_chat,"[FC]--->> [ Player %s killed %s with %s through the wall. (Warning: %d) ] ",kName,vName,weapon,g_playerThWallWarn[killer]);

  198. if( g_playerThWallWarn[killer]>=get_cvar_num("fc_thwallwarntime") ){
  199. g_startVoteType=1;
  200. InitVote(killer);
  201. g_playerThWallWarn[killer]=0;
  202. }


  203. return PLUGIN_HANDLED;
  204. }
  205. /*make 6 traces at the victim to check can the killer see the victim*/
  206. public checkPoint(killer,victim,Float:kilOri[3],Float:vicOri[3])
  207. {
  208. new isDuck=0,Float:hitVec[3];
  209. if( get_user_button (victim)IN_DUCK )
  210. isDuck=1;

  211. //------get head pos
  212. //new Float:H_reV[3];
  213. VelocityByAim (victim, 7 ,hitVec);
  214. hitVec[2]+=24;
  215. hitVec[0] += vicOri[0];
  216. hitVec[1] += vicOri[1];
  217. hitVec[2] += vicOri[2];
  218. if(isDuck)
  219. hitVec[2]+=5;//higher
  220. if( checkVisible(killer,victim,kilOri,hitVec) )
  221. return 1;
  222. //------get gun pos
  223. //new Float:G_reV[3]
  224. VelocityByAim (victim, 38 ,hitVec);
  225. hitVec[0] +=vicOri[0];
  226. hitVec[1] +=vicOri[1];
  227. hitVec[2] +=vicOri[2];
  228. hitVec[2]+=10;//higher
  229. if( checkVisible(killer,victim,kilOri,hitVec) )
  230. return 2;
复制代码

本帖子中包含更多资源

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

×
 楼主| 发表于 2011-8-28 10:31:24 | 显示全部楼层 来自 中国–四川–成都
接楼上

  1. //change the angle to get the origin of another check points
  2. new Float:ang[3]
  3. entity_get_vector(victim,EV_VEC_v_angle,ang)

  4. //turn left--to get left pos
  5. ang[1]+=90
  6. entity_set_vector(victim,EV_VEC_v_angle,ang)
  7. VelocityByAim (victim, 13 ,hitVec);
  8. hitVec[0] += vicOri[0];
  9. hitVec[1] += vicOri[1];
  10. hitVec[2] += vicOri[2]+6;
  11. if( checkVisible(killer,victim,kilOri,hitVec) )
  12. return 4;

  13. //turn back--to get back pos
  14. ang[1]+=90
  15. entity_set_vector(victim,EV_VEC_v_angle,ang)
  16. new backpos=10;
  17. if(isDuck)
  18. backpos+=10
  19. VelocityByAim (victim,backpos,hitVec);
  20. hitVec[0] +=vicOri[0];
  21. hitVec[1] +=vicOri[1];
  22. hitVec[2] +=vicOri[2];
  23. if(isDuck)
  24. hitVec[2]+=7;
  25. if( checkVisible(killer,victim,kilOri,hitVec) )
  26. return 3;

  27. //turn right--to get right pos
  28. ang[1]+=90
  29. entity_set_vector(victim,EV_VEC_v_angle,ang)
  30. VelocityByAim (victim, 13+4 ,hitVec);
  31. hitVec[0] += vicOri[0];
  32. hitVec[1] += vicOri[1];
  33. hitVec[2] += vicOri[2]+6;
  34. if( checkVisible(killer,victim,kilOri,hitVec) )
  35. return 5;

  36. //------get foot pos
  37. //new Float:F_reV[3];
  38. new footpos=34
  39. if(isDuck)
  40. footpos-=18;
  41. hitVec[0]=vicOri[0];
  42. hitVec[1]=vicOri[1];
  43. hitVec[2]=vicOri[2]-footpos;
  44. if( checkVisible(killer,victim,kilOri,hitVec) )
  45. return 6;
  46. return 0;
  47. }

  48. checkVisible(killer,victim,Float:startOri[3],Float:endOri[3])
  49. {
  50. new Float:hitOri[3];
  51. if( victim==trace_line(killer, startOri, endOri, hitOri) )
  52. return 1;
  53. else if( vector_distance(startOri,hitOri) == vector_distance(startOri,endOri) )
  54. return 1;

  55. return 0;
  56. }

  57. drawBeam(id,staPos[],endPos[])
  58. {
  59. message_begin(MSG_ONE, SVC_TEMPENTITY, {0, 0, 0}, id);
  60. // message_begin(MSG_ALL,SVC_TEMPENTITY)
  61. write_byte(0);
  62. write_coord(staPos[0]);
  63. write_coord(staPos[1]);
  64. write_coord(staPos[2]);
  65. write_coord(endPos[0]);
  66. write_coord(endPos[1]);
  67. write_coord(endPos[2]);
  68. write_short(dot);
  69. write_byte(1); //start frame
  70. write_byte(1); //frame rate in 0.1's
  71. write_byte(get_cvar_num("fc_beam_holdtime")); //life in 0.1's
  72. write_byte(10); //width
  73. write_byte(0); //noise
  74. write_byte(0); //r,g,b
  75. write_byte(255);
  76. write_byte(0);
  77. write_byte(200); //brightness
  78. write_byte(0); //scroll speed
  79. message_end();


  80. new size=20;
  81. message_begin(MSG_ONE, SVC_TEMPENTITY, {0, 0, 0}, id);
  82. // message_begin(MSG_ALL,SVC_TEMPENTITY)
  83. write_byte( 30 )
  84. write_coord( endPos[0] ) //startPos
  85. write_coord( endPos[1] )
  86. write_coord( endPos[2]-size )
  87. write_coord( endPos[0] ) //endPos
  88. write_coord( endPos[1] )
  89. write_coord( endPos[2]+size )
  90. write_short(get_cvar_num("fc_beam_holdtime"))
  91. write_byte(220) //r,g,b
  92. write_byte(20)
  93. write_byte(60)
  94. message_end()

  95. message_begin(MSG_ONE, SVC_TEMPENTITY, {0, 0, 0}, id);
  96. // message_begin(MSG_ALL,SVC_TEMPENTITY)
  97. write_byte( 30 )
  98. write_coord( endPos[0]-size ) //startPos
  99. write_coord( endPos[1] )
  100. write_coord( endPos[2] )
  101. write_coord( endPos[0]+size ) //endPos
  102. write_coord( endPos[1] )
  103. write_coord( endPos[2] )
  104. write_short(get_cvar_num("fc_beam_holdtime"))
  105. write_byte(220) //r,g,b
  106. write_byte(20)
  107. write_byte(60)
  108. message_end()

  109. message_begin(MSG_ONE, SVC_TEMPENTITY, {0, 0, 0}, id);
  110. // message_begin(MSG_ALL,SVC_TEMPENTITY)
  111. write_byte( 30 )
  112. write_coord( endPos[0] ) //startPos
  113. write_coord( endPos[1]-size )
  114. write_coord( endPos[2] )
  115. write_coord( endPos[0] ) //endPos
  116. write_coord( endPos[1]+size )
  117. write_coord( endPos[2] )
  118. write_short(get_cvar_num("fc_beam_holdtime"))
  119. write_byte(220) //r,g,b
  120. write_byte(20)
  121. write_byte(60)
  122. message_end()
  123. }
  124. excutePunish(id)
  125. {
  126. new cmdStr[64],useridStr[32];
  127. get_cvar_string("fc_cmdstr",cmdStr,63);
  128. num_to_str(get_user_userid(id),useridStr,31);
  129. replace(cmdStr, 63, "%userid%", useridStr);
  130. server_cmd(cmdStr);
  131. }
  132. recordEvent(Msg[])
  133. {
  134. new data[256];
  135. format(data,255,"%s [Map:%s]",Msg,curMap);
  136. log_to_file("FindCheater.log",data);
  137. //log_to_file("../configs/FindCheater.log",data);
  138. }
  139. /* ----------------------------- Vote ------------------------------ */
  140. public InitVote(target)
  141. {
  142. if( !is_user_connected(target) || is_user_admin(target) )
  143. return PLUGIN_HANDLED;

  144. if( !get_cvar_num("fc_startvote") ){
  145. excutePunish(target);
  146. return PLUGIN_HANDLED;
  147. }

  148. /* new Float:voting = get_cvar_float("amx_last_voting")
  149. if ( voting > get_gametime() )
  150. {
  151. new str[512];
  152. format(str,511,"^x04【征战提示】投票將延遲 ^x03%d ^x04秒",MAXHODESEC)
  153. client_color(0, 0, str);
  154. //client_print(0,print_chat,"投票將延遲 %d 秒",MAXHODESEC);
  155. set_task(MAXHODESEC*1.0,"InitVote",target)
  156. return PLUGIN_HANDLED;
  157. }*/

  158. new str[128];
  159. switch( g_startVoteType ){

  160. case 0: format(str,127," %d times surpassed the Speed limit",g_playerSpeedWarn[target]);
  161. case 1: format(str,127," %d times killed player through the wall",g_playerThWallWarn[target]);
  162. case 2: format(str,127," %d times killed player when he is blinding",g_playerFlashWarn[target]);
  163. }
  164. new menuBody[512],pname[32];
  165. get_user_name(target,pname,31);
  166. new len=format(menuBody,511,"\r 請問你 %s 是否作弊者 ? ^n",pname);
  167. len+=format(menuBody[len],511-len,"\d( %s )^n^n",str);
  168. len+=format(menuBody[len],511-len,"\w8. 是.他是作弊者 ! ^n");
  169. len+=format(menuBody[len],511-len,"\w9. 不是.他是射神 ! ^n");
  170. show_menu(0,KEY8|KEY9,menuBody,MAXHODESEC-1,"anyVoteMenu");

  171. /* new Float:vote_time = MAXHODESEC*1.0 + 2.0
  172. set_cvar_float("amx_last_voting", get_gametime() + vote_time)*/

  173. g_voteCount[0]=0;
  174. g_voteCount[1]=0;

  175. set_task(MAXHODESEC*1.0,"showResult",target);

  176. return PLUGIN_HANDLED
  177. }

  178. public actionMenu(id,key)
  179. {
  180. g_voteCount[key-7]++;

  181. new pname[32];
  182. get_user_name(id,pname,31);
  183. new str[512];
  184. format(str,511,"^x04【征战提示】^x03%s ^x04選擇了 ^x03%s",pname,g_voteResStr[key-7])
  185. client_color(0, id, str);
  186. //client_print(0,print_chat,"%s 選擇 %s",pname,g_voteResStr[key-7]);

  187. return PLUGIN_HANDLED
  188. }
  189. public showResult(target)
  190. {
  191. new str[512];
  192. new Float:result=0.0;
  193. result = ( g_voteCount[0]+g_voteCount[1] ) ? (float(g_voteCount[0]) / float( get_playersnum(0) ) ) : 0.0
  194. if( result>=get_cvar_float("fc_voterate") & is_user_connected(target) ){
  195. format(str,511,"^x04【征战提示】結果 ^x03%0.1f . ^x04是 ^x03%d . ^x04不是 ^x03%d .作弊者將會被懲罰!",result,g_voteCount[0],g_voteCount[1])
  196. client_color(0, id, str);
  197. //client_print(0,print_chat,"結果 %0.1f . 是 %d . 不是 %d .作弊者將會被懲罰!",result,g_voteCount[0],g_voteCount[1]);
  198. excutePunish(target);
  199. }
  200. else //client_print(0,print_chat,"結果 %0.1f . 是 %d . 不是 %d !",result,g_voteCount[0],g_voteCount[1]);
  201.      format(str,511,"^x04【征战提示】結果 ^x03%0.1f . ^x04是 ^x03%d . ^x04不是 ^x03%d !",result,g_voteCount[0],g_voteCount[1])
  202.      client_color(0, id, str);

  203. return PLUGIN_HANDLED;
  204. }
  205. /* ------------------ Info --------------------*/
  206. public disInfo(id)
  207. {
  208. const SIZE=1536
  209. new msg[SIZE+1],len=0,players[32],num,pname[32],t;
  210. get_players(players,num);
  211. //CS1.5
  212. /* if( get_cvar_num("fc_startvote") )
  213. len += format(msg[len], SIZE - len, "如果你的警告到了上限?!系統將自動投票!^n^n")
  214. else len += format(msg[len], SIZE - len, "如果你的警告到了上限?!您將被懲罰!^n^n")

  215. for(new i=0;i<num;i++){
  216. t=players;
  217. if( !g_playerThWallWarn[t] & !g_playerSpeedWarn[t] && !g_playerFlashWarn[t])
  218. continue;
  219. else {
  220. get_user_name(t,pname,31);
  221. len += format(msg[len], SIZE - len, "%s---->穿牆警告( %d )---->速度警告( %d )---->閃光警告( %d )^n^n",pname,g_playerThWallWarn[t],g_playerSpeedWarn[t],g_playerFlashWarn[t]);
  222. }
  223. }

  224. len += format(msg[len], SIZE - len, "^n穿牆警告到達極限 (穿牆警告) : %d^n",get_cvar_num("fc_thwallwarntime"));
  225. len += format(msg[len], SIZE - len, "速度警告到達極限 (速度警告) : %d^n",get_cvar_num("fc_speedwarntime"));
  226. len += format(msg[len], SIZE - len, "閃光警告到達極限 (閃光警告) : %d",get_cvar_num("fc_flashwarntime"));
  227. */

  228. //CS1.6
  229. len += format(msg[len], SIZE - len, "<html><body>");

  230. len += format(msg[len], SIZE - len, "<center>");
  231. len += format(msg[len], SIZE - len, "<table width=^"25%^" border=^"1^">");
  232. len += format(msg[len], SIZE - len, "<tr><td><b>玩家名稱</b></td><td><b>穿牆</b></td><td><b>速度警告</b></td><td><b>閃光警告</b></td>");

  233. for(new i=0;i<num;i++){
  234. t=players;
  235. if( !g_playerThWallWarn[t] & !g_playerSpeedWarn[t] && !g_playerFlashWarn[t])
  236. continue;
  237. else {
  238. get_user_name(t,pname,31);
  239. len += format(msg[len], SIZE - len, "<tr><td>%s</td><td>%d</td><td>%d</td><td>%d</td>",pname,g_playerThWallWarn[t],g_playerSpeedWarn[t],g_playerFlashWarn[t]);
  240. }
  241. }

  242. len += format(msg[len], SIZE - len, "</table>");
  243. len += format(msg[len], SIZE - len, "<p></p>");
  244. if( get_cvar_num("fc_startvote") )
  245. len += format(msg[len], SIZE - len, "<p><b>如果你的警告到達極限?!系統將會投票 !</b></p>");
  246. else len += format(msg[len], SIZE - len, "<p><b>如果你的警告到達極限?!您將會被懲罰 !</b></p>");
  247. len += format(msg[len], SIZE - len, "<p align=left><b>現在設置:</b></p>");
  248. len += format(msg[len], SIZE - len, "<p></p>");

  249. len += format(msg[len], SIZE - len, "<p align=left>穿牆警告極限(<b>穿牆警告</b>): %d</p>",get_cvar_num("fc_thwallwarntime"));
  250. len += format(msg[len], SIZE - len, "<p align=left>速度警告極限(<b>速度警告</b>): %d</p>",get_cvar_num("fc_speedwarntime"));
  251. len += format(msg[len], SIZE - len, "<p align=left>閃光警告極限(<b>閃光警告</b>): %d</p>",get_cvar_num("fc_flashwarntime"));

  252. show_motd ( id, msg, "FC Stat");

  253. return PLUGIN_CONTINUE;
  254. }
复制代码
回复

使用道具 举报

 楼主| 发表于 2011-8-28 10:33:05 | 显示全部楼层 来自 中国–四川–成都
接楼上

  1. //change the angle to get the origin of another check points
  2. new Float:ang[3]
  3. entity_get_vector(victim,EV_VEC_v_angle,ang)

  4. //turn left--to get left pos
  5. ang[1]+=90
  6. entity_set_vector(victim,EV_VEC_v_angle,ang)
  7. VelocityByAim (victim, 13 ,hitVec);
  8. hitVec[0] += vicOri[0];
  9. hitVec[1] += vicOri[1];
  10. hitVec[2] += vicOri[2]+6;
  11. if( checkVisible(killer,victim,kilOri,hitVec) )
  12. return 4;

  13. //turn back--to get back pos
  14. ang[1]+=90
  15. entity_set_vector(victim,EV_VEC_v_angle,ang)
  16. new backpos=10;
  17. if(isDuck)
  18. backpos+=10
  19. VelocityByAim (victim,backpos,hitVec);
  20. hitVec[0] +=vicOri[0];
  21. hitVec[1] +=vicOri[1];
  22. hitVec[2] +=vicOri[2];
  23. if(isDuck)
  24. hitVec[2]+=7;
  25. if( checkVisible(killer,victim,kilOri,hitVec) )
  26. return 3;

  27. //turn right--to get right pos
  28. ang[1]+=90
  29. entity_set_vector(victim,EV_VEC_v_angle,ang)
  30. VelocityByAim (victim, 13+4 ,hitVec);
  31. hitVec[0] += vicOri[0];
  32. hitVec[1] += vicOri[1];
  33. hitVec[2] += vicOri[2]+6;
  34. if( checkVisible(killer,victim,kilOri,hitVec) )
  35. return 5;

  36. //------get foot pos
  37. //new Float:F_reV[3];
  38. new footpos=34
  39. if(isDuck)
  40. footpos-=18;
  41. hitVec[0]=vicOri[0];
  42. hitVec[1]=vicOri[1];
  43. hitVec[2]=vicOri[2]-footpos;
  44. if( checkVisible(killer,victim,kilOri,hitVec) )
  45. return 6;
  46. return 0;
  47. }

  48. checkVisible(killer,victim,Float:startOri[3],Float:endOri[3])
  49. {
  50. new Float:hitOri[3];
  51. if( victim==trace_line(killer, startOri, endOri, hitOri) )
  52. return 1;
  53. else if( vector_distance(startOri,hitOri) == vector_distance(startOri,endOri) )
  54. return 1;

  55. return 0;
  56. }

  57. drawBeam(id,staPos[],endPos[])
  58. {
  59. message_begin(MSG_ONE, SVC_TEMPENTITY, {0, 0, 0}, id);
  60. // message_begin(MSG_ALL,SVC_TEMPENTITY)
  61. write_byte(0);
  62. write_coord(staPos[0]);
  63. write_coord(staPos[1]);
  64. write_coord(staPos[2]);
  65. write_coord(endPos[0]);
  66. write_coord(endPos[1]);
  67. write_coord(endPos[2]);
  68. write_short(dot);
  69. write_byte(1); //start frame
  70. write_byte(1); //frame rate in 0.1's
  71. write_byte(get_cvar_num("fc_beam_holdtime")); //life in 0.1's
  72. write_byte(10); //width
  73. write_byte(0); //noise
  74. write_byte(0); //r,g,b
  75. write_byte(255);
  76. write_byte(0);
  77. write_byte(200); //brightness
  78. write_byte(0); //scroll speed
  79. message_end();


  80. new size=20;
  81. message_begin(MSG_ONE, SVC_TEMPENTITY, {0, 0, 0}, id);
  82. // message_begin(MSG_ALL,SVC_TEMPENTITY)
  83. write_byte( 30 )
  84. write_coord( endPos[0] ) //startPos
  85. write_coord( endPos[1] )
  86. write_coord( endPos[2]-size )
  87. write_coord( endPos[0] ) //endPos
  88. write_coord( endPos[1] )
  89. write_coord( endPos[2]+size )
  90. write_short(get_cvar_num("fc_beam_holdtime"))
  91. write_byte(220) //r,g,b
  92. write_byte(20)
  93. write_byte(60)
  94. message_end()

  95. message_begin(MSG_ONE, SVC_TEMPENTITY, {0, 0, 0}, id);
  96. // message_begin(MSG_ALL,SVC_TEMPENTITY)
  97. write_byte( 30 )
  98. write_coord( endPos[0]-size ) //startPos
  99. write_coord( endPos[1] )
  100. write_coord( endPos[2] )
  101. write_coord( endPos[0]+size ) //endPos
  102. write_coord( endPos[1] )
  103. write_coord( endPos[2] )
  104. write_short(get_cvar_num("fc_beam_holdtime"))
  105. write_byte(220) //r,g,b
  106. write_byte(20)
  107. write_byte(60)
  108. message_end()

  109. message_begin(MSG_ONE, SVC_TEMPENTITY, {0, 0, 0}, id);
  110. // message_begin(MSG_ALL,SVC_TEMPENTITY)
  111. write_byte( 30 )
  112. write_coord( endPos[0] ) //startPos
  113. write_coord( endPos[1]-size )
  114. write_coord( endPos[2] )
  115. write_coord( endPos[0] ) //endPos
  116. write_coord( endPos[1]+size )
  117. write_coord( endPos[2] )
  118. write_short(get_cvar_num("fc_beam_holdtime"))
  119. write_byte(220) //r,g,b
  120. write_byte(20)
  121. write_byte(60)
  122. message_end()
  123. }
  124. excutePunish(id)
  125. {
  126. new cmdStr[64],useridStr[32];
  127. get_cvar_string("fc_cmdstr",cmdStr,63);
  128. num_to_str(get_user_userid(id),useridStr,31);
  129. replace(cmdStr, 63, "%userid%", useridStr);
  130. server_cmd(cmdStr);
  131. }
  132. recordEvent(Msg[])
  133. {
  134. new data[256];
  135. format(data,255,"%s [Map:%s]",Msg,curMap);
  136. log_to_file("FindCheater.log",data);
  137. //log_to_file("../configs/FindCheater.log",data);
  138. }
  139. /* ----------------------------- Vote ------------------------------ */
  140. public InitVote(target)
  141. {
  142. if( !is_user_connected(target) || is_user_admin(target) )
  143. return PLUGIN_HANDLED;

  144. if( !get_cvar_num("fc_startvote") ){
  145. excutePunish(target);
  146. return PLUGIN_HANDLED;
  147. }

  148. /* new Float:voting = get_cvar_float("amx_last_voting")
  149. if ( voting > get_gametime() )
  150. {
  151. new str[512];
  152. format(str,511,"^x04【征战提示】投票將延遲 ^x03%d ^x04秒",MAXHODESEC)
  153. client_color(0, 0, str);
  154. //client_print(0,print_chat,"投票將延遲 %d 秒",MAXHODESEC);
  155. set_task(MAXHODESEC*1.0,"InitVote",target)
  156. return PLUGIN_HANDLED;
  157. }*/

  158. new str[128];
  159. switch( g_startVoteType ){

  160. case 0: format(str,127," %d times surpassed the Speed limit",g_playerSpeedWarn[target]);
  161. case 1: format(str,127," %d times killed player through the wall",g_playerThWallWarn[target]);
  162. case 2: format(str,127," %d times killed player when he is blinding",g_playerFlashWarn[target]);
  163. }
  164. new menuBody[512],pname[32];
  165. get_user_name(target,pname,31);
  166. new len=format(menuBody,511,"\r 請問你 %s 是否作弊者 ? ^n",pname);
  167. len+=format(menuBody[len],511-len,"\d( %s )^n^n",str);
  168. len+=format(menuBody[len],511-len,"\w8. 是.他是作弊者 ! ^n");
  169. len+=format(menuBody[len],511-len,"\w9. 不是.他是射神 ! ^n");
  170. show_menu(0,KEY8|KEY9,menuBody,MAXHODESEC-1,"anyVoteMenu");

  171. /* new Float:vote_time = MAXHODESEC*1.0 + 2.0
  172. set_cvar_float("amx_last_voting", get_gametime() + vote_time)*/

  173. g_voteCount[0]=0;
  174. g_voteCount[1]=0;

  175. set_task(MAXHODESEC*1.0,"showResult",target);

  176. return PLUGIN_HANDLED
  177. }

  178. public actionMenu(id,key)
  179. {
  180. g_voteCount[key-7]++;

  181. new pname[32];
  182. get_user_name(id,pname,31);
  183. new str[512];
  184. format(str,511,"^x04【征战提示】^x03%s ^x04選擇了 ^x03%s",pname,g_voteResStr[key-7])
  185. client_color(0, id, str);
  186. //client_print(0,print_chat,"%s 選擇 %s",pname,g_voteResStr[key-7]);

  187. return PLUGIN_HANDLED
  188. }
  189. public showResult(target)
  190. {
  191. new str[512];
  192. new Float:result=0.0;
  193. result = ( g_voteCount[0]+g_voteCount[1] ) ? (float(g_voteCount[0]) / float( get_playersnum(0) ) ) : 0.0
  194. if( result>=get_cvar_float("fc_voterate") & is_user_connected(target) ){
  195. format(str,511,"^x04【征战提示】結果 ^x03%0.1f . ^x04是 ^x03%d . ^x04不是 ^x03%d .作弊者將會被懲罰!",result,g_voteCount[0],g_voteCount[1])
  196. client_color(0, id, str);
  197. //client_print(0,print_chat,"結果 %0.1f . 是 %d . 不是 %d .作弊者將會被懲罰!",result,g_voteCount[0],g_voteCount[1]);
  198. excutePunish(target);
  199. }
  200. else //client_print(0,print_chat,"結果 %0.1f . 是 %d . 不是 %d !",result,g_voteCount[0],g_voteCount[1]);
  201.      format(str,511,"^x04【征战提示】結果 ^x03%0.1f . ^x04是 ^x03%d . ^x04不是 ^x03%d !",result,g_voteCount[0],g_voteCount[1])
  202.      client_color(0, id, str);

  203. return PLUGIN_HANDLED;
  204. }
  205. /* ------------------ Info --------------------*/
  206. public disInfo(id)
  207. {
  208. const SIZE=1536
  209. new msg[SIZE+1],len=0,players[32],num,pname[32],t;
  210. get_players(players,num);
  211. //CS1.5
  212. /* if( get_cvar_num("fc_startvote") )
  213. len += format(msg[len], SIZE - len, "如果你的警告到了上限?!系統將自動投票!^n^n")
  214. else len += format(msg[len], SIZE - len, "如果你的警告到了上限?!您將被懲罰!^n^n")

  215. for(new i=0;i<num;i++){
  216. t=players;
  217. if( !g_playerThWallWarn[t] & !g_playerSpeedWarn[t] && !g_playerFlashWarn[t])
  218. continue;
  219. else {
  220. get_user_name(t,pname,31);
  221. len += format(msg[len], SIZE - len, "%s---->穿牆警告( %d )---->速度警告( %d )---->閃光警告( %d )^n^n",pname,g_playerThWallWarn[t],g_playerSpeedWarn[t],g_playerFlashWarn[t]);
  222. }
  223. }

  224. len += format(msg[len], SIZE - len, "^n穿牆警告到達極限 (穿牆警告) : %d^n",get_cvar_num("fc_thwallwarntime"));
  225. len += format(msg[len], SIZE - len, "速度警告到達極限 (速度警告) : %d^n",get_cvar_num("fc_speedwarntime"));
  226. len += format(msg[len], SIZE - len, "閃光警告到達極限 (閃光警告) : %d",get_cvar_num("fc_flashwarntime"));
  227. */

  228. //CS1.6
  229. len += format(msg[len], SIZE - len, "<html><body>");

  230. len += format(msg[len], SIZE - len, "<center>");
  231. len += format(msg[len], SIZE - len, "<table width=^"25%^" border=^"1^">");
  232. len += format(msg[len], SIZE - len, "<tr><td><b>玩家名稱</b></td><td><b>穿牆</b></td><td><b>速度警告</b></td><td><b>閃光警告</b></td>");

  233. for(new i=0;i<num;i++){
  234. t=players;
  235. if( !g_playerThWallWarn[t] & !g_playerSpeedWarn[t] && !g_playerFlashWarn[t])
  236. continue;
  237. else {
  238. get_user_name(t,pname,31);
  239. len += format(msg[len], SIZE - len, "<tr><td>%s</td><td>%d</td><td>%d</td><td>%d</td>",pname,g_playerThWallWarn[t],g_playerSpeedWarn[t],g_playerFlashWarn[t]);
  240. }
  241. }

  242. len += format(msg[len], SIZE - len, "</table>");
  243. len += format(msg[len], SIZE - len, "<p></p>");
  244. if( get_cvar_num("fc_startvote") )
  245. len += format(msg[len], SIZE - len, "<p><b>如果你的警告到達極限?!系統將會投票 !</b></p>");
  246. else len += format(msg[len], SIZE - len, "<p><b>如果你的警告到達極限?!您將會被懲罰 !</b></p>");
  247. len += format(msg[len], SIZE - len, "<p align=left><b>現在設置:</b></p>");
  248. len += format(msg[len], SIZE - len, "<p></p>");

  249. len += format(msg[len], SIZE - len, "<p align=left>穿牆警告極限(<b>穿牆警告</b>): %d</p>",get_cvar_num("fc_thwallwarntime"));
  250. len += format(msg[len], SIZE - len, "<p align=left>速度警告極限(<b>速度警告</b>): %d</p>",get_cvar_num("fc_speedwarntime"));
  251. len += format(msg[len], SIZE - len, "<p align=left>閃光警告極限(<b>閃光警告</b>): %d</p>",get_cvar_num("fc_flashwarntime"));

  252. show_motd ( id, msg, "FC Stat");

  253. return PLUGIN_CONTINUE;
  254. }
复制代码
回复

使用道具 举报

 楼主| 发表于 2011-8-28 10:34:09 | 显示全部楼层 来自 中国–四川–成都
接楼上

  1. //change the angle to get the origin of another check points
  2. new Float:ang[3]
  3. entity_get_vector(victim,EV_VEC_v_angle,ang)

  4. //turn left--to get left pos
  5. ang[1]+=90
  6. entity_set_vector(victim,EV_VEC_v_angle,ang)
  7. VelocityByAim (victim, 13 ,hitVec);
  8. hitVec[0] += vicOri[0];
  9. hitVec[1] += vicOri[1];
  10. hitVec[2] += vicOri[2]+6;
  11. if( checkVisible(killer,victim,kilOri,hitVec) )
  12. return 4;

  13. //turn back--to get back pos
  14. ang[1]+=90
  15. entity_set_vector(victim,EV_VEC_v_angle,ang)
  16. new backpos=10;
  17. if(isDuck)
  18. backpos+=10
  19. VelocityByAim (victim,backpos,hitVec);
  20. hitVec[0] +=vicOri[0];
  21. hitVec[1] +=vicOri[1];
  22. hitVec[2] +=vicOri[2];
  23. if(isDuck)
  24. hitVec[2]+=7;
  25. if( checkVisible(killer,victim,kilOri,hitVec) )
  26. return 3;

  27. //turn right--to get right pos
  28. ang[1]+=90
  29. entity_set_vector(victim,EV_VEC_v_angle,ang)
  30. VelocityByAim (victim, 13+4 ,hitVec);
  31. hitVec[0] += vicOri[0];
  32. hitVec[1] += vicOri[1];
  33. hitVec[2] += vicOri[2]+6;
  34. if( checkVisible(killer,victim,kilOri,hitVec) )
  35. return 5;

  36. //------get foot pos
  37. //new Float:F_reV[3];
  38. new footpos=34
  39. if(isDuck)
  40. footpos-=18;
  41. hitVec[0]=vicOri[0];
  42. hitVec[1]=vicOri[1];
  43. hitVec[2]=vicOri[2]-footpos;
  44. if( checkVisible(killer,victim,kilOri,hitVec) )
  45. return 6;
  46. return 0;
  47. }

  48. checkVisible(killer,victim,Float:startOri[3],Float:endOri[3])
  49. {
  50. new Float:hitOri[3];
  51. if( victim==trace_line(killer, startOri, endOri, hitOri) )
  52. return 1;
  53. else if( vector_distance(startOri,hitOri) == vector_distance(startOri,endOri) )
  54. return 1;

  55. return 0;
  56. }

  57. drawBeam(id,staPos[],endPos[])
  58. {
  59. message_begin(MSG_ONE, SVC_TEMPENTITY, {0, 0, 0}, id);
  60. // message_begin(MSG_ALL,SVC_TEMPENTITY)
  61. write_byte(0);
  62. write_coord(staPos[0]);
  63. write_coord(staPos[1]);
  64. write_coord(staPos[2]);
  65. write_coord(endPos[0]);
  66. write_coord(endPos[1]);
  67. write_coord(endPos[2]);
  68. write_short(dot);
  69. write_byte(1); //start frame
  70. write_byte(1); //frame rate in 0.1's
  71. write_byte(get_cvar_num("fc_beam_holdtime")); //life in 0.1's
  72. write_byte(10); //width
  73. write_byte(0); //noise
  74. write_byte(0); //r,g,b
  75. write_byte(255);
  76. write_byte(0);
  77. write_byte(200); //brightness
  78. write_byte(0); //scroll speed
  79. message_end();


  80. new size=20;
  81. message_begin(MSG_ONE, SVC_TEMPENTITY, {0, 0, 0}, id);
  82. // message_begin(MSG_ALL,SVC_TEMPENTITY)
  83. write_byte( 30 )
  84. write_coord( endPos[0] ) //startPos
  85. write_coord( endPos[1] )
  86. write_coord( endPos[2]-size )
  87. write_coord( endPos[0] ) //endPos
  88. write_coord( endPos[1] )
  89. write_coord( endPos[2]+size )
  90. write_short(get_cvar_num("fc_beam_holdtime"))
  91. write_byte(220) //r,g,b
  92. write_byte(20)
  93. write_byte(60)
  94. message_end()

  95. message_begin(MSG_ONE, SVC_TEMPENTITY, {0, 0, 0}, id);
  96. // message_begin(MSG_ALL,SVC_TEMPENTITY)
  97. write_byte( 30 )
  98. write_coord( endPos[0]-size ) //startPos
  99. write_coord( endPos[1] )
  100. write_coord( endPos[2] )
  101. write_coord( endPos[0]+size ) //endPos
  102. write_coord( endPos[1] )
  103. write_coord( endPos[2] )
  104. write_short(get_cvar_num("fc_beam_holdtime"))
  105. write_byte(220) //r,g,b
  106. write_byte(20)
  107. write_byte(60)
  108. message_end()

  109. message_begin(MSG_ONE, SVC_TEMPENTITY, {0, 0, 0}, id);
  110. // message_begin(MSG_ALL,SVC_TEMPENTITY)
  111. write_byte( 30 )
  112. write_coord( endPos[0] ) //startPos
  113. write_coord( endPos[1]-size )
  114. write_coord( endPos[2] )
  115. write_coord( endPos[0] ) //endPos
  116. write_coord( endPos[1]+size )
  117. write_coord( endPos[2] )
  118. write_short(get_cvar_num("fc_beam_holdtime"))
  119. write_byte(220) //r,g,b
  120. write_byte(20)
  121. write_byte(60)
  122. message_end()
  123. }
  124. excutePunish(id)
  125. {
  126. new cmdStr[64],useridStr[32];
  127. get_cvar_string("fc_cmdstr",cmdStr,63);
  128. num_to_str(get_user_userid(id),useridStr,31);
  129. replace(cmdStr, 63, "%userid%", useridStr);
  130. server_cmd(cmdStr);
  131. }
  132. recordEvent(Msg[])
  133. {
  134. new data[256];
  135. format(data,255,"%s [Map:%s]",Msg,curMap);
  136. log_to_file("FindCheater.log",data);
  137. //log_to_file("../configs/FindCheater.log",data);
  138. }
  139. /* ----------------------------- Vote ------------------------------ */
  140. public InitVote(target)
  141. {
  142. if( !is_user_connected(target) || is_user_admin(target) )
  143. return PLUGIN_HANDLED;

  144. if( !get_cvar_num("fc_startvote") ){
  145. excutePunish(target);
  146. return PLUGIN_HANDLED;
  147. }

  148. /* new Float:voting = get_cvar_float("amx_last_voting")
  149. if ( voting > get_gametime() )
  150. {
  151. new str[512];
  152. format(str,511,"^x04【征战提示】投票將延遲 ^x03%d ^x04秒",MAXHODESEC)
  153. client_color(0, 0, str);
  154. //client_print(0,print_chat,"投票將延遲 %d 秒",MAXHODESEC);
  155. set_task(MAXHODESEC*1.0,"InitVote",target)
  156. return PLUGIN_HANDLED;
  157. }*/

  158. new str[128];
  159. switch( g_startVoteType ){

  160. case 0: format(str,127," %d times surpassed the Speed limit",g_playerSpeedWarn[target]);
  161. case 1: format(str,127," %d times killed player through the wall",g_playerThWallWarn[target]);
  162. case 2: format(str,127," %d times killed player when he is blinding",g_playerFlashWarn[target]);
  163. }
  164. new menuBody[512],pname[32];
  165. get_user_name(target,pname,31);
  166. new len=format(menuBody,511,"\r 請問你 %s 是否作弊者 ? ^n",pname);
  167. len+=format(menuBody[len],511-len,"\d( %s )^n^n",str);
  168. len+=format(menuBody[len],511-len,"\w8. 是.他是作弊者 ! ^n");
  169. len+=format(menuBody[len],511-len,"\w9. 不是.他是射神 ! ^n");
  170. show_menu(0,KEY8|KEY9,menuBody,MAXHODESEC-1,"anyVoteMenu");

  171. /* new Float:vote_time = MAXHODESEC*1.0 + 2.0
  172. set_cvar_float("amx_last_voting", get_gametime() + vote_time)*/

  173. g_voteCount[0]=0;
  174. g_voteCount[1]=0;

  175. set_task(MAXHODESEC*1.0,"showResult",target);

  176. return PLUGIN_HANDLED
  177. }

  178. public actionMenu(id,key)
  179. {
  180. g_voteCount[key-7]++;

  181. new pname[32];
  182. get_user_name(id,pname,31);
  183. new str[512];
  184. format(str,511,"^x04【征战提示】^x03%s ^x04選擇了 ^x03%s",pname,g_voteResStr[key-7])
  185. client_color(0, id, str);
  186. //client_print(0,print_chat,"%s 選擇 %s",pname,g_voteResStr[key-7]);

  187. return PLUGIN_HANDLED
  188. }
  189. public showResult(target)
  190. {
  191. new str[512];
  192. new Float:result=0.0;
  193. result = ( g_voteCount[0]+g_voteCount[1] ) ? (float(g_voteCount[0]) / float( get_playersnum(0) ) ) : 0.0
  194. if( result>=get_cvar_float("fc_voterate") & is_user_connected(target) ){
  195. format(str,511,"^x04【征战提示】結果 ^x03%0.1f . ^x04是 ^x03%d . ^x04不是 ^x03%d .作弊者將會被懲罰!",result,g_voteCount[0],g_voteCount[1])
  196. client_color(0, id, str);
  197. //client_print(0,print_chat,"結果 %0.1f . 是 %d . 不是 %d .作弊者將會被懲罰!",result,g_voteCount[0],g_voteCount[1]);
  198. excutePunish(target);
  199. }
  200. else //client_print(0,print_chat,"結果 %0.1f . 是 %d . 不是 %d !",result,g_voteCount[0],g_voteCount[1]);
  201.      format(str,511,"^x04【征战提示】結果 ^x03%0.1f . ^x04是 ^x03%d . ^x04不是 ^x03%d !",result,g_voteCount[0],g_voteCount[1])
  202.      client_color(0, id, str);

  203. return PLUGIN_HANDLED;
  204. }
  205. /* ------------------ Info --------------------*/
  206. public disInfo(id)
  207. {
  208. const SIZE=1536
  209. new msg[SIZE+1],len=0,players[32],num,pname[32],t;
  210. get_players(players,num);
  211. //CS1.5
  212. /* if( get_cvar_num("fc_startvote") )
  213. len += format(msg[len], SIZE - len, "如果你的警告到了上限?!系統將自動投票!^n^n")
  214. else len += format(msg[len], SIZE - len, "如果你的警告到了上限?!您將被懲罰!^n^n")

  215. for(new i=0;i<num;i++){
  216. t=players;
  217. if( !g_playerThWallWarn[t] & !g_playerSpeedWarn[t] && !g_playerFlashWarn[t])
  218. continue;
  219. else {
  220. get_user_name(t,pname,31);
  221. len += format(msg[len], SIZE - len, "%s---->穿牆警告( %d )---->速度警告( %d )---->閃光警告( %d )^n^n",pname,g_playerThWallWarn[t],g_playerSpeedWarn[t],g_playerFlashWarn[t]);
  222. }
  223. }

  224. len += format(msg[len], SIZE - len, "^n穿牆警告到達極限 (穿牆警告) : %d^n",get_cvar_num("fc_thwallwarntime"));
  225. len += format(msg[len], SIZE - len, "速度警告到達極限 (速度警告) : %d^n",get_cvar_num("fc_speedwarntime"));
  226. len += format(msg[len], SIZE - len, "閃光警告到達極限 (閃光警告) : %d",get_cvar_num("fc_flashwarntime"));
  227. */

  228. //CS1.6
  229. len += format(msg[len], SIZE - len, "<html><body>");

  230. len += format(msg[len], SIZE - len, "<center>");
  231. len += format(msg[len], SIZE - len, "<table width=^"25%^" border=^"1^">");
  232. len += format(msg[len], SIZE - len, "<tr><td><b>玩家名稱</b></td><td><b>穿牆</b></td><td><b>速度警告</b></td><td><b>閃光警告</b></td>");

  233. for(new i=0;i<num;i++){
  234. t=players;
  235. if( !g_playerThWallWarn[t] & !g_playerSpeedWarn[t] && !g_playerFlashWarn[t])
  236. continue;
  237. else {
  238. get_user_name(t,pname,31);
  239. len += format(msg[len], SIZE - len, "<tr><td>%s</td><td>%d</td><td>%d</td><td>%d</td>",pname,g_playerThWallWarn[t],g_playerSpeedWarn[t],g_playerFlashWarn[t]);
  240. }
  241. }

  242. len += format(msg[len], SIZE - len, "</table>");
  243. len += format(msg[len], SIZE - len, "<p></p>");
  244. if( get_cvar_num("fc_startvote") )
  245. len += format(msg[len], SIZE - len, "<p><b>如果你的警告到達極限?!系統將會投票 !</b></p>");
  246. else len += format(msg[len], SIZE - len, "<p><b>如果你的警告到達極限?!您將會被懲罰 !</b></p>");
  247. len += format(msg[len], SIZE - len, "<p align=left><b>現在設置:</b></p>");
  248. len += format(msg[len], SIZE - len, "<p></p>");

  249. len += format(msg[len], SIZE - len, "<p align=left>穿牆警告極限(<b>穿牆警告</b>): %d</p>",get_cvar_num("fc_thwallwarntime"));
  250. len += format(msg[len], SIZE - len, "<p align=left>速度警告極限(<b>速度警告</b>): %d</p>",get_cvar_num("fc_speedwarntime"));
  251. len += format(msg[len], SIZE - len, "<p align=left>閃光警告極限(<b>閃光警告</b>): %d</p>",get_cvar_num("fc_flashwarntime"));

  252. show_motd ( id, msg, "FC Stat");

  253. return PLUGIN_CONTINUE;
  254. }
复制代码
回复

使用道具 举报

 楼主| 发表于 2011-8-28 10:36:42 | 显示全部楼层 来自 中国–四川–成都
编译错误如下:
  1. //AMXXPC compile.exe
  2. // by the AMX Mod X Dev Team


  3. //// findCheater.sma
  4. // C:\Documents and Settings\Administrator\桌面\scripting\findCheater.sma(131) :
  5. error 001: expected token: ";", but found "("
  6. // C:\Documents and Settings\Administrator\桌面\scripting\findCheater.sma(131 --
  7. 132) : warning 215: expression has no effect
  8. // C:\Documents and Settings\Administrator\桌面\scripting\findCheater.sma(132) :
  9. warning 209: function "entity_is_on_ground" should return a value
  10. // C:\Documents and Settings\Administrator\桌面\scripting\findCheater.sma(224) :
  11. error 035: argument type mismatch (argument 1)
  12. // C:\Documents and Settings\Administrator\桌面\scripting\findCheater.sma(225) :
  13. error 035: argument type mismatch (argument 1)
  14. // C:\Documents and Settings\Administrator\桌面\scripting\findCheater.sma(233) :
  15. error 021: symbol already defined: "str"
  16. // C:\Documents and Settings\Administrator\桌面\scripting\findCheater.sma(256) :
  17. error 001: expected token: ")", but found "("
  18. // C:\Documents and Settings\Administrator\桌面\scripting\findCheater.sma(256) :
  19. warning 215: expression has no effect
  20. // C:\Documents and Settings\Administrator\桌面\scripting\findCheater.sma(256) :
  21. error 001: expected token: ";", but found ")"
  22. // C:\Documents and Settings\Administrator\桌面\scripting\findCheater.sma(256) :
  23. error 029: invalid expression, assumed zero
  24. // C:\Documents and Settings\Administrator\桌面\scripting\findCheater.sma(256) :
  25. fatal error 107: too many error messages on one line
  26. //
  27. // Compilation aborted.
  28. // 8 Errors.
  29. // Could not locate output file C:\Documents and Settings\Administrator\桌面\scr
  30. ipting\compiled\findCheater.amx (compile failed).
  31. //
  32. // Compilation Time: 0.66 sec
  33. // ----------------------------------------

  34. Press enter to exit ...
复制代码
编译环境:AMXX 1.8.1 .inc齐全
回复

使用道具 举报

发表于 2011-8-28 15:43:53 | 显示全部楼层 来自 中国–广东–广州
你发代码也不是这样发的吧。。。。既然太长就直接打包上来有那么难吗
回复

使用道具 举报

发表于 2011-8-28 15:44:02 | 显示全部楼层 来自 中国–广东–广州
你发得舒服人家看得蛋疼
回复

使用道具 举报

 楼主| 发表于 2011-8-29 09:58:54 | 显示全部楼层 来自 中国–四川–成都
你发得舒服人家看得蛋疼
rsdtt 发表于 2011-8-28 15:44

r版,源码在一楼附件,谢谢。下次不在还样发了,也是想为大家节约DTB啊
回复

使用道具 举报

发表于 2011-8-29 11:29:10 | 显示全部楼层 来自 中国–广东–广州
return entity_get_int(entity, EV_INT_flags) & FL_ONGROUND

131行尝试这样改一下
回复

使用道具 举报

发表于 2011-8-30 09:10:42 | 显示全部楼层 来自 中国–山东–枣庄
这么大的一个插件得消耗多少内存资源啊
回复

使用道具 举报

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

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