Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include < amxmodx >
- #include < cstrike >
- #include < engine >
- #include < fakemeta >
- #include <fakemeta_util>
- #define Max_Translate 101
- new fw_engTranslate[ Max_Translate ][ ] =
- {
- "quick", "river", "phone", "keyboard", "mouse",
- "glasses", "windows", "bottle", "plate", "screen",
- "paper", "newspaper", "fork", "knife", "toilet",
- "news", "keys", "open", "close", "bed",
- "pillow", "blanket", "wall", "closet", "dresser",
- "pen", "pencil", "money", "gold", "disc",
- "banana", "pear", "pineapple", "orange", "headphones",
- "microphone", "plum", "remote", "batteries", "clock",
- "time", "car", "neck", "head", "hand",
- "leg", "eyes", "fingers", "hat", "shirt",
- "pants", "book", "conversation", "shoes", "nerds",
- "orange", "purple", "red", "pink", "blue",
- "azure", "green", "yellow", "bible", "beard",
- "poker", "page", "pirates", "love", "happy",
- "night", "day", "planet", "plant", "number",
- "tree", "one", "two", "three", "four",
- "six", "seven", "eight", "nine", "ten",
- "eleven", "twelve", "shower", "water", "circle",
- "square", "kitchen", "room", "floor", "voice",
- "speakers", "computer", "plug", "glass", "net",
- "ball"
- }
- new fw_hebTranslate[ Max_Translate ][ ] =
- {
- "׳–׳™׳¨׳–", "׳¨׳”׳ ", "׳׳•׳₪׳׳׳₪", "׳×׳“׳׳§׳", "׳¨׳‘׳›׳¢",
- "׳׳™׳™׳₪׳§׳©׳", "׳×׳•׳ ׳•׳׳—", "׳§׳•׳‘׳§׳‘", "׳×׳—׳׳¦", "׳׳¡׳",
- "׳¨׳™׳™׳ ", "׳׳•׳×׳™׳¢", "׳’׳׳–׳", "׳׳™׳›׳¡", "׳”׳׳¡׳",
- "׳×׳•׳©׳“׳—", "׳×׳•׳—׳×׳₪׳", "׳—׳•׳×׳₪׳", "׳¨׳•׳’׳¡׳", "׳”׳˜׳™׳",
- "׳×׳™׳¨׳›", "׳”׳›׳™׳׳¡", "׳¨׳™׳§", "׳׳•׳¨׳", "׳”׳“׳™׳©",
- "׳˜׳¢", "׳׳•׳¨׳₪׳™׳¢", "׳£׳¡׳›", "׳‘׳”׳–", "׳§׳¡׳™׳“",
- "׳”׳ ׳ ׳‘", "׳¡׳’׳", "׳¡׳ ׳ ׳", "׳–׳•׳₪׳×", "׳×׳•׳™׳ ׳–׳•׳",
- "׳׳•׳₪׳•׳¨׳§׳™׳","׳£׳™׳–׳©", "׳˜׳׳©", "׳×׳•׳™׳¨׳˜׳‘", "׳׳•׳¢׳©",
- "׳׳׳–", "׳•׳˜׳•׳", "׳¨׳׳•׳•׳¦", "׳©׳׳¨", "׳“׳™",
- "׳׳’׳¨", "׳׳™׳™׳ ׳™׳¢", "׳×׳•׳¢׳‘׳¦׳", "׳¢׳‘׳•׳›", "׳”׳¦׳׳•׳—",
- "׳׳™׳™׳¡׳ ׳›׳", "׳¨׳₪׳¡", "׳”׳—׳™׳©", "׳׳™׳™׳׳¢׳ ", "׳׳™׳ ׳•׳ ׳—",
- "׳׳•׳×׳›", "׳׳•׳’׳¡", "׳׳•׳“׳", "׳“׳•׳¨׳•", "׳׳•׳—׳›",
- "׳×׳׳›׳×", "׳§׳•׳¨׳™", "׳‘׳•׳”׳¦", "׳''׳ ׳×", "׳׳§׳–",
- "׳¨׳§׳•׳₪", "׳£׳“", "׳׳™׳˜׳¨׳™׳₪", "׳”׳‘׳”׳", "׳—׳׳©",
- "׳”׳׳™׳", "׳׳•׳™", "׳×׳›׳ ׳‘׳›׳•׳›","׳—׳׳¦", "׳¨׳₪׳¡׳",
- "׳¥׳¢", "׳“׳—׳", "׳׳™׳™׳×׳©", "׳©׳•׳׳©", "׳¢׳‘׳¨׳",
- "׳©׳©", "׳¢׳‘׳©", "׳”׳ ׳•׳׳©", "׳¢׳©׳×", "׳¨׳©׳¢",
- "׳”׳¨׳©׳¢ ׳“׳—׳", "׳”׳¨׳©׳¢ ׳׳™׳™׳×׳©", "׳×׳—׳׳§׳", "׳׳™׳", "׳׳•׳’׳™׳¢",
- "׳¢׳•׳‘׳™׳¨", "׳—׳‘׳˜׳", "׳¨׳“׳—", "׳”׳₪׳¦׳¨", "׳׳•׳§",
- "׳׳™׳׳•׳§׳׳¨", "׳‘׳©׳—׳", "׳¢׳§׳©", "׳×׳™׳›׳•׳›׳–", "׳×׳©׳¨",
- "׳¨׳•׳“׳›"
- }
- new fw_FirstChars[ ][ ] =
- {
- "A", "B", "C", "D", "E", "F", "G", "H", "I", "J",
- "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T",
- "U", "V", "W", "X", "Y", "Z",
- "a", "b", "c", "d", "e", "f", "g", "h", "i", "j",
- "k", "l", "m", "n", "o", "p", "q", "r", "s", "t",
- "u", "v", "w", "x", "y", "z"
- };
- new fw_FirstNumsNChars[ ][ ] =
- {
- "A", "B", "C", "D", "E", "F", "G", "H", "I", "J",
- "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T",
- "U", "V", "W", "X", "Y", "Z",
- "a", "b", "c", "d", "e", "f", "g", "h", "i", "j",
- "k", "l", "m", "n", "o", "p", "q", "r", "s", "t",
- "u", "v", "w", "x", "y", "z",
- "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"
- };
- new g_RandomMoves[ 10 ][ ] =
- {
- "Jump", "Duck", "Attack", "Attack2", "Use",
- "Reload", "Forward", "Back", "Left", "Right"
- }
- new g_RandomNums[ ] =
- {
- IN_JUMP, IN_DUCK, IN_ATTACK, IN_ATTACK2, IN_USE,
- IN_RELOAD, IN_FORWARD, IN_BACK, IN_MOVELEFT, IN_MOVERIGHT
- }
- new InAct[ 33 ], Act[ 3 ], Ran[ 3 ], bool:o_Combo, bool:o_Translate, bool:o_First, bool:o_Math,
- Pick[ 33 ], bool:Move, fwNums[ 3 ], fw_hebChars[ 64 ], fw_engChars[ 64 ], fw_Chars[ 6 ], fwWords[ 128 ],
- fwAnswer[ 128 ], fwSign[ 26 ], fwCount;
- public plugin_init()
- {
- register_clcmd( "say /first", "CmdFirst" );
- register_clcmd( "say", "CmdSay" );
- register_forward( FM_PlayerPreThink, "fwPreThink" );
- }
- public CmdFirst( client )
- {
- if ( !( get_user_flags( client ) & ADMIN_KICK ) ) return ColorPrint( client, "You have no access to this command." );
- new Menu = menu_create( "First Actions Menu^nBy \rRejack", "SubFirst" );
- menu_additem( Menu, "First Writes Event", "0" );
- menu_additem( Menu, "First Translate Event", "1" );
- menu_additem( Menu, "First Math Event", "2" );
- menu_additem( Menu, "First Combo Event^n", "3" );
- menu_additem( Menu, "\rStop Event", "4" );
- return menu_display( client, Menu );
- }
- public SubFirst( client, Menu, Item )
- {
- if ( Item == MENU_EXIT ) return menu_destroy( Menu );
- if ( o_Combo || o_Translate || o_First || o_Math ) return ColorPrint( client, "You canno't^3 Start^1 and event right now." );
- new szName[ 32 ];get_user_name( client, szName, charsmax( szName ) );
- switch ( Item )
- {
- case 4:
- {
- o_Combo = false;
- o_First = false;
- o_Math = false;
- o_Translate = false;
- fwCount = 0;
- Move = false;
- ColorPrint( 0, "^4%s^1 stopped the current event.", szName );
- remove_task( 888 );
- return PLUGIN_HANDLED;
- }
- }
- Pick[ client ] = Item + 1;
- CmdStart( client );
- return menu_destroy( Menu );
- }
- public CmdStart( client )
- {
- new szName[ 32 ];get_user_name( client, szName, charsmax( szName ) );
- switch ( Pick[ client ] )
- {
- case 1:
- {
- if ( o_Combo || o_Translate || o_First || o_Math ) return ColorPrint( client, "You canno't^3 Start^1 and event right now." );
- ColorPrint( 0, "^4%s^1 just started a^3 First^4 Writes^3 Event^1!", szName );
- fwWords = "The first one to write the next combination will be moved to the Guards team automatically^n";
- o_First = true;
- fwCount = 5;
- set_task( 1.0, "Countdown", 999, _,_, "b" );
- }
- case 2:
- {
- if ( o_Combo || o_Translate || o_First || o_Math ) return ColorPrint( client, "You canno't^3 Start^1 and event right now." );
- ColorPrint( 0, "^4%s^1 just started a^3 First^4 Translate^3 Event^1!", szName );
- fwWords = "The first on to translate the next words will be move to the Guards team automatically^n";
- o_Translate = true;
- fwCount = 5;
- set_task( 1.0, "Countdown", 999, _,_, "b" );
- }
- case 3:
- {
- if ( o_Combo || o_Translate || o_First || o_Math ) return ColorPrint( client, "You canno't^3 Start^1 and event right now." );
- ColorPrint( 0, "^4%s^1 just started a^3 First^4 Math^3 Event^1!", szName );
- o_Math = true;
- fwCount = 5;
- set_task( 1.0, "Countdown", 999, _,_, "b" );
- }
- case 4:
- {
- if ( o_Combo || o_Translate || o_First || o_Math ) return ColorPrint( client, "You canno't^3 Start^1 and event right now." );
- ColorPrint( 0, "^4%s^1 just started a^3 First^4 Combo^3 Event^1!", szName );
- o_Combo = true;
- fwCount = 5;
- set_task( 1.0, "Countdown", 999, _,_, "b" );
- }
- }
- return PLUGIN_HANDLED;
- }
- public Countdown( )
- {
- if ( o_Translate )
- {
- if( fwCount <= 0 )
- {
- Move = true;
- fwNums[ 0 ] = random( Max_Translate );
- get_heb( fw_hebChars, charsmax( fw_hebChars ) );
- get_eng( fw_engChars, charsmax( fw_engChars ) );
- set_hudmessage( 0, 160, 0, -1.0, 0.31, 1, 1.0, 8.0 );
- show_hudmessage( 0, "^"%s^" %s", fw_hebChars, fwWords );
- ColorPrint( 0, "^"^4 %s ^1^"^3 %s", fw_hebChars, fwWords );
- remove_task( 999 );
- set_task( 20.0, "eventFailed", 999 );
- }
- }
- if ( o_Combo )
- {
- if ( fwCount <= 0 )
- {
- Ran[ 0 ] = random_num( 0,9 );
- Ran[ 1 ] = random_num( 0,9 );
- Ran[ 2 ] = random_num( 0,9 );
- Act[ 0 ] = Ran[ 0 ];
- Act[ 1 ] = Ran[ 1 ];
- Act[ 2 ] = Ran[ 2 ];
- Move = true;
- remove_task( 999 );
- set_task( 20.0, "eventFailed" );
- set_hudmessage( 255, 165, 0, -1.0, 0.35, 1, 10.0, 7.0, 0.1, 0.1 )
- show_hudmessage( 0, "%s + %s + %s", g_RandomMoves[ Ran[ 0 ] ], g_RandomMoves[ Ran[ 1 ] ], g_RandomMoves[ Ran[ 2 ] ] );
- ColorPrint( 0, "%d + %d + %d", Act[ 0 ], Act[ 1 ], Act[ 2 ] );
- }
- }
- if ( o_First )
- {
- if( fwCount <= 0 )
- {
- Move = true;
- switch ( random_num( 1, 3 ) )
- {
- case 1: get_chars( fw_Chars, charsmax( fw_Chars ) );
- case 2: get_nums( fw_Chars, charsmax( fw_Chars ) );
- case 3: get_numsNchars( fw_Chars, charsmax( fw_Chars ) );
- }
- set_hudmessage( 0, 160, 0, -1.0, 0.31, 1, 1.0, 8.0 );
- show_hudmessage( 0, "%s[ %s ]", fwWords, fw_Chars )
- ColorPrint( 0, "^3%s^1 ^"^4%s^1^"", fwWords, fw_Chars )
- remove_task( 999 );
- set_task( 20.0, "eventFailed", 999 );
- }
- }
- if ( o_Math )
- {
- if( fwCount <= 0 )
- {
- Move = true;
- fwNums[ 0 ] = random( 350 );
- fwNums[ 1 ] = random( 250 );
- switch ( random_num( 1, 2 ) )
- {
- case 1:
- {
- format( fwAnswer, charsmax( fwAnswer ), "%d", fwNums[ 0 ] + fwNums[ 1 ] );
- format( fwSign, charsmax( fwSign ), "+" );
- }
- case 2:
- {
- format( fwAnswer, charsmax( fwAnswer ), "%d", fwNums[ 0 ] - fwNums[ 1 ] );
- format( fwSign, charsmax( fwSign ), "-" );
- }
- }
- set_hudmessage( 0, 160, 0, -1.0, 0.31, 1, 1.0, 8.0 );
- show_hudmessage( 0, "Answer the math question!^n%d %s %d = ?", fwNums[ 0 ], fwSign, fwNums[ 1 ] );
- ColorPrint( 0, "^3Answer the math question! ^4%d^1 %s^3 %d^1 = ?", fwNums[ 0 ], fwSign, fwNums[ 1 ] );
- remove_task( 999 );
- set_task( 20.0, "eventFailed", 999 );
- }
- }
- if( fwCount != 0 )
- {
- new Vox[ 32 ]; num_to_word( fwCount, Vox, charsmax( Vox ) );
- client_cmd( 0, "spk ^"vox/%s second%s^"", Vox, (fwCount>1)?"s":"" );
- switch ( fwCount )
- {
- case 1: set_hudmessage( 0, 255, 255, -1.0, 0.31, 0, 0.1, 0.5 );
- case 2: set_hudmessage( 255, 255, 0, -1.0, 0.31, 0, 0.1, 0.5 );
- case 3: set_hudmessage( 255, 100, 100, -1.0, 0.31, 0, 0.1, 0.5 );
- case 4: set_hudmessage( 255, 0, 0, -1.0, 0.31, 0, 0.1, 0.5 );
- case 5: set_hudmessage( 255, 0, 255, -1.0, 0.31, 0, 0.1, 0.5 );
- }
- show_hudmessage( 0, "׳×׳•׳™׳ ׳© %d", fwCount );
- fwCount -= 1
- }
- }
- public CmdSay( client )
- {
- new szMsg[ 192 ], szName[ 32 ];
- read_argv( 1, szMsg, charsmax( szMsg ) );
- get_user_name( client, szName, sizeof (szName) - 1 );
- if ( o_Translate )
- {
- if ( equal( szMsg, fw_engChars ) )
- {
- if ( !Move || cs_get_user_team( client ) == CS_TEAM_CT || !is_user_alive( client ) ) return ColorPrint( client, "You cannot participate in the event." );
- ColorPrint( 0, "^4%s^1 won the^3 First Translate Event^1! The answer was^4 %s", szName, fw_engChars );
- set_hudmessage( 0, 160, 0, -1.0, 0.31, 1, 1.0, 8.0 );
- show_hudmessage( 0, "%s won the First Translate Event! The answer was %s", szName, fw_engChars );
- o_Translate = false;
- remove_task( 999 );
- Move = false;
- cs_set_user_team( client, CS_TEAM_CT );
- dllfunc( DLLFunc_Spawn, client );
- }
- }
- if ( o_First )
- {
- if ( equal( szMsg, fw_Chars ) )
- {
- if ( !Move || cs_get_user_team( client ) == CS_TEAM_CT || !is_user_alive( client ) ) return ColorPrint( client, "You cannot participate in the event." );
- set_hudmessage( 0, 160, 0, -1.0, 0.31, 1, 1.0, 8.0 );
- show_hudmessage( 0, "%s won the First Writes Event! and was moved to the Guards Team!", szName );
- ColorPrint( 0, "^4%s^1 won the^3 Firstwrites Event^1!", szName );
- o_First = false;
- remove_task( 999 );
- Move = false;
- cs_set_user_team( client, CS_TEAM_CT );
- dllfunc( DLLFunc_Spawn, client );
- }
- }
- if ( o_Math )
- {
- if ( equal( szMsg, fwAnswer ) )
- {
- if ( !Move || cs_get_user_team( client ) == CS_TEAM_CT || !is_user_alive( client ) ) return ColorPrint( client, "You cannot participate in the event." );
- ColorPrint( 0, "^4%s^1 won the^4 First Math Event^1! The answer was^4 %s", szName, fw_engChars );
- set_hudmessage( 0, 160, 0, -1.0, 0.31, 1, 1.0, 8.0 );
- show_hudmessage( 0, "%s won the Math Event, The answer was %s", szName, fw_engChars );
- o_Math = false;
- remove_task( 999 );
- Move = false;
- cs_set_user_team( client, CS_TEAM_CT );
- dllfunc( DLLFunc_Spawn, client );
- }
- }
- return PLUGIN_CONTINUE;
- }
- public eventFailed( )
- {
- o_Combo = false;
- o_First = false;
- o_Math = false;
- o_Translate = false;
- fwCount = 0;
- Move = false;
- return PLUGIN_HANDLED;
- }
- /* ----------------------------------------------
- Combo
- ----------------------------------------------- */
- public fwPreThink( client )
- {
- if ( cs_get_user_team( client ) == CS_TEAM_CT ) return FMRES_IGNORED;
- new g_Button = fm_get_user_button( client );
- new g_Old = fm_get_user_oldbutton( client );
- new g_Pressed = g_Button & ~g_Old;
- if ( g_Pressed && o_Combo && Move )
- {
- switch ( InAct[ client ] )
- {
- case 0:
- {
- if ( g_Pressed & g_RandomNums[ Ran[ 0 ] ] )
- {
- InAct[ client ] += 1;
- ColorPrint( client, "You pressed the^4 right^1 key! ^3[^4Combo Status:^1 %d/3^3]", InAct[ client ] );
- return FMRES_IGNORED;
- }
- ColorPrint( client, "Wrong key! you^4 failed^1!^3 try again^1!" );
- InAct[ client ] =0;
- }
- case 1:
- {
- if ( g_Pressed & g_RandomNums[ Ran[ 1 ] ] )
- {
- InAct[ client ] += 1;
- ColorPrint( client, "You pressed the^4 right^1 key! ^3[^4Combo Status:^1 %d/3^3]", InAct[ client ] );
- return FMRES_IGNORED;
- }
- ColorPrint( client, "Wrong key! you^4 failed^1!^3 try again^1!" );
- InAct[ client ] =0;
- }
- case 2:
- {
- if ( g_Pressed & g_RandomNums[ Ran[ 2 ] ] )
- {
- InAct[ client ] += 1;
- ColorPrint( client, "You pressed the^4 right^1 key! ^3[^4Combo Status:^1 %d/3^3]", InAct[ client ] );
- if ( InAct[ client ] == 3 )
- {
- ComboWinner( client );
- return FMRES_IGNORED;
- }
- return FMRES_IGNORED;
- }
- ColorPrint( client, "Wrong key! you^4 failed^1!^3 try again^1!" );
- InAct[ client ] =0;
- }
- }
- }
- return FMRES_IGNORED;
- }
- public ComboWinner( client )
- {
- new szName[ 32 ];get_user_name( client, szName, charsmax( szName ) );
- ColorPrint( 0, "^4%s^1 won the^3 First Combo Event^1! ", szName );
- set_hudmessage( 0, 160, 0, -1.0, 0.31, 1, 1.0, 8.0 );
- show_hudmessage( 0, "%s won the First Combo Event!", szName );
- o_Combo = false;
- remove_task( 999 );
- Move = false;
- cs_set_user_team( client, CS_TEAM_CT );
- dllfunc( DLLFunc_Spawn, client );
- for ( new i; i<get_maxplayers(); i++)
- {
- if ( !is_user_connected( i ) || !is_user_bot( i ) ) return;
- InAct[ i ] = 0;
- }
- }
- /* ----------------------------------------------
- STOCKS
- ----------------------------------------------- */
- stock ColorPrint( const client, const string[], any:... )
- {
- new msg[ 191 ], players[ 32 ], count = 1;
- static len; len = formatex( msg, charsmax( msg ), "^1[^4 Galactic ^1] " );
- vformat( msg[ len ], charsmax( msg ) - len, string, 3 );
- if( client ) players[ 0 ] = client;
- else get_players( players,count,"ch" );
- for ( new i = 0; i < count; i++ )
- {
- if( is_user_connected( players[ i ] ) )
- {
- message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, players[ i ] );
- write_byte( players[ i ] );
- write_string( msg );
- message_end( );
- }
- }
- return PLUGIN_HANDLED;
- }
- stock get_heb( output[], len ){
- format( output, len, "%s", fw_hebTranslate[ fwNums[ 0 ] ] );}
- stock get_eng( output[], len ){
- format( output, len, "%s", fw_engTranslate[ fwNums[ 0 ] ] );}
- stock get_chars( output[], len )
- {
- format( output, len, "%s%s%s%s%s%s",
- fw_FirstChars[ random( 52 ) ], fw_FirstChars[ random( 52 ) ],
- fw_FirstChars[ random( 52 ) ], fw_FirstChars[ random( 52 ) ],
- fw_FirstChars[ random( 52 ) ], fw_FirstChars[ random( 52 ) ] );
- }
- stock get_nums( output[], len )
- {
- format( output, len, "%d%d%d%d%d%d",
- random( 9 ), random( 9 ), random( 9 ),
- random( 9 ), random( 9 ), random( 9 ) );
- }
- stock get_numsNchars( output[], len )
- {
- format( output, len, "%s%s%s%s%s%s",
- fw_FirstNumsNChars[ random( 62 ) ], fw_FirstNumsNChars[ random( 62 ) ],
- fw_FirstNumsNChars[ random( 62 ) ], fw_FirstNumsNChars[ random( 62 ) ],
- fw_FirstNumsNChars[ random( 62 ) ], fw_FirstNumsNChars[ random( 62 ) ] );
- }
Add Comment
Please, Sign In to add comment