hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.05.23. 20:21



Jelenlévő felhasználók

Jelenleg 161 felhasználó van jelen :: 0 regisztrált, 0 rejtett és 161 vendég

A legtöbb felhasználó (1565 fő) 2020.11.21. 11:26-kor tartózkodott itt.

Regisztrált felhasználók: nincs regisztrált felhasználó az elmúlt 5 percben aktív felhasználók alapján

Utoljára aktív
Ahhoz hogy lásd ki volt utoljára aktív, be kell jelentkezned.



Az oldal teljeskörű
használatához regisztrálj.

Regisztráció

Kereső


Új téma nyitása  Hozzászólás a témához  [ 2 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: Deathrun free
HozzászólásElküldve: 2014.10.20. 18:29 
Offline
Jómunkásember

Csatlakozott: 2014.08.22. 22:10
Hozzászólások: 477
Megköszönt másnak: 43 alkalommal
Megköszönték neki: 8 alkalommal
Sziasztok! ezt valaki át írná úgy hogy ne kelljen VOTE-zni (szavazni) ? köszi megy a gomb!
SMA Forráskód: [ Mindet kijelol ]
  1. #include < amxmodx >
  2. #include < cstrike >
  3. #include < fakemeta >
  4. #include < hamsandwich >
  5.  
  6. const m_toggle_state = 41;
  7.  
  8. #define TASK_VOTE 237439
  9.  
  10. enum _:VOTES {
  11. VOTE_YES,
  12. VOTE_NO
  13. };
  14.  
  15. new g_iVotes[ VOTES ];
  16. new bool:g_bVoted[ 33 ];
  17. new bool:g_bFreeRound;
  18. new bool:g_bWillFree;
  19. new bool:g_bVoting;
  20. new g_iCountdown;
  21. new g_iRounds;
  22. new g_iPrinted;
  23. new g_iMenuID;
  24. new g_iMaxplayers;
  25. new g_iMsgSayText;
  26. new g_pWaitRounds;
  27.  
  28. public plugin_init( ) {
  29. new const VERSION[ ] = "1.0";
  30.  
  31. register_plugin( "Deathrun: Free Round", VERSION, "xPaw" );
  32.  
  33. new p = register_cvar( "deathrun_freeround", VERSION, FCVAR_SERVER | FCVAR_SPONLY );
  34. set_pcvar_string( p, VERSION );
  35.  
  36. g_pWaitRounds = register_cvar( "freerun_wait_rounds", "5" );
  37. g_iMaxplayers = get_maxplayers( );
  38. g_iMsgSayText = get_user_msgid( "SayText" );
  39. g_iMenuID = register_menuid( "DrunFreeRoundVote" );
  40.  
  41. register_menucmd( g_iMenuID, ( MENU_KEY_1 | MENU_KEY_2 | MENU_KEY_0 ), "HandleVote" );
  42.  
  43. register_clcmd( "say /free", "CmdFreeRound" );
  44. register_clcmd( "say /freeround", "CmdFreeRound" );
  45.  
  46. RegisterHam( Ham_Use, "func_rot_button", "FwdHamUse_Button" );
  47. RegisterHam( Ham_Use, "func_button", "FwdHamUse_Button" );
  48. RegisterHam( Ham_Use, "button_target", "FwdHamUse_Button" );
  49.  
  50. register_event( "CurWeapon", "EventCurWeapon", "be", "1=1", "2!29" );
  51. register_event( "HLTV", "EventNewRound", "a", "1=0", "2=0" );
  52. register_event( "TextMsg", "EventRestart", "a", "2&#Game_C", "2&#Game_w" );
  53. }
  54.  
  55. public EventNewRound( ) {
  56. if( g_bFreeRound ) {
  57. g_bFreeRound = false;
  58. g_iRounds = 0;
  59. g_iPrinted = 0;
  60.  
  61. return;
  62. }
  63. else if( g_bWillFree ) {
  64. g_iRounds = 0;
  65. g_iPrinted = 0;
  66. g_bWillFree = false;
  67. g_bFreeRound = true;
  68.  
  69. set_task( 2.0, "PrintMessage" );
  70.  
  71. return;
  72. }
  73.  
  74. g_iRounds++;
  75.  
  76. if( g_iPrinted < 4 && g_iRounds >= get_pcvar_num( g_pWaitRounds ) ) {
  77. GreenPrint( 0, "This server is using^3 Deathrun Free Round System^1 by^4 xPaw^1, say^4 /free^1 to start vote!" );
  78.  
  79. g_iPrinted++;
  80. }
  81. }
  82.  
  83. public EventRestart( ) {
  84. g_bFreeRound = false;
  85. g_bWillFree = false;
  86. g_bVoting = false;
  87. g_iPrinted = 0;
  88. g_iRounds = 0;
  89.  
  90. remove_task( TASK_VOTE );
  91. }
  92.  
  93. public EventCurWeapon( id )
  94. if( g_bFreeRound )
  95. engclient_cmd( id, "weapon_knife" );
  96.  
  97. public CmdFreeRound( id ) {
  98. if( cs_get_user_team( id ) != CS_TEAM_T ) {
  99. GreenPrint( id, "This command is only for terrorists!" );
  100.  
  101. return PLUGIN_CONTINUE;
  102. }
  103. else if( g_bFreeRound ) {
  104. GreenPrint( id, "It is free round already!" );
  105.  
  106. return PLUGIN_CONTINUE;
  107. }
  108. else if( g_bVoting ) {
  109. GreenPrint( id, "The voting is already in process!" );
  110.  
  111. return PLUGIN_CONTINUE;
  112. }
  113. else if( g_bWillFree ) {
  114. GreenPrint( id, "Next round will be free! Vote is over!" );
  115.  
  116. return PLUGIN_CONTINUE;
  117. }
  118.  
  119. new iWaitRounds = get_pcvar_num( g_pWaitRounds ) - g_iRounds;
  120.  
  121. if( iWaitRounds > 0 ) {
  122. GreenPrint( id, "You need to wait^3 %i^1 rounds to start vote!", iWaitRounds );
  123.  
  124. return PLUGIN_CONTINUE;
  125. }
  126.  
  127. new szName[ 32 ];
  128. get_user_name( id, szName, 31 );
  129.  
  130. GreenPrint( 0, "Vote has been started by^3 %s^1.", szName );
  131.  
  132. set_hudmessage( 222, 70, 0, -1.0, 0.3, 1, 3.0, 3.0, 2.0, 1.0, -1 );
  133. show_hudmessage( 0, "Free round vote has been started by %s^nVoting Will begin shortly.", szName );
  134.  
  135. g_iVotes[ VOTE_YES ] = 0;
  136. g_iVotes[ VOTE_NO ] = 0;
  137. g_iRounds = 0;
  138. g_bVoting = true;
  139. g_iPrinted = 0;
  140. g_bWillFree = false;
  141.  
  142. arrayset( g_bVoted, false, 32 );
  143.  
  144. remove_task( TASK_VOTE );
  145. g_iCountdown = 15;
  146.  
  147. set_task( 3.5, "PreTask", TASK_VOTE );
  148.  
  149. return PLUGIN_CONTINUE;
  150. }
  151.  
  152. public PrintMessage( ) {
  153. GreenPrint( 0, "It is a^4 Free round^1, no guns, no traps!" );
  154.  
  155. set_hudmessage( 0, 90, 0, -1.0, 0.35, 1, 3.0, 3.0, 2.0, 1.0, -1 );
  156. show_hudmessage( 0, "FREE ROUND!" );
  157. }
  158.  
  159. public PreTask( ) {
  160. remove_task( TASK_VOTE );
  161.  
  162. set_task( 1.0, "TaskVoteTimer", TASK_VOTE, _, _, "b" );
  163. }
  164.  
  165. public TaskVoteTimer( ) {
  166. g_iCountdown--;
  167.  
  168. if ( !g_iCountdown ) {
  169. remove_task( TASK_VOTE );
  170.  
  171. g_bVoting = false;
  172.  
  173. new iVotes, iHighVotes, iHighVotesID;
  174.  
  175. for( new i; i < VOTES; i++ ) {
  176. iVotes = g_iVotes[ i ];
  177.  
  178. if( iVotes >= iHighVotes ) {
  179. iHighVotes = iVotes;
  180. iHighVotesID = i;
  181. }
  182. }
  183.  
  184. if( iHighVotes > 0 ) {
  185. if( iHighVotesID == VOTE_YES )
  186. g_bWillFree = true;
  187.  
  188. GreenPrint( 0, "Vote is over. %s^1 [^3 %i^1 votes (^4%i%%) ^1]", g_bWillFree ? "Next round will be free!" : "Next round won't be free!", iHighVotes, GetPercent( g_iVotes[ iHighVotesID ], g_iVotes[ VOTE_YES ] + g_iVotes[ VOTE_NO ] ) );
  189. } else
  190. GreenPrint( 0, "Vote is over. No one voted." );
  191.  
  192. for( new i = 1; i <= g_iMaxplayers; i++ )
  193. if( is_user_connected( i ) )
  194. ShowVoteMenu( i, 1 );
  195. } else {
  196. for( new i = 1; i <= g_iMaxplayers; i++ )
  197. if( is_user_connected( i ) )
  198. ShowVoteMenu( i, 0 );
  199. }
  200. }
  201.  
  202. ShowVoteMenu( id, bResults = 0 ) {
  203. new iMenu = GetUserMenu( id );
  204.  
  205. if( ( iMenu && iMenu != g_iMenuID ) && g_iCountdown <= 14 )
  206. return;
  207.  
  208. menu_cancel( id ); // Radios and other piece of shit bug fix <!-- s:D --><img src=\"{SMILIES_PATH}/icon_e_biggrin.gif\" alt=\":D\" title=\"nagyon boldog\" /><!-- s:D -->
  209.  
  210. new szMenu[ 196 ], iLen;
  211.  
  212. if( bResults )
  213. iLen = formatex( szMenu, charsmax( szMenu ), "\rResults of the vote:^n^n" );
  214. else
  215. iLen = formatex( szMenu, charsmax( szMenu ), "\rDo you want a free round?^n^n" );
  216.  
  217. new iVotesTotal = g_iVotes[ VOTE_YES ] + g_iVotes[ VOTE_NO ];
  218.  
  219. iLen += formatex( szMenu[ iLen ], charsmax( szMenu ) - 1, "\r1. \wYes \d(%i%%)^n", GetPercent( g_iVotes[ VOTE_YES ], iVotesTotal ) );
  220. iLen += formatex( szMenu[ iLen ], charsmax( szMenu ) - 1, "\r2. \wNo \d(%i%%)^n^n", GetPercent( g_iVotes[ VOTE_NO ], iVotesTotal ) );
  221.  
  222. if( bResults ) {
  223. if( g_bWillFree )
  224. iLen += formatex( szMenu[ iLen ], charsmax( szMenu ) - 1, " \yNext round will be free!" );
  225. else {
  226. if( !iVotesTotal )
  227. iLen += formatex( szMenu[ iLen ], charsmax( szMenu ) - 1, " \yNo one voted!" );
  228. }
  229.  
  230. show_menu( id, ( MENU_KEY_1 | MENU_KEY_2 | MENU_KEY_0 ), szMenu, -1, "DrunFreeRoundVote" );
  231.  
  232. set_task( 5.0, "CloseMenu", id );
  233. } else {
  234. iLen += formatex( szMenu[ iLen ], charsmax( szMenu ) - 1, " \dseconds remaining: \r%i", g_iCountdown );
  235.  
  236. show_menu( id, ( MENU_KEY_1 | MENU_KEY_2 ), szMenu, -1, "DrunFreeRoundVote" );
  237. }
  238. }
  239.  
  240. public CloseMenu( id )
  241. if( GetUserMenu( id ) == g_iMenuID )
  242. client_cmd( id, "slot1" );
  243.  
  244. GetUserMenu( id ) {
  245. new iMenu, iKeys;
  246. get_user_menu( id, iMenu, iKeys );
  247.  
  248. return iMenu;
  249. }
  250.  
  251. public HandleVote( id, iKey ) {
  252. if( !g_bVoting || !task_exists( TASK_VOTE ) )
  253. return;
  254.  
  255. if( g_bVoted[ id ] ) {
  256. ShowVoteMenu( id, 0 );
  257.  
  258. return;
  259. }
  260.  
  261. if( iKey > 1 )
  262. return;
  263.  
  264. new iVotes = ( /* get_user_flags( id ) & ADMIN_KICK ||*/ get_user_team( id ) == 1 ) ? 2 : 1;
  265.  
  266. g_bVoted[ id ] = true;
  267. g_iVotes[ iKey ] += iVotes;
  268.  
  269. new szName[ 32 ];
  270. get_user_name( id, szName, 31 );
  271.  
  272. GreenPrint( 0, "^3%s^1 voted^4 %s^1. [^4+%i^1 vote%s]", szName, iKey == VOTE_YES ? "for" : "against", iVotes, iVotes == 1 ? "" : "s" );
  273.  
  274. ShowVoteMenu( id, 0 );
  275. }
  276.  
  277. public FwdHamUse_Button( iEntity, id, iActivator, iUseType, Float:flValue ) {
  278. if( g_bFreeRound && iUseType == 2 && flValue == 1.0 && is_user_alive( id )
  279. && get_user_team( id ) == 1 && get_pdata_int( iEntity, m_toggle_state, 4 ) == 1 ) {
  280. /* Oh hi this code actually happen! <!-- s:D --><img src=\"{SMILIES_PATH}/icon_e_biggrin.gif\" alt=\":D\" title=\"nagyon boldog\" /><!-- s:D --> */
  281.  
  282. set_hudmessage( 0, 100, 255, -1.0, 0.25, 0, 2.0, 2.0, 0.2, 0.2, 3 );
  283. show_hudmessage( id, "It is free round!^nYou can't use buttons!" );
  284.  
  285. return HAM_SUPERCEDE;
  286. }
  287.  
  288. return HAM_IGNORED;
  289. }
  290.  
  291. GetPercent( is, of ) // Brad
  292. return ( of != 0 ) ? floatround( floatmul( float( is ) / float( of ), 100.0 ) ) : 0;
  293.  
  294. GreenPrint( id, const message[ ], any:... ) {
  295. static szMessage[ 192 ], iLen;
  296. if( !iLen )
  297. iLen = formatex( szMessage, 191, "^4[Deathrun FreeRound]^1 " );
  298.  
  299. vformat( szMessage[ iLen ], 191 - iLen, message, 3 );
  300.  
  301. message_begin( id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, g_iMsgSayText, _, id );
  302. write_byte( id ? id : 1 );
  303. write_string( szMessage );
  304. message_end( );
  305.  
  306. return 1;
  307. }

_________________
Soha se késő megköszönni! :)


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Deathrun free
HozzászólásElküldve: 2014.10.21. 19:18 
Offline
Beavatott
Avatar

