hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.05.25. 16:10



Jelenlévő felhasználók

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

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

Regisztrált felhasználók: Bing [Bot] 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: DR Segitség!
HozzászólásElküldve: 2014.10.16. 20:08 
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 ez lenne a /free de aki ezt átirja ugy hogy csak beirja a T hogy fr vagy free akkor 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 fr", "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: DR Segitség!
HozzászólásElküldve: 2014.10.21. 21:47 
Offline
Beavatott
Avatar

Csatlakozott: 2014.10.12. 09:18
Hozzászólások: 71
Megköszönték neki: 12 alkalommal
Tessék:

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

_________________
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 6 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