Rejack

JailBreak Addons Menu v1.0 by Rejack

Mar 19th, 2013 (edited)
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 39.25 KB | None | 0 0
  1. #include < amxmodx >
  2. #include < cstrike >
  3. #include < fakemeta >
  4. #include < fakemeta_util >
  5. #include < hamsandwich >
  6.  
  7. /* Defines */
  8. #define gPrefix "Galactic"
  9. #define gGameName "Galactic JailBreak"
  10. #define Max_Translate 101
  11.  
  12. /* Variables */
  13. new gTitle[ 128 ];
  14. new gCount = 5;
  15. new AccessId[ 33 ];
  16. new g_MaxClients;
  17.  
  18. /* Booleans */
  19. new bool:Glow[ 33 ];
  20. new bool:BlockDamage;
  21. new bool:TFreeze
  22. new bool:CTFreeze
  23. new bool:gCountdown
  24.  
  25. /* Enums */
  26. enum _:Teams
  27. {
  28.     FM_TEAM_UNASSIGNED,
  29.     FM_TEAM_T,
  30.     FM_TEAM_CT,
  31.     FM_TEAM_SPECTATOR
  32. };
  33. enum _:Level
  34. {
  35.     Vip,
  36.     Admin,
  37.     Manager
  38. };
  39.  
  40. enum _:Data
  41. {
  42.     m_szAccessName[16],
  43.     m_iAccessPrice
  44. };
  45.  
  46. /* Const */
  47. new const g_szAccessList[ Level ][ Data ] =
  48. {
  49.     { "Vip", 20 },
  50.     { "Admin", 40 },
  51.     { "Manager", 60 }
  52. };
  53.  
  54. new fw_engTranslate[ Max_Translate ][ ] =
  55. {
  56.     "quick",    "river",    "phone",    "keyboard", "mouse",
  57.    
  58.     "glasses",  "windows",  "bottle",   "plate",    "screen",
  59.    
  60.     "paper",    "newspaper",    "fork",     "knife",    "toilet",
  61.     // 3
  62.     "news",     "keys",     "open",     "close",    "bed",
  63.    
  64.     "pillow",   "blanket",  "wall",     "closet",   "dresser",
  65.    
  66.     "pen",      "pencil",   "money",    "gold",     "disc",
  67.     // 6
  68.     "banana",   "pear",     "pineapple",    "orange",   "headphones",
  69.    
  70.     "microphone",   "plum",     "remote",   "batteries",    "clock",
  71.    
  72.     "time",     "car",      "neck",     "head",     "hand",
  73.     // 9
  74.     "leg",      "eyes",     "fingers",  "hat",      "shirt",
  75.    
  76.     "pants",    "book",     "conversation", "shoes",    "nerds",
  77.    
  78.     "orange",   "purple",   "red",      "pink",     "blue",
  79.     // 12
  80.     "azure",    "green",    "yellow",   "bible",    "beard",
  81.    
  82.     "poker",    "page",     "pirates",  "love",     "happy",
  83.    
  84.     "night",    "day",      "planet",   "plant",    "number",
  85.     // 15
  86.     "tree",     "one",      "two",      "three",    "four",
  87.    
  88.     "six",      "seven",    "eight",    "nine",     "ten",
  89.    
  90.     "eleven",   "twelve",   "shower",   "water",    "circle",
  91.     // 18
  92.     "square",   "kitchen",  "room",     "floor",    "voice",
  93.    
  94.     "speakers", "computer", "plug",     "glass",    "net",
  95.    
  96.     "ball" // 21
  97. }
  98. new fw_hebTranslate[ Max_Translate ][ ] =
  99. {
  100.     "׳–׳™׳¨׳–",  "׳¨׳”׳ ",    "׳Ÿ׳•׳₪׳׳œ׳₪",  "׳×׳“׳œ׳§׳ž",    "׳¨׳‘׳›׳¢",
  101.    
  102.     "׳׳™׳™׳₪׳§׳©׳ž",  "׳×׳•׳ ׳•׳œ׳—",  "׳§׳•׳‘׳§׳‘",  "׳×׳—׳œ׳¦",    "׳š׳¡׳ž",
  103.    
  104.     "׳¨׳™׳™׳ ",   "׳Ÿ׳•׳×׳™׳¢",   "׳’׳œ׳–׳ž",   "׳Ÿ׳™׳›׳¡",   "׳”׳œ׳¡׳",
  105.     // 3
  106.     "׳×׳•׳©׳“׳—",  "׳×׳•׳—׳×׳₪׳ž",  "׳—׳•׳×׳₪׳œ",  "׳¨׳•׳’׳¡׳œ",   "׳”׳˜׳™׳ž",
  107.    
  108.     "׳×׳™׳¨׳›",   "׳”׳›׳™׳ž׳¡",  "׳¨׳™׳§",    "׳Ÿ׳•׳¨׳",    "׳”׳“׳™׳©",
  109.    
  110.     "׳˜׳¢",     "׳Ÿ׳•׳¨׳₪׳™׳¢",  "׳£׳¡׳›",    "׳‘׳”׳–",  "׳§׳¡׳™׳“",
  111.     // 6
  112.     "׳”׳ ׳ ׳‘",   "׳¡׳’׳",    "׳¡׳ ׳ ׳", "׳–׳•׳₪׳×",  "׳×׳•׳™׳ ׳–׳•׳",
  113.    
  114.     "׳Ÿ׳•׳₪׳•׳¨׳§׳™׳ž","׳£׳™׳–׳©",    "׳˜׳œ׳©", "׳×׳•׳™׳¨׳˜׳‘",  "׳Ÿ׳•׳¢׳©",
  115.    
  116.     "׳Ÿ׳ž׳–",        "׳•׳˜׳•׳",   "׳¨׳׳•׳•׳¦",   "׳©׳׳¨", "׳“׳™",
  117.     // 9
  118.     "׳œ׳’׳¨",    "׳׳™׳™׳ ׳™׳¢",  "׳×׳•׳¢׳‘׳¦׳",   "׳¢׳‘׳•׳›",  "׳”׳¦׳œ׳•׳—",
  119.    
  120.     "׳׳™׳™׳¡׳ ׳›׳ž",  "׳¨׳₪׳¡",    "׳”׳—׳™׳©",  "׳׳™׳™׳œ׳¢׳ ",   "׳׳™׳ ׳•׳ ׳—",
  121.    
  122.     "׳׳•׳×׳›",   "׳œ׳•׳’׳¡",   "׳׳•׳“׳",   "׳“׳•׳¨׳•",  "׳œ׳•׳—׳›",
  123.     // 12
  124.     "׳×׳œ׳›׳×",    "׳§׳•׳¨׳™",   "׳‘׳•׳”׳¦",  "׳š''׳ ׳×",   "׳Ÿ׳§׳–",
  125.    
  126.     "׳¨׳§׳•׳₪",   "׳£׳“",        "׳׳™׳˜׳¨׳™׳₪",  "׳”׳‘׳”׳",  "׳—׳ž׳©",
  127.    
  128.     "׳”׳œ׳™׳œ",   "׳׳•׳™",   "׳×׳›׳œ ׳‘׳›׳•׳›","׳—׳ž׳¦",   "׳¨׳₪׳¡׳ž",
  129.     // 15
  130.     "׳¥׳¢",     "׳“׳—׳",   "׳׳™׳™׳×׳©",   "׳©׳•׳œ׳©",    "׳¢׳‘׳¨׳",
  131.    
  132.     "׳©׳©",     "׳¢׳‘׳©",    "׳”׳ ׳•׳ž׳©",   "׳¢׳©׳×", "׳¨׳©׳¢",
  133.    
  134.     "׳”׳¨׳©׳¢ ׳“׳—׳", "׳”׳¨׳©׳¢ ׳׳™׳™׳×׳©", "׳×׳—׳œ׳§׳ž", "׳׳™׳ž",   "׳œ׳•׳’׳™׳¢",
  135.     // 18
  136.     "׳¢׳•׳‘׳™׳¨",  "׳—׳‘׳˜׳ž",   "׳¨׳“׳—",   "׳”׳₪׳¦׳¨",   "׳œ׳•׳§",
  137.    
  138.     "׳׳™׳œ׳•׳§׳ž׳¨",   "׳‘׳©׳—׳ž",   "׳¢׳§׳©", "׳×׳™׳›׳•׳›׳–",    "׳×׳©׳¨",
  139.    
  140.     "׳¨׳•׳“׳›"
  141.     // 21
  142. }
  143.  
  144. new fw_FirstChars[ ][ ] =
  145. {
  146.     "A", "B", "C", "D", "E", "F", "G", "H", "I", "J",
  147.    
  148.     "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T",
  149.    
  150.     "U", "V", "W", "X", "Y", "Z",
  151.    
  152.     "a", "b", "c", "d", "e", "f", "g", "h", "i", "j",
  153.    
  154.     "k", "l", "m", "n", "o", "p", "q", "r", "s", "t",
  155.    
  156.     "u", "v", "w", "x", "y", "z"
  157. };
  158.  
  159. new fw_FirstNumsNChars[ ][ ] =
  160. {
  161.     "A", "B", "C", "D", "E", "F", "G", "H", "I", "J",
  162.    
  163.     "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T",
  164.    
  165.     "U", "V", "W", "X", "Y", "Z",
  166.    
  167.     "a", "b", "c", "d", "e", "f", "g", "h", "i", "j",
  168.    
  169.     "k", "l", "m", "n", "o", "p", "q", "r", "s", "t",
  170.    
  171.     "u", "v", "w", "x", "y", "z",
  172.    
  173.     "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"
  174. };
  175.  
  176. /* Booleans */
  177. new bool:fwFirstwrites;
  178. new bool:fwMath;
  179. new bool:fwTranslate;
  180.  
  181. new bool:Move;
  182.  
  183. /* Strings */
  184. new fwNums[ 3 ];
  185. new fw_hebChars[ 64 ];
  186. new fw_engChars[ 64 ];
  187. new fw_Chars[ 6 ];
  188. new fwWords[ 128 ];
  189. new fwAnswer[ 128 ];
  190. new fwSign[ 26 ];
  191.  
  192. /* Variables */
  193. new fwCount;
  194.  
  195.  
  196. public plugin_init()
  197. {
  198.     register_clcmd( "say",      "client_say" );
  199.     register_clcmd( "say_team", "client_say" );
  200.    
  201.     register_clcmd( "say", "cmdSay" );
  202.    
  203.     register_forward( FM_SetModel,      "fwSetModel" );
  204.     register_forward( FM_ClientKill,    "BlockKill" );
  205.     register_forward( FM_GetGameDescription,"GameDesc" );
  206.    
  207.     RegisterHam( Ham_TakeDamage,    "player", "HamTakeDamage" );
  208.     RegisterHam( Ham_Spawn,     "player", "HamSpawn", 1 );
  209. }
  210. /*
  211. public plugin_precache( )
  212. {
  213.     precache_model( "models/player/GalacticGuard1/GalacticGuard1.mdl" );
  214.    
  215.     precache_model( "models/player/GalacticPrisoner1/GalacticPrisoner1.mdl" );
  216. }
  217. */
  218. public plugin_cfg( )  
  219. {
  220.     register_message( get_user_msgid( "StatusIcon" ), "Message_StatusIcon" );
  221.     g_MaxClients = global_get( glb_maxClients );
  222. }
  223. /* --------------------------------------------------------------
  224. Client Commands
  225. -------------------------------------------------------------- */
  226. public client_say( id )
  227. {  
  228.     new szMsg[ 192 ];
  229.     read_argv( 1, szMsg, sizeof (szMsg) - 1 );
  230.    
  231.     if ( equali( szMsg, "/c4" ) )
  232.     {
  233.         if ( cs_get_user_team( id ) != CS_TEAM_CT )
  234.         {
  235.             ColorChat( id, "^4ERROR:^3 Prisoners^1 canno't get a bomb." );
  236.             return PLUGIN_HANDLED;
  237.         }
  238.         if ( !is_user_alive( id ) )
  239.         {
  240.             ColorChat( id, "^4ERROR:^3 Dead Players^1 canno't get a bomb." );
  241.             return PLUGIN_HANDLED;
  242.         }
  243.         if ( user_has_weapon( id, CSW_C4 ) )
  244.         {
  245.             ColorChat( id, "^4ERROR:^1 You already own a bomb." );
  246.             return PLUGIN_HANDLED;
  247.         }
  248.         fm_give_item( id, "weapon_c4" );
  249.         ColorChat( id, "You received a^4 Bomb^1." );
  250.     }
  251.     if ( equali( szMsg, "/hardopen" ) || equali( szMsg, "/ho" ) )
  252.         fwHardOpen( id );
  253.     if ( equali( szMsg, "/glow" ) )
  254.         cmdGlow( id );
  255.     if ( equali( szMsg, "/get" ) )
  256.         ShowGetMenu( id );
  257.     if ( equali( szMsg, "/cd" ) )
  258.         cmdCountdown( id );
  259.     if ( equali ( szMsg, "/box" ) )
  260.         cmdBox( id );
  261.     if ( equali( szMsg, "/buyadmin" ) || equali( szMsg, "/buy" ) )
  262.         CmdSalesMenu( id );
  263.     if ( equali(  szMsg, "/open" ) )
  264.         fwOpenCages( id );
  265.    
  266.     return PLUGIN_CONTINUE;
  267. }
  268. /* --------------------------------------------------------------
  269. Game Name Changer
  270. -------------------------------------------------------------- */
  271. public GameDesc( )
  272. {
  273.     forward_return( FMV_STRING, gGameName );
  274.    
  275.     return FMRES_SUPERCEDE;
  276. }
  277. /* --------------------------------------------------------------
  278. Weapon Rendering
  279. -------------------------------------------------------------- */
  280. public fwSetModel( ent )
  281. {
  282.     if ( !pev_valid( ent ) )
  283.         return FMRES_IGNORED;
  284.        
  285.     static id;
  286.     id = pev( ent, pev_owner );
  287.    
  288.     if( !( 1 <= id <= g_MaxClients ) )
  289.         return FMRES_IGNORED;
  290.        
  291.     switch( get_user_team( id ) )
  292.     {
  293.         case 1: fm_set_rendering( ent, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 1 );
  294.         case 2: fm_set_rendering( ent, kRenderFxGlowShell, 0, 0, 255, kRenderNormal, 1 );
  295.     }
  296.     return FMRES_IGNORED;
  297. }
  298. /* --------------------------------------------------------------
  299. Block Kill
  300. -------------------------------------------------------------- */
  301. public BlockKill( id )
  302.     return FMRES_SUPERCEDE;
  303. /* --------------------------------------------------------------
  304. Block Buy
  305. -------------------------------------------------------------- */
  306. public Message_StatusIcon( iMsgId, iMsgDest, id )  
  307. {  
  308.     static szIcon[ 8 ];  
  309.     get_msg_arg_string( 2, szIcon, charsmax( szIcon ) );  
  310.     if( equal(szIcon, "buyzone") )
  311.     {  
  312.         if( get_msg_arg_int( 1 ) )  
  313.         {  
  314.             set_pdata_int( id, 235, get_pdata_int(id, 235) & ~(1<<0) );
  315.             return PLUGIN_HANDLED;  
  316.         }  
  317.     }
  318.     return PLUGIN_CONTINUE;  
  319. }
  320. /* --------------------------------------------------------------
  321. Open Celss
  322. -------------------------------------------------------------- */
  323. public fwOpenCages( id )
  324. {
  325.     if ( cs_get_user_team( id ) != CS_TEAM_CT && !(get_user_flags( id ) & ADMIN_SLAY ) )
  326.     {
  327.         ColorChat( id, "^4ERROR:^3 Prisoners^1 canno't use open." );
  328.         return PLUGIN_HANDLED;
  329.     }
  330.     if ( !is_user_alive( id ) && !(get_user_flags( id ) & ADMIN_SLAY ) )
  331.     {
  332.         ColorChat( id, "^4ERROR:^3 Dead Players^1 canno't use open." );
  333.         return PLUGIN_HANDLED;
  334.     }
  335.     new szName[ 32 ];
  336.    
  337.     get_user_name( id, szName, sizeof (szName) - 1 );
  338.    
  339.     PushEntity( "func_button" );
  340.    
  341.     if ( get_user_flags( id ) & ADMIN_SLAY )    ColorChat( 0, "^3ADMIN:^4 %s^1 has opened the cells!", szName );
  342.     else    ColorChat( 0, "^4%s^1 has opened the cells!", szName );
  343.    
  344.     return PLUGIN_HANDLED;
  345. }
  346. /* --------------------------------------------------------------
  347. Buy Admin
  348. -------------------------------------------------------------- */
  349. public CmdSalesMenu( const client )
  350. {  
  351.     new mItem[ 128 ];
  352.    
  353.     formatex( mItem, charsmax( mItem ), "\w[ \dGalactic \w] \rAdmin Sales \wMenu" );
  354.    
  355.     new menu = menu_create( mItem, "mSales" );
  356.    
  357.     formatex( mItem, charsmax( mItem ), "\rAccess: \w%s \d(Select \w[\d1\w]\d)^n",
  358.    
  359.     g_szAccessList[ AccessId[ client ] ][ m_szAccessName ] );
  360.    
  361.     menu_additem( menu, mItem );
  362.    
  363.     formatex( mItem, charsmax( mItem ), "\rPrice: \y%i Shekels^n\d* The admins are for month!^n*\dSkype: \yBrian16xD | \dSkype: \yaku4360 | \dSkype: \yhen149159",
  364.    
  365.     g_szAccessList[ AccessId[ client ] ][ m_iAccessPrice ] );
  366.    
  367.     menu_addtext( menu, mItem );
  368.    
  369.     menu_setprop( menu, MPROP_EXITNAME, "\wClose Menu" );
  370.    
  371.     menu_display( client, menu );
  372.    
  373.     return 1;
  374. }
  375.  
  376. public mSales( client, menu, item )
  377. {
  378.     if( item == MENU_EXIT )
  379.     {
  380.         AccessId[ client ] = Vip;
  381.        
  382.         menu_destroy( menu );
  383.     }
  384.    
  385.     if( item == Vip )
  386.     {
  387.         AccessId[ client ]++;
  388.        
  389.         if( AccessId[ client ] > Manager )
  390.             AccessId[ client ] = Vip;
  391.        
  392.         CmdSalesMenu( client );
  393.     }
  394. }
  395. /* --------------------------------------------------------------
  396. Spawn Weapons
  397. -------------------------------------------------------------- */
  398. public HamSpawn( id )
  399. {
  400.     if ( !is_user_alive( id ) ) return PLUGIN_HANDLED;
  401.     Glow[ id ] = false;
  402.     switch( cs_get_user_team( id ) )
  403.     {
  404.         case CS_TEAM_T:
  405.         {
  406.             /*
  407.             cs_reset_user_model( id );
  408.             cs_set_user_model( id, "GalacticPrisoner1" );
  409.             */
  410.            
  411.             fm_strip_user_weapons( id );
  412.             fm_give_item( id, "weapon_knife" );
  413.         }
  414.         case CS_TEAM_CT:
  415.         {
  416.             /*
  417.             cs_reset_user_model( id );
  418.             cs_set_user_model( id, "GalacticGuard1" );
  419.             */
  420.            
  421.             fm_strip_user_weapons( id );
  422.            
  423.             fm_give_item( id, "weapon_m4a1" );
  424.             fm_give_item( id, "weapon_deagle" );
  425.             fm_give_item( id, "weapon_smokegrenade" );
  426.             fm_give_item( id, "weapon_knife" );
  427.            
  428.             cs_set_user_bpammo( id, CSW_M4A1, 120 );
  429.             cs_set_user_bpammo( id, CSW_DEAGLE, 70 );
  430.             cs_set_user_bpammo( id, CSW_SMOKEGRENADE, 4 );
  431.            
  432.         }
  433.     }
  434.     return PLUGIN_HANDLED;
  435. }
  436. public client_putinserver( client ) Glow[ client ] = false;
  437. /* --------------------------------------------------------------
  438. Box Menu
  439. -------------------------------------------------------------- */
  440. public cmdBox( id )
  441. {
  442.     if ( cs_get_user_team( id ) != CS_TEAM_CT && !(get_user_flags( id ) & ADMIN_SLAY ) )
  443.     {
  444.         ColorChat( id, "^4ERROR:^3 Prisoners^1 canno't use the box menu." );
  445.         return PLUGIN_HANDLED;
  446.     }
  447.     if ( !is_user_alive( id ) && !(get_user_flags( id ) & ADMIN_SLAY ) )
  448.     {
  449.         ColorChat( id, "^4ERROR:^3 Dead Players^1 canno't use the box menu." );
  450.         return PLUGIN_HANDLED;
  451.     }
  452.     new szItem[ 128 ];
  453.    
  454.     formatex( gTitle, 127, "\y[\d %s \y]\w Box Menu", gPrefix );
  455.    
  456.     new gMenu = menu_create( gTitle, "subBox" );
  457.    
  458.     formatex( szItem, 63, "%sable\w Terrorists Box", BlockDamage ? "\rDis" : "\yEn" )
  459.     menu_additem( gMenu, szItem, "0" );
  460.    
  461.     menu_additem( gMenu, "Reset Prisoners Health (\r100\w)", "1" );
  462.    
  463.     menu_display( id, gMenu );
  464.    
  465.     return PLUGIN_HANDLED;
  466. }
  467. public subBox( id, gMenu, gItem )
  468. {
  469.     if ( cs_get_user_team( id ) != CS_TEAM_CT && !(get_user_flags( id ) & ADMIN_SLAY ) )
  470.     {
  471.         ColorChat( id, "^4ERROR:^3 Prisoners^1 canno't use the box menu." );
  472.         return PLUGIN_HANDLED;
  473.     }
  474.     if ( !is_user_alive( id ) && !(get_user_flags( id ) & ADMIN_SLAY ) )
  475.     {
  476.         ColorChat( id, "^4ERROR:^3 Dead Players^1 canno't use the box menu." );
  477.         return PLUGIN_HANDLED;
  478.     }
  479.     if ( gItem == MENU_EXIT )
  480.     {
  481.         menu_destroy( gMenu );
  482.        
  483.         return PLUGIN_HANDLED;
  484.     }
  485.     new iName[ 64 ], gData[ 6 ];
  486.     new gAccess, gCallback;
  487.    
  488.     menu_item_getinfo( gMenu, gItem, gAccess, gData, 5, iName, 63, gCallback )
  489.    
  490.     new gKey = str_to_num( gData )
  491.    
  492.     new szName[ 32 ]; get_user_name( id, szName, 31 );
  493.    
  494.     switch ( gKey )
  495.     {
  496.         case 0:
  497.         {
  498.             BlockDamage = !BlockDamage;
  499.             set_cvar_num( "mp_friendlyfire", BlockDamage ? 1 : 0 );
  500.             set_hudmessage( BlockDamage ? 0 : 160, BlockDamage ? 160 : 0, 0, 0.1, 0.55, 1, 6.0, 6.0 );
  501.             show_hudmessage( 0, "Terrorists Box is %sabled^nBy %s", BlockDamage ? "En" : "Dis", szName );
  502.            
  503.             cmdBox( id );
  504.         }
  505.         case 1:
  506.         {
  507.             if( BlockDamage )
  508.             {
  509.                 for( new i = 1; i <= get_maxplayers( ); i += 1 )
  510.                 {
  511.                     if( !is_user_alive( i ) )
  512.                     {
  513.                         continue;
  514.                     }
  515.                     if ( cs_get_user_team( i ) == CS_TEAM_T )
  516.                     {
  517.                         fm_set_user_health( i, 100 );
  518.                     }
  519.                 }
  520.             }
  521.             ColorChat( id, "^4%s^1 Set^3 Prisoners^1 health to^4 100 hp", szName );
  522.            
  523.             cmdBox( id );
  524.         }
  525.     }
  526.     menu_destroy( gMenu );
  527.    
  528.     return PLUGIN_HANDLED;
  529. }
  530. public HamTakeDamage( victim, inflictor, attacker, Float:damage, damagebits )
  531. {
  532.     if ( !is_user_connected( attacker ) || !is_user_alive( attacker ) )
  533.         return HAM_IGNORED;
  534.    
  535.     static CsTeams:Team[ 2 ];
  536.    
  537.     Team[ 0 ] = cs_get_user_team( attacker );
  538.    
  539.     Team[ 1 ] = cs_get_user_team( victim );
  540.    
  541.     return ( Team[ 0 ] == CS_TEAM_CT && Team[ 1 ] == Team[ 0 ] && BlockDamage ) ? HAM_SUPERCEDE : HAM_IGNORED;
  542. }  
  543. /* --------------------------------------------------------------
  544. Countdown Menu
  545. -------------------------------------------------------------- */
  546. public cmdCountdown( id )
  547. {
  548.     if ( is_user_alive( id ) && cs_get_user_team( id ) == CS_TEAM_CT || get_user_flags( id ) & ADMIN_SLAY )
  549.     {
  550.         formatex( gTitle, 127, "\y[\d %s \y]\w Countdown Menu", gPrefix );
  551.        
  552.         new gMenu = menu_create( gTitle, "subCountdown" );
  553.        
  554.         menu_additem( gMenu, "Start a Coundtown (\r5 Seconds\w)^n", "0" );
  555.        
  556.         new szItem[ 128 ];
  557.        
  558.         formatex( szItem, 63, "Guards Freeze (\r%s\w)", CTFreeze ? "On" : "Off" );
  559.         menu_additem( gMenu, szItem, "1",  ADMIN_SLAY );
  560.        
  561.         formatex( szItem, 63, "Prisoners Freeze (\r%s\w)", TFreeze ? "On" : "Off" );
  562.         menu_additem( gMenu, szItem, "2", ADMIN_SLAY );
  563.    
  564.         menu_display( id, gMenu );
  565.        
  566.         return PLUGIN_HANDLED;
  567.     }
  568.     if ( cs_get_user_team( id ) != CS_TEAM_CT && !(get_user_flags( id ) & ADMIN_SLAY ) )
  569.     {
  570.         ColorChat( id, "^4ERROR:^3 Prisoners^1 canno't use the cd menu." );
  571.         return PLUGIN_HANDLED;
  572.     }
  573.     if ( !is_user_alive( id ) && !(get_user_flags( id ) & ADMIN_SLAY ) )
  574.     {
  575.         ColorChat( id, "^4ERROR:^3 Dead Players^1 canno't use the cd menu." );
  576.         return PLUGIN_HANDLED;
  577.     }
  578.     return PLUGIN_HANDLED;
  579. }
  580. public subCountdown( id, gMenu, gItem )
  581. {
  582.     if ( is_user_alive( id ) && cs_get_user_team( id ) == CS_TEAM_CT || get_user_flags( id ) & ADMIN_SLAY )
  583.     {
  584.         if ( gItem == MENU_EXIT )
  585.         {
  586.             menu_destroy( gMenu );
  587.            
  588.             return PLUGIN_HANDLED;
  589.         }
  590.         new iName[ 64 ], gData[ 6 ];
  591.         new gAccess, gCallback;
  592.        
  593.         menu_item_getinfo( gMenu, gItem, gAccess, gData, 5, iName, 63, gCallback );
  594.         new gKey = str_to_num( gData );
  595.        
  596.         new szName[ 32 ];
  597.         get_user_name( id, szName, 31 );
  598.        
  599.         switch ( gKey )
  600.         {
  601.             case 0:
  602.             {
  603.                 if ( gCountdown )
  604.                 {
  605.                     ColorChat( id, "^4ERROR:^3 Countdown^1 is already running." );
  606.                     return PLUGIN_HANDLED;
  607.                 }
  608.                 gCount = 5;
  609.                 gCountdown = true;
  610.                 ActionCountdown( );
  611.                 ColorChat( 0, "^4%s^1 started a^3 Countdown^1." );
  612.                 for( new i=1; i<= get_maxplayers(); i++ )
  613.                 {
  614.                     if ( CTFreeze )
  615.                     {
  616.                         if ( cs_get_user_team( i ) == CS_TEAM_CT )
  617.                             set_pev(i, pev_flags, pev(i, pev_flags) | FL_FROZEN );
  618.                     }
  619.                     if ( TFreeze )
  620.                     {
  621.                         if ( cs_get_user_team( i ) == CS_TEAM_T )
  622.                             set_pev(i, pev_flags, pev(i, pev_flags) | FL_FROZEN );
  623.                     }
  624.                 }
  625.             }
  626.             case 1:
  627.             {
  628.                 if ( gCountdown )
  629.                 {
  630.                     ColorChat( id, "^4ERROR:^3 Countdown^1 is already running." );
  631.                     return PLUGIN_HANDLED;
  632.                 }
  633.                 CTFreeze = !CTFreeze;
  634.                 cmdCountdown( id );
  635.             }
  636.             case 2:
  637.             {
  638.                 if ( gCountdown )
  639.                 {
  640.                     ColorChat( id, "^4ERROR:^3 Countdown^1 is already running." );
  641.                     return PLUGIN_HANDLED;
  642.                 }
  643.                 TFreeze = !TFreeze;
  644.                 cmdCountdown( id );
  645.             }
  646.         }
  647.     }
  648.     return menu_destroy( gMenu );
  649. }
  650. public ActionCountdown( )
  651. {
  652.     if ( !gCountdown )
  653.         return PLUGIN_HANDLED;
  654.     if ( gCountdown )
  655.     {
  656.         new Vox[ 32 ]; num_to_word( gCount, Vox, charsmax( Vox ) );
  657.         client_cmd( 0, "spk ^"vox/%s second%s^"", Vox, (gCount>1)?"s":"" );
  658.         set_hudmessage( 255, 0, 0, -1.0, 0.35 );
  659.         show_hudmessage(0, "%d Seconds Left", gCount );
  660.        
  661.        
  662.         set_task( 1.0, "ActionCountdown", 103 );
  663.        
  664.         if ( gCount <= 0 )
  665.         {
  666.             for( new i = 1; i <= get_maxplayers( ); i++ )
  667.             {
  668.                 set_pev( i, pev_flags, pev(i, pev_flags) & ~FL_FROZEN );
  669.             }
  670.             set_hudmessage( 0, 255, 0, -1.0, 0.35 )
  671.             show_hudmessage( 0, "Countdown is Over^nGo Go Go..." );
  672.            
  673.             TFreeze = false;
  674.             CTFreeze = false;
  675.             gCountdown = false;
  676.             gCount = 5;
  677.             remove_task( 103 );
  678.            
  679.             return PLUGIN_HANDLED;     
  680.         }
  681.         gCount -= 1;
  682.         for( new i=1; i<= get_maxplayers(); i++ )
  683.         {
  684.             if ( CTFreeze )
  685.             {
  686.                 if ( cs_get_user_team( i ) == CS_TEAM_CT )
  687.                     set_pev(i, pev_flags, pev(i, pev_flags) | FL_FROZEN );
  688.             }
  689.             if ( TFreeze )
  690.             {
  691.                 if ( cs_get_user_team( i ) == CS_TEAM_T )
  692.                     set_pev( i, pev_flags, pev(i, pev_flags) | FL_FROZEN );
  693.             }
  694.         }
  695.        
  696.         return PLUGIN_HANDLED;
  697.     }
  698.     return PLUGIN_HANDLED;
  699. }
  700. /* --------------------------------------------------------------
  701. Glow Menu
  702. -------------------------------------------------------------- */
  703. public fwHardOpen( id )
  704. {
  705.     if ( !(get_user_flags( id ) & ADMIN_BAN) )
  706.         return PLUGIN_HANDLED;
  707.        
  708.        
  709.     new szName[ 32 ];
  710.    
  711.     get_user_name( id, szName, sizeof (szName) - 1 );
  712.    
  713.     ColorChat( 0, "^4%s^1 has opened the cells ^3(^4 Hard Open ^3)^1.", szName );
  714.    
  715.     new ent = -1
  716.  
  717.     while( (ent = engfunc( EngFunc_FindEntityByString, ent, "classname", "func_door" ) ) )
  718.         dllfunc( DLLFunc_Use, ent, 0 );
  719.     while( ( ent = engfunc( EngFunc_FindEntityByString, ent, "classname", "func_door_rotating" ) ) )
  720.         dllfunc( DLLFunc_Use, ent, 0 );
  721.    
  722.     return PLUGIN_HANDLED;
  723. }
  724. /* --------------------------------------------------------------
  725. Glow Menu
  726. -------------------------------------------------------------- */
  727. public cmdGlow( id )
  728. {
  729.     if ( is_user_alive( id ) && cs_get_user_team( id ) == CS_TEAM_CT || get_user_flags( id ) & ADMIN_SLAY )
  730.     {
  731.         new players[ 32 ], pnum;
  732.         new szName[ 32 ], szItem[ 64 ], szTempId[ 3 ];
  733.        
  734.         formatex( gTitle, charsmax( gTitle ), "[\d %s \y]\w Glow Menu", gPrefix );
  735.         new gMenu = menu_create( gTitle, "subGlow" );
  736.        
  737.         get_players( players, pnum, "ae", "TERRORIST" );
  738.         for( new i=0; i<pnum; i+=1 )
  739.         {
  740.             new tempid = players[ i ];
  741.            
  742.             num_to_str( tempid, szTempId, charsmax( szTempId ) );
  743.             get_user_name( tempid, szName, charsmax( szName ) );
  744.             formatex( szItem, charsmax( szItem ), "\w%s %s", szName, Glow[ tempid ] ? "\r[\w Glow \r]" : "" );
  745.            
  746.             if ( !is_user_alive( tempid ) )
  747.                 return PLUGIN_HANDLED;
  748.            
  749.             menu_additem( gMenu, szItem, szTempId );
  750.         }
  751.         menu_setprop( gMenu, MPROP_PERPAGE, 6 );
  752.         menu_setprop( gMenu, MPROP_NUMBER_COLOR, "\y" );
  753.         menu_display( id, gMenu );
  754.        
  755.         return PLUGIN_HANDLED;
  756.     }
  757.     if ( cs_get_user_team( id ) != CS_TEAM_CT && !(get_user_flags( id ) & ADMIN_SLAY ) )
  758.     {
  759.         ColorChat( id, "^4ERROR:^3 Prisoners^1 canno't use the glow menu." );
  760.         return PLUGIN_HANDLED;
  761.     }
  762.     if ( !is_user_alive( id ) && !(get_user_flags( id ) & ADMIN_SLAY ) )
  763.     {
  764.         ColorChat( id, "^4ERROR:^3 Dead Players^1 canno't use the glow menu." );
  765.         return PLUGIN_HANDLED;
  766.     }
  767.     return PLUGIN_HANDLED;
  768. }
  769. public subGlow( id, gMenu, gItem )
  770. {
  771.     new mData[ 6 ], _Trash;
  772.     menu_item_getinfo( gMenu, gItem, _Trash, mData, charsmax( mData ), "", 0, _Trash );
  773.     if( gItem != MENU_EXIT )
  774.     {
  775.         new tempid = str_to_num( mData );
  776.        
  777.         if ( is_user_alive( id ) && cs_get_user_team( id ) == CS_TEAM_CT || get_user_flags( id ) & ADMIN_SLAY )
  778.         {
  779.             new szName[ 32 ], szTempid[ 32 ];
  780.            
  781.             get_user_name( id, szName, sizeof (szName) - 1 );
  782.            
  783.             get_user_name( tempid, szTempid, sizeof (szTempid) - 1 );
  784.            
  785.             fm_set_user_rendering( tempid, kRenderFxGlowShell, !Glow[ tempid ] ? 255 : 0, !Glow[ tempid ] ? 127 : 0, 0, kRenderNormal, !Glow[ tempid ] ? 75 : 0 );
  786.            
  787.             ColorChat( 0, "^4%s^3 %s^4 Glow^1 %s^4 %s^1 and is now^4 %s^1!",
  788.             szName, !Glow[tempid]?"Gave":"Took Away", !Glow[tempid]?"to":"from", szTempid, !Glow[tempid]?"Glowing":"Not Glowing" );
  789.            
  790.             Glow[ tempid ] = !Glow[ tempid ];
  791.            
  792.             return PLUGIN_HANDLED;
  793.         }
  794.        
  795.         if ( cs_get_user_team( tempid ) != CS_TEAM_T )
  796.         {
  797.             ColorChat( id, "^4ERROR:^3 Player^1 is not a^4 Prisoner^1." );
  798.             return PLUGIN_HANDLED;
  799.         }
  800.         if ( !is_user_alive( tempid ) )
  801.         {
  802.             ColorChat( id, "^4ERROR:^3 Player^1 is not ^4Alive^1." );
  803.             return PLUGIN_HANDLED;
  804.         }
  805.         if ( cs_get_user_team( id ) != CS_TEAM_CT && !(get_user_flags( id ) & ADMIN_SLAY ) )
  806.         {
  807.             ColorChat( id, "^4ERROR:^3 Prisoners^1 canno't use the glow menu." );
  808.             return PLUGIN_HANDLED;
  809.         }
  810.         if ( !is_user_alive( id ) || !(get_user_flags( id ) & ADMIN_SLAY ) )
  811.         {
  812.             ColorChat( id, "^4ERROR:^3 Dead Players^1 canno't use the glow menu." );
  813.             return PLUGIN_HANDLED;
  814.         }
  815.     }
  816.     menu_destroy( gMenu );
  817.     return PLUGIN_HANDLED;
  818. }
  819.  
  820. /* --------------------------------------------------------------
  821. First Actions
  822. -------------------------------------------------------------- */
  823. public cmdSay( id )
  824. {  
  825.     new szMsg[ 192 ], szName[ 32 ];
  826.    
  827.     read_argv( 1, szMsg, charsmax( szMsg ) );
  828.    
  829.     get_user_name( id, szName, sizeof (szName) - 1 );
  830.    
  831.     if ( equal( szMsg, "/ts" ) || equal( szMsg, "/translate" ) )
  832.     {
  833.         if ( cs_get_user_team( id ) != CS_TEAM_CT )
  834.         {
  835.             ColorChat( id, "^4ERROR:^3 Prisoners^1 canno't start^4 Translate^1." );
  836.             return PLUGIN_HANDLED;
  837.         }
  838.        
  839.         if ( !is_user_alive( id ) )
  840.         {
  841.             ColorChat( id, "^4ERROR:^3 Dead Players^1 canno't start^4 Translate^1." );
  842.             return PLUGIN_HANDLED;
  843.         }
  844.        
  845.         if ( fwTranslate )
  846.         {
  847.             ColorChat( id, "^4ERROR:^3 Translate Event^1 is already running^1." );
  848.             return PLUGIN_HANDLED;
  849.         }
  850.        
  851.         if ( fwFirstwrites )
  852.         {
  853.             ColorChat( id, "^4ERROR:^3 Firstwrites Event^1 is running^1." );
  854.             return PLUGIN_HANDLED;
  855.         }
  856.        
  857.         if ( fwMath )
  858.         {
  859.             ColorChat( id, "^4ERROR:^3 Math Event^1 is running^1." );
  860.             return PLUGIN_HANDLED;
  861.         }
  862.        
  863.         ColorChat( 0, "^4%s^1 just started a^3 Translate Event^1!", szName );
  864.        
  865.         fwWords     = "!׳”׳׳‘׳” ׳”׳œ׳™׳ž׳” ׳×׳ ׳׳’׳¨׳×";
  866.        
  867.         fwTranslate = true;
  868.        
  869.         fwCount = 5;
  870.        
  871.         set_task( 1.0, "Countdown", 999, _,_, "b" );
  872.     }
  873.    
  874.     if ( equal( szMsg, "/sts" ) || equal( szMsg, "/stopts" ) )
  875.     {
  876.         if ( cs_get_user_team( id ) != CS_TEAM_CT )
  877.         {
  878.             ColorChat( id, "^4ERROR:^3 Prisoners^1 canno't stop^4 Translate^1." );
  879.             return PLUGIN_HANDLED;
  880.         }
  881.        
  882.         if ( !is_user_alive( id ) )
  883.         {
  884.             ColorChat( id, "^4ERROR:^3 Dead Players^1 canno't stop^4 Translate^1." );
  885.             return PLUGIN_HANDLED;
  886.         }
  887.        
  888.         if ( fwFirstwrites )
  889.         {
  890.             ColorChat( id, "^4ERROR:^3 Firstwrites Event^1 is running^1." );
  891.             return PLUGIN_HANDLED;
  892.         }
  893.        
  894.         if ( !fwTranslate )
  895.         {
  896.             ColorChat( id, "^4ERROR:^3 Translate Event^1 is not running^1." );
  897.             return PLUGIN_HANDLED;
  898.         }
  899.        
  900.         if ( fwMath )
  901.         {
  902.             ColorChat( id, "^4ERROR:^3 Math Event^1 is running^1." );
  903.             return PLUGIN_HANDLED;
  904.         }
  905.        
  906.         ColorChat( 0, "^4%s^1 just stopped a^3 Translate Event^1!", szName );
  907.        
  908.         Move = false;
  909.        
  910.         fwTranslate = false;
  911.        
  912.         remove_task( 999 );
  913.     }
  914.    
  915.     if ( equal( szMsg, "/fw" ) || equal( szMsg, "/fwstart" ) )
  916.     {
  917.         if ( !(get_user_flags( id ) & ADMIN_KICK ) )
  918.         {
  919.             ColorChat( id, "^4ERROR:^3 Only Admin^1 can start^4 First Writes^1." );
  920.             return PLUGIN_HANDLED;
  921.         }
  922.        
  923.         if ( fwFirstwrites )
  924.         {
  925.             ColorChat( id, "^4ERROR:^3 Firstwrites Event^1 is already running^1." );
  926.             return PLUGIN_HANDLED;
  927.         }
  928.        
  929.         if ( fwMath )
  930.         {
  931.             ColorChat( id, "^4ERROR:^3 Math Event^1 is running^1." );
  932.             return PLUGIN_HANDLED;
  933.         }
  934.        
  935.         if ( fwTranslate )
  936.         {
  937.             ColorChat( id, "^4ERROR:^3 Translate Event^1 is running^1." );
  938.             return PLUGIN_HANDLED;
  939.         }
  940.        
  941.         ColorChat( 0, "^4%s^1 just started a^3 Fristwrites Event^1!", szName );
  942.        
  943.         fwWords     = "The first one to write will move to the Guards team!^n";
  944.        
  945.         fwFirstwrites   = true;
  946.        
  947.         fwCount = 5;
  948.        
  949.         set_task( 1.0, "Countdown", 999, _,_, "b" );
  950.     }
  951.    
  952.     if ( equal( szMsg, "/sfw" ) || equal( szMsg, "/stopfw" ) || equal( szMsg, "/stopfirst" ) )
  953.     {
  954.         if ( !(get_user_flags( id ) & ADMIN_KICK ) )
  955.         {
  956.             ColorChat( id, "^4ERROR:^3 Only Admin^1 can stop^4 First Writes^1." );
  957.             return PLUGIN_HANDLED;
  958.         }
  959.        
  960.         if ( !fwFirstwrites )
  961.         {
  962.             ColorChat( id, "^4ERROR:^3 Firstwrites Event^1 is not running^1." );
  963.             return PLUGIN_HANDLED;
  964.         }
  965.        
  966.         if ( fwMath )
  967.         {
  968.             ColorChat( id, "^4ERROR:^3 Math Event^1 is running^1." );
  969.             return PLUGIN_HANDLED;
  970.         }
  971.        
  972.         if ( fwTranslate )
  973.         {
  974.             ColorChat( id, "^4ERROR:^3 Translate Event^1 is running^1." );
  975.             return PLUGIN_HANDLED;
  976.         }
  977.        
  978.         ColorChat( 0, "^4%s^1 just stopped a^3 Translate Event^1!", szName );
  979.        
  980.         Move = false;
  981.        
  982.         fwFirstwrites = false;
  983.        
  984.         remove_task( 999 );
  985.     }
  986.        
  987.     if ( fwTranslate )
  988.     {
  989.         if ( equal( szMsg, fw_engChars ) )
  990.         {
  991.             if ( !Move )                    return PLUGIN_HANDLED;
  992.             if ( cs_get_user_team( id ) == CS_TEAM_CT ) return PLUGIN_HANDLED;
  993.             if ( !is_user_alive( id ) )         return PLUGIN_HANDLED;
  994.            
  995.             ColorChat( 0, "^4%s^1 won the^3 Translate Event^1, The answer was^4 %s", szName, fw_engChars );
  996.            
  997.             set_hudmessage( 0, 160, 0, -1.0, 0.31, 1, 1.0, 8.0 );
  998.            
  999.             show_hudmessage( 0, "%s won the Translate Event, The answer was %s", szName, fw_engChars );
  1000.            
  1001.             fwTranslate = false;
  1002.            
  1003.             remove_task( 999 );
  1004.            
  1005.             Move = false;
  1006.         }
  1007.     }
  1008.    
  1009.     if ( fwFirstwrites )
  1010.     {
  1011.         if ( equal( szMsg, fw_Chars ) )
  1012.         {
  1013.             if ( !Move )                    return PLUGIN_HANDLED;
  1014.             if ( cs_get_user_team( id ) == CS_TEAM_CT ) return PLUGIN_HANDLED;
  1015.            
  1016.             set_hudmessage( 0, 160, 0, -1.0, 0.31, 1, 1.0, 8.0 );
  1017.            
  1018.             show_hudmessage( 0, "%s won the Firstwrites Event! and was moved to the Guards Team!", szName );
  1019.            
  1020.             ColorChat( 0, "^4%s^1 won the^3 Firstwrites Event^1! and was moved to the^3 Guards Team^1!", szName );
  1021.            
  1022.             fwFirstwrites = false;
  1023.            
  1024.             remove_task( 999 );
  1025.            
  1026.             Move = false;
  1027.            
  1028.             cs_set_user_team( id, CS_TEAM_CT );
  1029.            
  1030.             dllfunc( DLLFunc_Spawn, id );
  1031.         }
  1032.     }
  1033.    
  1034.     if ( equal( szMsg, "/math" ) )
  1035.     {
  1036.         if ( cs_get_user_team( id ) != CS_TEAM_CT )
  1037.         {
  1038.             ColorChat( id, "^4ERROR:^3 Prisoners^1 canno't start^4 Math^1." );
  1039.             return PLUGIN_HANDLED;
  1040.         }
  1041.        
  1042.         if ( !is_user_alive( id ) )
  1043.         {
  1044.             ColorChat( id, "^4ERROR:^3 Dead Players^1 canno't start^4 Math^1." );
  1045.             return PLUGIN_HANDLED;
  1046.         }
  1047.        
  1048.         if ( fwTranslate )
  1049.         {
  1050.             ColorChat( id, "^4ERROR:^3 Translate Event^1 is already running^1." );
  1051.             return PLUGIN_HANDLED;
  1052.         }
  1053.        
  1054.         if ( fwFirstwrites )
  1055.         {
  1056.             ColorChat( id, "^4ERROR:^3 Firstwrites Event^1 is running^1." );
  1057.             return PLUGIN_HANDLED;
  1058.         }
  1059.        
  1060.         if ( fwMath )
  1061.         {
  1062.             ColorChat( id, "^4ERROR:^3 Math Event^1 is already running^1." );
  1063.             return PLUGIN_HANDLED;
  1064.         }
  1065.        
  1066.         ColorChat( 0, "^4%s^1 just started a^3 Math Event^1!", szName );
  1067.        
  1068.         fwMath  = true;
  1069.        
  1070.         fwCount = 5;
  1071.        
  1072.         set_task( 1.0, "Countdown", 999, _,_, "b" );
  1073.     }
  1074.    
  1075.     if ( equal( szMsg, "/stopmath" ) )
  1076.     {
  1077.         if ( cs_get_user_team( id ) != CS_TEAM_CT )
  1078.         {
  1079.             ColorChat( id, "^4ERROR:^3 Prisoners^1 canno't stop^4 Math^1." );
  1080.             return PLUGIN_HANDLED;
  1081.         }
  1082.        
  1083.         if ( !is_user_alive( id ) )
  1084.         {
  1085.             ColorChat( id, "^4ERROR:^3 Dead Players^1 canno't stop^4 Math^1." );
  1086.             return PLUGIN_HANDLED;
  1087.         }
  1088.        
  1089.         if ( fwFirstwrites )
  1090.         {
  1091.             ColorChat( id, "^4ERROR:^3 Firstwrites Event^1 is running^1." );
  1092.             return PLUGIN_HANDLED;
  1093.         }
  1094.        
  1095.         if ( fwTranslate )
  1096.         {
  1097.             ColorChat( id, "^4ERROR:^3 Translate Event^1 is running^1." );
  1098.             return PLUGIN_HANDLED;
  1099.         }
  1100.        
  1101.         if ( !fwMath )
  1102.         {
  1103.             ColorChat( id, "^4ERROR:^3 Math Event^1 is not running^1." );
  1104.             return PLUGIN_HANDLED;
  1105.         }
  1106.        
  1107.         ColorChat( 0, "^4%s^1 just stopped a^3 Math Event^1!", szName );
  1108.        
  1109.         Move = false;
  1110.        
  1111.         fwMath = false;
  1112.        
  1113.         remove_task( 999 );
  1114.     }
  1115.    
  1116.     if ( fwMath )
  1117.     {
  1118.         if ( equal( szMsg, fwAnswer ) )
  1119.         {
  1120.             if ( !Move )                    return PLUGIN_HANDLED;
  1121.             if ( cs_get_user_team( id ) == CS_TEAM_CT ) return PLUGIN_HANDLED;
  1122.             if ( !is_user_alive( id ) )         return PLUGIN_HANDLED;
  1123.            
  1124.             ColorChat( 0, "^4%s^1 won the^3 Math Event^1, The answer was^4 %s^1.", szName, fwAnswer );
  1125.            
  1126.             set_hudmessage( 0, 160, 0, -1.0, 0.31, 1, 1.0, 8.0 );
  1127.            
  1128.             show_hudmessage( 0, "%s won the Math Event, The answer was %s.", szName, fwAnswer );
  1129.            
  1130.             fwMath = false;
  1131.            
  1132.             remove_task( 999 );
  1133.            
  1134.             Move = false;
  1135.         }
  1136.     }
  1137.    
  1138.     return PLUGIN_CONTINUE;
  1139. }
  1140.  
  1141. public Countdown( )
  1142. {
  1143.     if ( fwTranslate )
  1144.     {
  1145.         if( fwCount <= 0 )
  1146.         {
  1147.             Move = true;
  1148.            
  1149.             fwNums[ 0 ] = random( Max_Translate );
  1150.            
  1151.             get_heb( fw_hebChars, charsmax( fw_hebChars ) );
  1152.            
  1153.             get_eng( fw_engChars, charsmax( fw_engChars ) );
  1154.            
  1155.             set_hudmessage( 0, 160, 0, -1.0, 0.31, 1, 1.0, 8.0 );
  1156.            
  1157.             show_hudmessage( 0, "^"%s^" %s", fw_hebChars, fwWords );
  1158.            
  1159.             ColorChat( 0, "^"^4 %s ^1^"^3 %s", fw_hebChars, fwWords );
  1160.            
  1161.             remove_task( 999 );
  1162.            
  1163.             set_task( 20.0, "eventFailed", 999 );
  1164.         }
  1165.     }
  1166.     if ( fwFirstwrites )
  1167.     {
  1168.         if( fwCount <= 0 )
  1169.         {
  1170.             Move = true;
  1171.            
  1172.             switch ( random_num( 1, 3 ) )
  1173.             {
  1174.                 case 1: get_chars( fw_Chars, charsmax( fw_Chars ) );
  1175.                 case 2: get_nums( fw_Chars, charsmax( fw_Chars ) );
  1176.                 case 3: get_numsNchars( fw_Chars, charsmax( fw_Chars ) );
  1177.             }
  1178.            
  1179.             set_hudmessage( 0, 160, 0, -1.0, 0.31, 1, 1.0, 8.0 );
  1180.            
  1181.             show_hudmessage( 0, "%s[ %s ]", fwWords, fw_Chars )
  1182.            
  1183.             ColorChat( 0, "^3%s^1 ^"^4%s^1^"", fwWords, fw_Chars )
  1184.            
  1185.             remove_task( 999 );
  1186.            
  1187.             set_task( 20.0, "eventFailed", 999 );
  1188.         }
  1189.     }
  1190.     if ( fwMath )
  1191.     {
  1192.         if( fwCount <= 0 )
  1193.         {
  1194.             Move = true;
  1195.            
  1196.             fwNums[ 0 ] = random( 500 );
  1197.            
  1198.             fwNums[ 1 ] = random( 450 );
  1199.            
  1200.             switch ( random_num( 1, 2 ) )
  1201.             {
  1202.                 case 1:
  1203.                 {
  1204.                     format( fwAnswer, charsmax( fwAnswer ), "%d", fwNums[ 0 ] + fwNums[ 1 ] );
  1205.                    
  1206.                     format( fwSign, charsmax( fwSign ), "+" );
  1207.                 }
  1208.                 case 2:
  1209.                 {
  1210.                     format( fwAnswer, charsmax( fwAnswer ), "%d", fwNums[ 0 ] - fwNums[ 1 ] );
  1211.                    
  1212.                     format( fwSign, charsmax( fwSign ), "-" );
  1213.                 }
  1214.             }
  1215.            
  1216.             set_hudmessage( 0, 160, 0, -1.0, 0.31, 1, 1.0, 8.0 );
  1217.            
  1218.             show_hudmessage( 0, "Answer the math question!^n%d %s %d = ?", fwNums[ 0 ], fwSign, fwNums[ 1 ] );
  1219.            
  1220.             ColorChat( 0, "^3Answer the math question! ^4%d^1 %s^3 %d^1 = ?", fwNums[ 0 ], fwSign, fwNums[ 1 ] );
  1221.            
  1222.             remove_task( 999 );
  1223.            
  1224.             set_task( 20.0, "eventFailed", 999 );
  1225.         }
  1226.     }
  1227.     if( fwCount != 0 )
  1228.     {
  1229.         new Vox[ 32 ]; num_to_word( fwCount, Vox, charsmax( Vox ) );
  1230.        
  1231.         client_cmd( 0, "spk ^"vox/%s second%s^"", Vox, (fwCount>1)?"s":"" );
  1232.        
  1233.         switch ( fwCount )
  1234.         {
  1235.             case 1: set_hudmessage( 0, 255, 255, -1.0, 0.31, 0, 0.1, 0.5 );
  1236.            
  1237.             case 2: set_hudmessage( 255, 255, 0, -1.0, 0.31, 0, 0.1, 0.5 );
  1238.            
  1239.             case 3: set_hudmessage( 255, 100, 100, -1.0, 0.31, 0, 0.1, 0.5 );
  1240.            
  1241.             case 4: set_hudmessage( 255, 0, 0, -1.0, 0.31, 0, 0.1, 0.5 );
  1242.            
  1243.             case 5: set_hudmessage( 255, 0, 255, -1.0, 0.31, 0, 0.1, 0.5 );
  1244.         }
  1245.        
  1246.         show_hudmessage( 0, "׳×׳•׳™׳ ׳© %d", fwCount );
  1247.        
  1248.         fwCount -= 1
  1249.     }
  1250. }
  1251.  
  1252. public eventFailed( )
  1253. {
  1254.     if ( fwTranslate )
  1255.     {
  1256.         ColorChat( 0, "Nobody has answered^4 correctly^1 ^3(^1 Translate Failed ^3)^1. [^4Answer:^3 %s^1]", fw_engChars );
  1257.        
  1258.         fwTranslate = false;
  1259.        
  1260.         Move = false;
  1261.        
  1262.         return PLUGIN_HANDLED;
  1263.     }
  1264.    
  1265.     if ( fwFirstwrites )
  1266.     {
  1267.         ColorChat( 0, "Nobody has answered^4 correctly^1 ^3(^1 Firstwrites Failed ^3)^1. [^4Combination:^3 %s^1]", fw_Chars );
  1268.        
  1269.         fwFirstwrites = false;
  1270.        
  1271.         Move = false;
  1272.        
  1273.         return PLUGIN_HANDLED;
  1274.     }
  1275.    
  1276.     if ( fwMath )
  1277.     {
  1278.         ColorChat( 0, "Nobody has answered^4 correctly^1 ^3(^1 Math Failed ^3)^1. [^4Answer:^3 %s^1]", fwAnswer );
  1279.        
  1280.         fwMath = false;
  1281.        
  1282.         Move = false;
  1283.        
  1284.         return PLUGIN_HANDLED;
  1285.     }
  1286.    
  1287.     return PLUGIN_CONTINUE;
  1288. }
  1289. /* --------------------------------------------------------------
  1290. Get Menu
  1291. -------------------------------------------------------------- */
  1292. public ShowGetMenu( client )
  1293. {
  1294.     if ( fm_get_user_team( client ) != FM_TEAM_CT )
  1295.         ColorChat( client, "This command is for Gurad-Team Only" );
  1296.        
  1297.     else if ( !is_user_alive( client ) )
  1298.         ColorChat( client, "This command is for Alive CT Only" );
  1299.        
  1300.     else
  1301.     {
  1302.         new title[ 32 ];
  1303.        
  1304.         formatex( title, charsmax( title ), "\r[\w Galactic \r]\y Get Menu");
  1305.        
  1306.         new menu = menu_create( title, "HandleGetMenu" );
  1307.        
  1308.         new szName[ 32 ], players[ 32 ], szTemp[ 10 ], pnum, player;
  1309.        
  1310.         get_players( players, pnum, "ch" );
  1311.        
  1312.         for ( new i; i < pnum; i++ )
  1313.         {
  1314.             player = players[ i ];
  1315.            
  1316.             if ( !is_user_alive( player ) || !is_user_connected( player ) || fm_get_user_team( player ) != FM_TEAM_T )
  1317.                 continue;
  1318.                
  1319.             get_user_name( player, szName, charsmax( szName ) );
  1320.            
  1321.             num_to_str( player, szTemp, charsmax( szTemp ) );
  1322.            
  1323.             menu_additem( menu, szName, szTemp );
  1324.         }
  1325.        
  1326.         menu_setprop( menu, MPROP_EXIT, MENU_EXIT );
  1327.        
  1328.         menu_display( client, menu );
  1329.     }
  1330. }
  1331.  
  1332. public HandleGetMenu( client, menu, item )
  1333. {
  1334.     if ( item == MENU_EXIT )
  1335.     {
  1336.         menu_destroy( menu );
  1337.        
  1338.         return;
  1339.     }
  1340.    
  1341.     new data[ 6 ], szName[ 64 ], access, callback;
  1342.            
  1343.     menu_item_getinfo( menu, item, access, data, charsmax( data ), szName, charsmax( szName ), callback );
  1344.        
  1345.     new player = str_to_num( data );
  1346.    
  1347.     if ( !is_user_connected( player ) )
  1348.         return;
  1349.        
  1350.     if ( !is_user_alive( player ) )
  1351.         ColorChat( client, "This player has to be alive" );
  1352.        
  1353.     else if ( fm_get_user_team( player ) != FM_TEAM_T )
  1354.         ColorChat( client, "You can Switch team with a Terrorist Only" );
  1355.        
  1356.     else
  1357.         ShowGetAcceptMenu( player, client );
  1358. }
  1359.  
  1360. public ShowGetAcceptMenu( player, client )
  1361. {
  1362.     new title[ 64 ], szName[ 32 ], szYes[ 32 ], szNo[ 32 ], szTemp[ 10 ];
  1363.        
  1364.     get_user_name( client, szName, charsmax( szName ) );
  1365.    
  1366.     formatex( title, charsmax( title ), "\r[\w Galactic-Jail \r]\y Would you like to Switch\w %s ?",szName );
  1367.    
  1368.     new menu = menu_create( title, "HandleGetAcceptMenu" );
  1369.    
  1370.     num_to_str( client, szTemp, charsmax( szTemp ) );
  1371.    
  1372.     formatex( szYes, charsmax( szYes ), "1 %s", szTemp );
  1373.     formatex( szNo, charsmax( szNo ), "2 %s", szTemp );
  1374.    
  1375.     menu_additem( menu, "Yes", szYes );
  1376.     menu_additem( menu, "No", szNo );
  1377.    
  1378.     menu_setprop( menu, MPROP_EXIT, MENU_EXIT );
  1379.    
  1380.     menu_display( player, menu );
  1381. }
  1382.  
  1383. public HandleGetAcceptMenu( player, menu, item )
  1384. {
  1385.     new data[ 6 ], Name[ 64 ], szName[ 32 ], szName2[ 32 ], szKey[ 10 ], szClient[ 10 ], access, callback;
  1386.            
  1387.     menu_item_getinfo( menu, item, access, data, charsmax( data ), Name, charsmax( Name ), callback );
  1388.    
  1389.     parse( data, szKey, charsmax( szKey ), szClient, charsmax( szClient ) );
  1390.    
  1391.     new key     = item == MENU_EXIT ? 2 : str_to_num( szKey );
  1392.     new client  = str_to_num( szClient );
  1393.    
  1394.     get_user_name( client, szName2, charsmax( szName2 ) );
  1395.     get_user_name( player, szName, charsmax( szName ) );
  1396.    
  1397.     switch( key )
  1398.     {
  1399.         case 1:
  1400.         {
  1401.             if(cs_get_user_team(client) != CS_TEAM_T)
  1402.             {
  1403.                 ColorChat( 0, "^3%s^1 and^3 %s^1 Switched Teams !", szName, szName2 );
  1404.                
  1405.                 fm_set_user_team( client, FM_TEAM_T );
  1406.                 fm_set_user_team( player, FM_TEAM_CT );
  1407.                
  1408.                 dllfunc( DLLFunc_Spawn, client );
  1409.                 dllfunc( DLLFunc_Spawn, player );
  1410.             }
  1411.         }
  1412.        
  1413.         case 2:
  1414.         {
  1415.             if(cs_get_user_team(client) != CS_TEAM_T)
  1416.                 ColorChat( client, "^3%s^1 Denied your request to switch Teams.", szName );
  1417.         }
  1418.     }
  1419. }
  1420. /* --------------------------------------------------------------
  1421. Stocks
  1422. -------------------------------------------------------------- */
  1423. stock fm_get_user_team( client ) {
  1424.     return get_pdata_int( client, 114 );
  1425. }
  1426.  
  1427. stock fm_set_user_team(client, team) {
  1428.     set_pdata_int( client, 114, team );
  1429.    
  1430.     static const TeamInfo[ Teams ][] =
  1431.     {
  1432.         "UNASSIGNED",
  1433.         "TERRORIST",
  1434.         "CT",
  1435.         "SPECTATOR"
  1436.     };
  1437.    
  1438.     message_begin( MSG_ALL, get_user_msgid( "TeamInfo" ) ) ;
  1439.     write_byte( client );
  1440.     write_string( TeamInfo[ team ] );
  1441.     message_end( );
  1442. }
  1443. stock get_heb( output[], len )
  1444.     format( output, len, "%s", fw_hebTranslate[ fwNums[ 0 ] ] );   
  1445.    
  1446. stock get_eng( output[], len )
  1447.     format( output, len, "%s", fw_engTranslate[ fwNums[ 0 ] ] );
  1448.    
  1449. stock get_chars( output[], len )
  1450. {
  1451.     format( output, len, "%s%s%s%s%s%s",
  1452.     fw_FirstChars[ random( 52 ) ], fw_FirstChars[ random( 52 ) ],
  1453.     fw_FirstChars[ random( 52 ) ], fw_FirstChars[ random( 52 ) ],
  1454.     fw_FirstChars[ random( 52 ) ], fw_FirstChars[ random( 52 ) ] );
  1455. }
  1456. stock get_nums( output[], len )
  1457. {
  1458.     format( output, len, "%d%d%d%d%d%d",
  1459.     random( 9 ), random( 9 ), random( 9 ),
  1460.     random( 9 ), random( 9 ), random( 9 ) );
  1461. }
  1462.  
  1463. stock get_numsNchars( output[], len )
  1464. {
  1465.     format( output, len, "%s%s%s%s%s%s",
  1466.     fw_FirstNumsNChars[ random( 62 ) ], fw_FirstNumsNChars[ random( 62 ) ],
  1467.     fw_FirstNumsNChars[ random( 62 ) ], fw_FirstNumsNChars[ random( 62 ) ],
  1468.     fw_FirstNumsNChars[ random( 62 ) ], fw_FirstNumsNChars[ random( 62 ) ] );
  1469. }
  1470.    
  1471. stock ColorChat( const id, const string[], any:... )
  1472. {
  1473.     new msg[191], players[32], count = 1;
  1474.    
  1475.     static len; len = formatex(msg, charsmax(msg), "^1[^4 %s ^1] ", gPrefix );
  1476.     vformat(msg[len], charsmax(msg) - len, string, 3);
  1477.    
  1478.     if(id)  players[0] = id;
  1479.     else    get_players(players,count,"ch");
  1480.    
  1481.     for (new i = 0; i < count; i++)
  1482.     {
  1483.         if(is_user_connected(players[i]))
  1484.         {
  1485.             message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"),_, players[i]);
  1486.             write_byte(players[i]);
  1487.             write_string(msg);
  1488.             message_end();
  1489.         }
  1490.     }
  1491. }
  1492. stock PushEntity( const szClassname[] )
  1493. {
  1494.     static szClass[ 32 ], target[ 32 ], ent = -1, door;
  1495.    
  1496.     while( ( ent = fm_find_ent_by_class( ent, szClassname ) ) )
  1497.     {                  
  1498.         pev( ent, pev_target, target, charsmax( target ) );
  1499.        
  1500.         door = engfunc( EngFunc_FindEntityByString, 0, "targetname", target );
  1501.        
  1502.         if( !pev_valid( door ) )
  1503.             continue;
  1504.        
  1505.         pev( door, pev_classname, szClass, charsmax( szClass ) );
  1506.        
  1507.         if( !equali( szClass, "func_door" ) )
  1508.             continue;
  1509.        
  1510.         dllfunc( DLLFunc_Use, ent, 0 );
  1511.     }
  1512. }
Add Comment
Please, Sign In to add comment