Csatlakozott: 2014.10.12. 09:18
Hozzászólások: 71
Megköszönték neki: 12 alkalommal
Elvileg CVAR -al állítható: freerun_wait_rounds "0" Írd bele az amxx.cfg be.

vagy:

SMA Forráskód: [ Mindet kijelol ]
  1. #include < cstrike >
  2. #include < fakemeta >
  3. #include < hamsandwich >
  4.  
  5. const m_toggle_state = 41;
  6.  
  7. #define TASK_VOTE 237439
  8.  
  9. enum _:VOTES {
  10. VOTE_YES,
  11. VOTE_NO
  12. };
  13.  
  14. new g_iVotes[ VOTES ];
  15. new bool:g_bVoted[ 33 ];
  16. new bool:g_bFreeRound;
  17. new bool:g_bWillFree;
  18. new bool:g_bVoting;
  19. new g_iCountdown;
  20. new g_iRounds;
  21. new g_iPrinted;
  22. new g_iMenuID;
  23. new g_iMaxplayers;
  24. new g_iMsgSayText;
  25. new g_pWaitRounds;
  26.  
  27. public plugin_init( ) {
  28. new const VERSION[ ] = "1.0";
  29.  
  30. register_plugin( "Deathrun: Free Round", VERSION, "xPaw" );
  31.  
  32. new p = register_cvar( "deathrun_freeround", VERSION, FCVAR_SERVER | FCVAR_SPONLY );
  33. set_pcvar_string( p, VERSION );
  34.  
  35. g_pWaitRounds = register_cvar( "freerun_wait_rounds", "0" );
  36. g_iMaxplayers = get_maxplayers( );
  37. g_iMsgSayText = get_user_msgid( "SayText" );
  38. g_iMenuID = register_menuid( "DrunFreeRoundVote" );
  39.  
  40. register_menucmd( g_iMenuID, ( MENU_KEY_1 | MENU_KEY_2 | MENU_KEY_0 ), "HandleVote" );
  41.  
  42. register_clcmd( "say /free", "CmdFreeRound" );
  43. register_clcmd( "say /freeround", "CmdFreeRound" );
  44.  
  45. RegisterHam( Ham_Use, "func_rot_button", "FwdHamUse_Button" );
  46. RegisterHam( Ham_Use, "func_button", "FwdHamUse_Button" );
  47. RegisterHam( Ham_Use, "button_target", "FwdHamUse_Button" );
  48.  
  49. register_event( "CurWeapon", "EventCurWeapon", "be", "1=1", "2!29" );
  50. register_event( "HLTV", "EventNewRound", "a", "1=0", "2=0" );
  51. register_event( "TextMsg", "EventRestart", "a", "2&#Game_C", "2&#Game_w" );
  52. }
  53.  
  54. public EventNewRound( ) {
  55. if( g_bFreeRound ) {
  56. g_bFreeRound = false;
  57. g_iRounds = 0;
  58. g_iPrinted = 0;
  59.  
  60. return;
  61. }
  62. else if( g_bWillFree ) {
  63. g_iRounds = 0;
  64. g_iPrinted = 0;
  65. g_bWillFree = false;
  66. g_bFreeRound = true;
  67.  
  68. set_task( 2.0, "PrintMessage" );
  69.  
  70. return;
  71. }
  72.  
  73. g_iRounds++;
  74.  
  75. if( g_iPrinted < 4 && g_iRounds >= get_pcvar_num( g_pWaitRounds ) ) {
  76. GreenPrint( 0, "This server is using^3 Deathrun Free Round System^1 by^4 xPaw^1, say^4 /free^1 to start vote!" );
  77.  
  78. g_iPrinted++;
  79. }
  80. }
  81.  
  82. public EventRestart( ) {
  83. g_bFreeRound = false;
  84. g_bWillFree = false;
  85. g_bVoting = false;
  86. g_iPrinted = 0;
  87. g_iRounds = 0;
  88.  
  89. remove_task( TASK_VOTE );
  90. }
  91.  
  92. public EventCurWeapon( id )
  93. if( g_bFreeRound )
  94. engclient_cmd( id, "weapon_knife" );
  95.  
  96. public CmdFreeRound( id ) {
  97. if( cs_get_user_team( id ) != CS_TEAM_T ) {
  98. GreenPrint( id, "This command is only for terrorists!" );
  99.  
  100. return PLUGIN_CONTINUE;
  101. }
  102. else if( g_bFreeRound ) {
  103. GreenPrint( id, "It is free round already!" );
  104.  
  105. return PLUGIN_CONTINUE;
  106. }
  107. else if( g_bVoting ) {
  108. GreenPrint( id, "The voting is already in process!" );
  109.  
  110. return PLUGIN_CONTINUE;
  111. }
  112. else if( g_bWillFree ) {
  113. GreenPrint( id, "Next round will be free! Vote is over!" );
  114.  
  115. return PLUGIN_CONTINUE;
  116. }
  117.  
  118. new iWaitRounds = get_pcvar_num( g_pWaitRounds ) - g_iRounds;
  119.  
  120. if( iWaitRounds > 0 ) {
  121. GreenPrint( id, "You need to wait^3 %i^1 rounds to start vote!", iWaitRounds );
  122.  
  123. return PLUGIN_CONTINUE;
  124. }
  125.  
  126. new szName[ 32 ];
  127. get_user_name( id, szName, 31 );
  128.  
  129. GreenPrint( 0, "Vote has been started by^3 %s^1.", szName );
  130.  
  131. set_hudmessage( 222, 70, 0, -1.0, 0.3, 1, 3.0, 3.0, 2.0, 1.0, -1 );
  132. show_hudmessage( 0, "Free round vote has been started by %s^nVoting Will begin shortly.", szName );
  133.  
  134. g_iVotes[ VOTE_YES ] = 0;
  135. g_iVotes[ VOTE_NO ] = 0;
  136. g_iRounds = 0;
  137. g_bVoting = true;
  138. g_iPrinted = 0;
  139. g_bWillFree = false;
  140.  
  141. arrayset( g_bVoted, false, 32 );
  142.  
  143. remove_task( TASK_VOTE );
  144. g_iCountdown = 15;
  145.  
  146. set_task( 3.5, "PreTask", TASK_VOTE );
  147.  
  148. return PLUGIN_CONTINUE;
  149. }
  150.  
  151. public PrintMessage( ) {
  152. GreenPrint( 0, "It is a^4 Free round^1, no guns, no traps!" );
  153.  
  154. set_hudmessage( 0, 90, 0, -1.0, 0.35, 1, 3.0, 3.0, 2.0, 1.0, -1 );
  155. show_hudmessage( 0, "FREE ROUND!" );
  156. }
  157.  
  158. public PreTask( ) {
  159. remove_task( TASK_VOTE );
  160.  
  161. set_task( 1.0, "TaskVoteTimer", TASK_VOTE, _, _, "b" );
  162. }
  163.  
  164. public TaskVoteTimer( ) {
  165. g_iCountdown--;
  166.  
  167. if ( !g_iCountdown ) {
  168. remove_task( TASK_VOTE );
  169.  
  170. g_bVoting = false;
  171.  
  172. new iVotes, iHighVotes, iHighVotesID;
  173.  
  174. for( new i; i < VOTES; i++ ) {
  175. iVotes = g_iVotes[ i ];
  176.  
  177. if( iVotes >= iHighVotes ) {
  178. iHighVotes = iVotes;
  179. iHighVotesID = i;
  180. }
  181. }
  182.  
  183. if( iHighVotes > 0 ) {
  184. if( iHighVotesID == VOTE_YES )
  185. g_bWillFree = true;
  186.  
  187. GreenPrint( 0, "Vote is over. %s^1 [^3 %i^1 votes (^4%i%%) ^1]", g_bWillFree ? "Next round will be free!" : "Next round won't be free!", iHighVotes, GetPercent( g_iVotes[ iHighVotesID ], g_iVotes[ VOTE_YES ] + g_iVotes[ VOTE_NO ] ) );
  188. } else
  189. GreenPrint( 0, "Vote is over. No one voted." );
  190.  
  191. for( new i = 1; i <= g_iMaxplayers; i++ )
  192. if( is_user_connected( i ) )
  193. ShowVoteMenu( i, 1 );
  194. } else {
  195. for( new i = 1; i <= g_iMaxplayers; i++ )
  196. if( is_user_connected( i ) )
  197. ShowVoteMenu( i, 0 );
  198. }
  199. }
  200.  
  201. ShowVoteMenu( id, bResults = 0 ) {
  202. new iMenu = GetUserMenu( id );
  203.  
  204. if( ( iMenu && iMenu != g_iMenuID ) && g_iCountdown <= 14 )
  205. return;
  206.  
  207. menu_cancel( id ); // Radios and other piece of shit bug fix <!-- s:D --><img src=\"{SMILIES_PATH}/icon_e_biggrin.gif\" alt=\":D\" title=\"nagyon boldog\" /><!-- s:D -->
  208.  
  209. new szMenu[ 196 ], iLen;
  210.  
  211. if( bResults )
  212. iLen = formatex( szMenu, charsmax( szMenu ), "\rResults of the vote:^n^n" );
  213. else
  214. iLen = formatex( szMenu, charsmax( szMenu ), "\rDo you want a free round?^n^n" );
  215.  
  216. new iVotesTotal = g_iVotes[ VOTE_YES ] + g_iVotes[ VOTE_NO ];
  217.  
  218. iLen += formatex( szMenu[ iLen ], charsmax( szMenu ) - 1, "\r1. \wYes \d(%i%%)^n", GetPercent( g_iVotes[ VOTE_YES ], iVotesTotal ) );
  219. iLen += formatex( szMenu[ iLen ], charsmax( szMenu ) - 1, "\r2. \wNo \d(%i%%)^n^n", GetPercent( g_iVotes[ VOTE_NO ], iVotesTotal ) );
  220.  
  221. if( bResults ) {
  222. if( g_bWillFree )
  223. iLen += formatex( szMenu[ iLen ], charsmax( szMenu ) - 1, " \yNext round will be free!" );
  224. else {
  225. if( !iVotesTotal )
  226. iLen += formatex( szMenu[ iLen ], charsmax( szMenu ) - 1, " \yNo one voted!" );
  227. }
  228.  
  229. show_menu( id, ( MENU_KEY_1 | MENU_KEY_2 | MENU_KEY_0 ), szMenu, -1, "DrunFreeRoundVote" );
  230.  
  231. set_task( 5.0, "CloseMenu", id );
  232. } else {
  233. iLen += formatex( szMenu[ iLen ], charsmax( szMenu ) - 1, " \dseconds remaining: \r%i", g_iCountdown );
  234.  
  235. show_menu( id, ( MENU_KEY_1 | MENU_KEY_2 ), szMenu, -1, "DrunFreeRoundVote" );
  236. }
  237. }
  238.  
  239. public CloseMenu( id )
  240. if( GetUserMenu( id ) == g_iMenuID )
  241. client_cmd( id, "slot1" );
  242.  
  243. GetUserMenu( id ) {
  244. new iMenu, iKeys;
  245. get_user_menu( id, iMenu, iKeys );
  246.  
  247. return iMenu;
  248. }
  249.  
  250. public HandleVote( id, iKey ) {
  251. if( !g_bVoting || !task_exists( TASK_VOTE ) )
  252. return;
  253.  
  254. if( g_bVoted[ id ] ) {
  255. ShowVoteMenu( id, 0 );
  256.  
  257. return;
  258. }
  259.  
  260. if( iKey > 1 )
  261. return;
  262.  
  263. new iVotes = ( /* get_user_flags( id ) & ADMIN_KICK ||*/ get_user_team( id ) == 1 ) ? 2 : 1;
  264.  
  265. g_bVoted[ id ] = true;
  266. g_iVotes[ iKey ] += iVotes;
  267.  
  268. new szName[ 32 ];
  269. get_user_name( id, szName, 31 );
  270.  
  271. GreenPrint( 0, "^3%s^1 voted^4 %s^1. [^4+%i^1 vote%s]", szName, iKey == VOTE_YES ? "for" : "against", iVotes, iVotes == 1 ? "" : "s" );
  272.  
  273. ShowVoteMenu( id, 0 );
  274. }
  275.  
  276. public FwdHamUse_Button( iEntity, id, iActivator, iUseType, Float:flValue ) {
  277. if( g_bFreeRound && iUseType == 2 && flValue == 1.0 && is_user_alive( id )
  278. && get_user_team( id ) == 1 && get_pdata_int( iEntity, m_toggle_state, 4 ) == 1 ) {
  279. /* Oh hi this code actually happen! <!-- s:D --><img src=\"{SMILIES_PATH}/icon_e_biggrin.gif\" alt=\":D\" title=\"nagyon boldog\" /><!-- s:D --> */
  280.  
  281. set_hudmessage( 0, 100, 255, -1.0, 0.25, 0, 2.0, 2.0, 0.2, 0.2, 3 );
  282. show_hudmessage( id, "It is free round!^nYou can't use buttons!" );
  283.  
  284. return HAM_SUPERCEDE;
  285. }
  286.  
  287. return HAM_IGNORED;
  288. }
  289.  
  290. GetPercent( is, of ) // Brad
  291. return ( of != 0 ) ? floatround( floatmul( float( is ) / float( of ), 100.0 ) ) : 0;
  292.  
  293. GreenPrint( id, const message[ ], any:... ) {
  294. static szMessage[ 192 ], iLen;
  295. if( !iLen )
  296. iLen = formatex( szMessage, 191, "^4[Deathrun FreeRound]^1 " );
  297.  
  298. vformat( szMessage[ iLen ], 191 - iLen, message, 3 );
  299.  
  300. message_begin( id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, g_iMsgSayText, _, id );
  301. write_byte( id ? id : 1 );
  302. write_string( szMessage );
  303. message_end( );
  304.  
  305. return 1;
  306. }

_________________
Kép


Hozzászólás jelentése
Vissza a tetejére
   
Hozzászólások megjelenítése:  Rendezés  
Új téma nyitása  Hozzászólás a témához  [ 2 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 9 vendég


Nyithatsz új témákat ebben a fórumban.
Válaszolhatsz egy témára ebben a fórumban.
Nem szerkesztheted a hozzászólásaidat ebben a fórumban.
Nem törölheted a hozzászólásaidat ebben a fórumban.
Nem küldhetsz csatolmányokat ebben a fórumban.

Keresés:
Ugrás:  
Powered by phpBB® Forum Software © phpBB Limited
Magyar fordítás © Magyar phpBB Közösség
Portal: Kiss Portal Extension © Michael O'Toole