Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include < amxmodx >
- #include < cstrike >
- #include < fakemeta >
- #include < fakemeta_util >
- #include < hamsandwich >
- /* Defines */
- #define gPrefix "Galactic"
- #define gGameName "Galactic JailBreak"
- #define Max_Translate 101
- /* Variables */
- new gTitle[ 128 ];
- new gCount = 5;
- new AccessId[ 33 ];
- new g_MaxClients;
- /* Booleans */
- new bool:Glow[ 33 ];
- new bool:BlockDamage;
- new bool:TFreeze
- new bool:CTFreeze
- new bool:gCountdown
- /* Enums */
- enum _:Teams
- {
- FM_TEAM_UNASSIGNED,
- FM_TEAM_T,
- FM_TEAM_CT,
- FM_TEAM_SPECTATOR
- };
- enum _:Level
- {
- Vip,
- Admin,
- Manager
- };
- enum _:Data
- {
- m_szAccessName[16],
- m_iAccessPrice
- };
- /* Const */
- new const g_szAccessList[ Level ][ Data ] =
- {
- { "Vip", 20 },
- { "Admin", 40 },
- { "Manager", 60 }
- };
- new fw_engTranslate[ Max_Translate ][ ] =
- {
- "quick", "river", "phone", "keyboard", "mouse",
- "glasses", "windows", "bottle", "plate", "screen",
- "paper", "newspaper", "fork", "knife", "toilet",
- // 3
- "news", "keys", "open", "close", "bed",
- "pillow", "blanket", "wall", "closet", "dresser",
- "pen", "pencil", "money", "gold", "disc",
- // 6
- "banana", "pear", "pineapple", "orange", "headphones",
- "microphone", "plum", "remote", "batteries", "clock",
- "time", "car", "neck", "head", "hand",
- // 9
- "leg", "eyes", "fingers", "hat", "shirt",
- "pants", "book", "conversation", "shoes", "nerds",
- "orange", "purple", "red", "pink", "blue",
- // 12
- "azure", "green", "yellow", "bible", "beard",
- "poker", "page", "pirates", "love", "happy",
- "night", "day", "planet", "plant", "number",
- // 15
- "tree", "one", "two", "three", "four",
- "six", "seven", "eight", "nine", "ten",
- "eleven", "twelve", "shower", "water", "circle",
- // 18
- "square", "kitchen", "room", "floor", "voice",
- "speakers", "computer", "plug", "glass", "net",
- "ball" // 21
- }
- new fw_hebTranslate[ Max_Translate ][ ] =
- {
- "׳–׳™׳¨׳–", "׳¨׳”׳ ", "׳׳•׳₪׳׳׳₪", "׳×׳“׳׳§׳", "׳¨׳‘׳›׳¢",
- "׳׳™׳™׳₪׳§׳©׳", "׳×׳•׳ ׳•׳׳—", "׳§׳•׳‘׳§׳‘", "׳×׳—׳׳¦", "׳׳¡׳",
- "׳¨׳™׳™׳ ", "׳׳•׳×׳™׳¢", "׳’׳׳–׳", "׳׳™׳›׳¡", "׳”׳׳¡׳",
- // 3
- "׳×׳•׳©׳“׳—", "׳×׳•׳—׳×׳₪׳", "׳—׳•׳×׳₪׳", "׳¨׳•׳’׳¡׳", "׳”׳˜׳™׳",
- "׳×׳™׳¨׳›", "׳”׳›׳™׳׳¡", "׳¨׳™׳§", "׳׳•׳¨׳", "׳”׳“׳™׳©",
- "׳˜׳¢", "׳׳•׳¨׳₪׳™׳¢", "׳£׳¡׳›", "׳‘׳”׳–", "׳§׳¡׳™׳“",
- // 6
- "׳”׳ ׳ ׳‘", "׳¡׳’׳", "׳¡׳ ׳ ׳", "׳–׳•׳₪׳×", "׳×׳•׳™׳ ׳–׳•׳",
- "׳׳•׳₪׳•׳¨׳§׳™׳","׳£׳™׳–׳©", "׳˜׳׳©", "׳×׳•׳™׳¨׳˜׳‘", "׳׳•׳¢׳©",
- "׳׳׳–", "׳•׳˜׳•׳", "׳¨׳׳•׳•׳¦", "׳©׳׳¨", "׳“׳™",
- // 9
- "׳׳’׳¨", "׳׳™׳™׳ ׳™׳¢", "׳×׳•׳¢׳‘׳¦׳", "׳¢׳‘׳•׳›", "׳”׳¦׳׳•׳—",
- "׳׳™׳™׳¡׳ ׳›׳", "׳¨׳₪׳¡", "׳”׳—׳™׳©", "׳׳™׳™׳׳¢׳ ", "׳׳™׳ ׳•׳ ׳—",
- "׳׳•׳×׳›", "׳׳•׳’׳¡", "׳׳•׳“׳", "׳“׳•׳¨׳•", "׳׳•׳—׳›",
- // 12
- "׳×׳׳›׳×", "׳§׳•׳¨׳™", "׳‘׳•׳”׳¦", "׳''׳ ׳×", "׳׳§׳–",
- "׳¨׳§׳•׳₪", "׳£׳“", "׳׳™׳˜׳¨׳™׳₪", "׳”׳‘׳”׳", "׳—׳׳©",
- "׳”׳׳™׳", "׳׳•׳™", "׳×׳›׳ ׳‘׳›׳•׳›","׳—׳׳¦", "׳¨׳₪׳¡׳",
- // 15
- "׳¥׳¢", "׳“׳—׳", "׳׳™׳™׳×׳©", "׳©׳•׳׳©", "׳¢׳‘׳¨׳",
- "׳©׳©", "׳¢׳‘׳©", "׳”׳ ׳•׳׳©", "׳¢׳©׳×", "׳¨׳©׳¢",
- "׳”׳¨׳©׳¢ ׳“׳—׳", "׳”׳¨׳©׳¢ ׳׳™׳™׳×׳©", "׳×׳—׳׳§׳", "׳׳™׳", "׳׳•׳’׳™׳¢",
- // 18
- "׳¢׳•׳‘׳™׳¨", "׳—׳‘׳˜׳", "׳¨׳“׳—", "׳”׳₪׳¦׳¨", "׳׳•׳§",
- "׳׳™׳׳•׳§׳׳¨", "׳‘׳©׳—׳", "׳¢׳§׳©", "׳×׳™׳›׳•׳›׳–", "׳×׳©׳¨",
- "׳¨׳•׳“׳›"
- // 21
- }
- 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"
- };
- /* Booleans */
- new bool:fwFirstwrites;
- new bool:fwMath;
- new bool:fwTranslate;
- new bool:Move;
- /* Strings */
- new fwNums[ 3 ];
- new fw_hebChars[ 64 ];
- new fw_engChars[ 64 ];
- new fw_Chars[ 6 ];
- new fwWords[ 128 ];
- new fwAnswer[ 128 ];
- new fwSign[ 26 ];
- /* Variables */
- new fwCount;
- public plugin_init()
- {
- register_clcmd( "say", "client_say" );
- register_clcmd( "say_team", "client_say" );
- register_clcmd( "say", "cmdSay" );
- register_forward( FM_SetModel, "fwSetModel" );
- register_forward( FM_ClientKill, "BlockKill" );
- register_forward( FM_GetGameDescription,"GameDesc" );
- RegisterHam( Ham_TakeDamage, "player", "HamTakeDamage" );
- RegisterHam( Ham_Spawn, "player", "HamSpawn", 1 );
- }
- /*
- public plugin_precache( )
- {
- precache_model( "models/player/GalacticGuard1/GalacticGuard1.mdl" );
- precache_model( "models/player/GalacticPrisoner1/GalacticPrisoner1.mdl" );
- }
- */
- public plugin_cfg( )
- {
- register_message( get_user_msgid( "StatusIcon" ), "Message_StatusIcon" );
- g_MaxClients = global_get( glb_maxClients );
- }
- /* --------------------------------------------------------------
- Client Commands
- -------------------------------------------------------------- */
- public client_say( id )
- {
- new szMsg[ 192 ];
- read_argv( 1, szMsg, sizeof (szMsg) - 1 );
- if ( equali( szMsg, "/c4" ) )
- {
- if ( cs_get_user_team( id ) != CS_TEAM_CT )
- {
- ColorChat( id, "^4ERROR:^3 Prisoners^1 canno't get a bomb." );
- return PLUGIN_HANDLED;
- }
- if ( !is_user_alive( id ) )
- {
- ColorChat( id, "^4ERROR:^3 Dead Players^1 canno't get a bomb." );
- return PLUGIN_HANDLED;
- }
- if ( user_has_weapon( id, CSW_C4 ) )
- {
- ColorChat( id, "^4ERROR:^1 You already own a bomb." );
- return PLUGIN_HANDLED;
- }
- fm_give_item( id, "weapon_c4" );
- ColorChat( id, "You received a^4 Bomb^1." );
- }
- if ( equali( szMsg, "/hardopen" ) || equali( szMsg, "/ho" ) )
- fwHardOpen( id );
- if ( equali( szMsg, "/glow" ) )
- cmdGlow( id );
- if ( equali( szMsg, "/get" ) )
- ShowGetMenu( id );
- if ( equali( szMsg, "/cd" ) )
- cmdCountdown( id );
- if ( equali ( szMsg, "/box" ) )
- cmdBox( id );
- if ( equali( szMsg, "/buyadmin" ) || equali( szMsg, "/buy" ) )
- CmdSalesMenu( id );
- if ( equali( szMsg, "/open" ) )
- fwOpenCages( id );
- return PLUGIN_CONTINUE;
- }
- /* --------------------------------------------------------------
- Game Name Changer
- -------------------------------------------------------------- */
- public GameDesc( )
- {
- forward_return( FMV_STRING, gGameName );
- return FMRES_SUPERCEDE;
- }
- /* --------------------------------------------------------------
- Weapon Rendering
- -------------------------------------------------------------- */
- public fwSetModel( ent )
- {
- if ( !pev_valid( ent ) )
- return FMRES_IGNORED;
- static id;
- id = pev( ent, pev_owner );
- if( !( 1 <= id <= g_MaxClients ) )
- return FMRES_IGNORED;
- switch( get_user_team( id ) )
- {
- case 1: fm_set_rendering( ent, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 1 );
- case 2: fm_set_rendering( ent, kRenderFxGlowShell, 0, 0, 255, kRenderNormal, 1 );
- }
- return FMRES_IGNORED;
- }
- /* --------------------------------------------------------------
- Block Kill
- -------------------------------------------------------------- */
- public BlockKill( id )
- return FMRES_SUPERCEDE;
- /* --------------------------------------------------------------
- Block Buy
- -------------------------------------------------------------- */
- public Message_StatusIcon( iMsgId, iMsgDest, id )
- {
- static szIcon[ 8 ];
- get_msg_arg_string( 2, szIcon, charsmax( szIcon ) );
- if( equal(szIcon, "buyzone") )
- {
- if( get_msg_arg_int( 1 ) )
- {
- set_pdata_int( id, 235, get_pdata_int(id, 235) & ~(1<<0) );
- return PLUGIN_HANDLED;
- }
- }
- return PLUGIN_CONTINUE;
- }
- /* --------------------------------------------------------------
- Open Celss
- -------------------------------------------------------------- */
- public fwOpenCages( id )
- {
- if ( cs_get_user_team( id ) != CS_TEAM_CT && !(get_user_flags( id ) & ADMIN_SLAY ) )
- {
- ColorChat( id, "^4ERROR:^3 Prisoners^1 canno't use open." );
- return PLUGIN_HANDLED;
- }
- if ( !is_user_alive( id ) && !(get_user_flags( id ) & ADMIN_SLAY ) )
- {
- ColorChat( id, "^4ERROR:^3 Dead Players^1 canno't use open." );
- return PLUGIN_HANDLED;
- }
- new szName[ 32 ];
- get_user_name( id, szName, sizeof (szName) - 1 );
- PushEntity( "func_button" );
- if ( get_user_flags( id ) & ADMIN_SLAY ) ColorChat( 0, "^3ADMIN:^4 %s^1 has opened the cells!", szName );
- else ColorChat( 0, "^4%s^1 has opened the cells!", szName );
- return PLUGIN_HANDLED;
- }
- /* --------------------------------------------------------------
- Buy Admin
- -------------------------------------------------------------- */
- public CmdSalesMenu( const client )
- {
- new mItem[ 128 ];
- formatex( mItem, charsmax( mItem ), "\w[ \dGalactic \w] \rAdmin Sales \wMenu" );
- new menu = menu_create( mItem, "mSales" );
- formatex( mItem, charsmax( mItem ), "\rAccess: \w%s \d(Select \w[\d1\w]\d)^n",
- g_szAccessList[ AccessId[ client ] ][ m_szAccessName ] );
- menu_additem( menu, mItem );
- formatex( mItem, charsmax( mItem ), "\rPrice: \y%i Shekels^n\d* The admins are for month!^n*\dSkype: \yBrian16xD | \dSkype: \yaku4360 | \dSkype: \yhen149159",
- g_szAccessList[ AccessId[ client ] ][ m_iAccessPrice ] );
- menu_addtext( menu, mItem );
- menu_setprop( menu, MPROP_EXITNAME, "\wClose Menu" );
- menu_display( client, menu );
- return 1;
- }
- public mSales( client, menu, item )
- {
- if( item == MENU_EXIT )
- {
- AccessId[ client ] = Vip;
- menu_destroy( menu );
- }
- if( item == Vip )
- {
- AccessId[ client ]++;
- if( AccessId[ client ] > Manager )
- AccessId[ client ] = Vip;
- CmdSalesMenu( client );
- }
- }
- /* --------------------------------------------------------------
- Spawn Weapons
- -------------------------------------------------------------- */
- public HamSpawn( id )
- {
- if ( !is_user_alive( id ) ) return PLUGIN_HANDLED;
- Glow[ id ] = false;
- switch( cs_get_user_team( id ) )
- {
- case CS_TEAM_T:
- {
- /*
- cs_reset_user_model( id );
- cs_set_user_model( id, "GalacticPrisoner1" );
- */
- fm_strip_user_weapons( id );
- fm_give_item( id, "weapon_knife" );
- }
- case CS_TEAM_CT:
- {
- /*
- cs_reset_user_model( id );
- cs_set_user_model( id, "GalacticGuard1" );
- */
- fm_strip_user_weapons( id );
- fm_give_item( id, "weapon_m4a1" );
- fm_give_item( id, "weapon_deagle" );
- fm_give_item( id, "weapon_smokegrenade" );
- fm_give_item( id, "weapon_knife" );
- cs_set_user_bpammo( id, CSW_M4A1, 120 );
- cs_set_user_bpammo( id, CSW_DEAGLE, 70 );
- cs_set_user_bpammo( id, CSW_SMOKEGRENADE, 4 );
- }
- }
- return PLUGIN_HANDLED;
- }
- public client_putinserver( client ) Glow[ client ] = false;
- /* --------------------------------------------------------------
- Box Menu
- -------------------------------------------------------------- */
- public cmdBox( id )
- {
- if ( cs_get_user_team( id ) != CS_TEAM_CT && !(get_user_flags( id ) & ADMIN_SLAY ) )
- {
- ColorChat( id, "^4ERROR:^3 Prisoners^1 canno't use the box menu." );
- return PLUGIN_HANDLED;
- }
- if ( !is_user_alive( id ) && !(get_user_flags( id ) & ADMIN_SLAY ) )
- {
- ColorChat( id, "^4ERROR:^3 Dead Players^1 canno't use the box menu." );
- return PLUGIN_HANDLED;
- }
- new szItem[ 128 ];
- formatex( gTitle, 127, "\y[\d %s \y]\w Box Menu", gPrefix );
- new gMenu = menu_create( gTitle, "subBox" );
- formatex( szItem, 63, "%sable\w Terrorists Box", BlockDamage ? "\rDis" : "\yEn" )
- menu_additem( gMenu, szItem, "0" );
- menu_additem( gMenu, "Reset Prisoners Health (\r100\w)", "1" );
- menu_display( id, gMenu );
- return PLUGIN_HANDLED;
- }
- public subBox( id, gMenu, gItem )
- {
- if ( cs_get_user_team( id ) != CS_TEAM_CT && !(get_user_flags( id ) & ADMIN_SLAY ) )
- {
- ColorChat( id, "^4ERROR:^3 Prisoners^1 canno't use the box menu." );
- return PLUGIN_HANDLED;
- }
- if ( !is_user_alive( id ) && !(get_user_flags( id ) & ADMIN_SLAY ) )
- {
- ColorChat( id, "^4ERROR:^3 Dead Players^1 canno't use the box menu." );
- return PLUGIN_HANDLED;
- }
- if ( gItem == MENU_EXIT )
- {
- menu_destroy( gMenu );
- return PLUGIN_HANDLED;
- }
- new iName[ 64 ], gData[ 6 ];
- new gAccess, gCallback;
- menu_item_getinfo( gMenu, gItem, gAccess, gData, 5, iName, 63, gCallback )
- new gKey = str_to_num( gData )
- new szName[ 32 ]; get_user_name( id, szName, 31 );
- switch ( gKey )
- {
- case 0:
- {
- BlockDamage = !BlockDamage;
- set_cvar_num( "mp_friendlyfire", BlockDamage ? 1 : 0 );
- set_hudmessage( BlockDamage ? 0 : 160, BlockDamage ? 160 : 0, 0, 0.1, 0.55, 1, 6.0, 6.0 );
- show_hudmessage( 0, "Terrorists Box is %sabled^nBy %s", BlockDamage ? "En" : "Dis", szName );
- cmdBox( id );
- }
- case 1:
- {
- if( BlockDamage )
- {
- for( new i = 1; i <= get_maxplayers( ); i += 1 )
- {
- if( !is_user_alive( i ) )
- {
- continue;
- }
- if ( cs_get_user_team( i ) == CS_TEAM_T )
- {
- fm_set_user_health( i, 100 );
- }
- }
- }
- ColorChat( id, "^4%s^1 Set^3 Prisoners^1 health to^4 100 hp", szName );
- cmdBox( id );
- }
- }
- menu_destroy( gMenu );
- return PLUGIN_HANDLED;
- }
- public HamTakeDamage( victim, inflictor, attacker, Float:damage, damagebits )
- {
- if ( !is_user_connected( attacker ) || !is_user_alive( attacker ) )
- return HAM_IGNORED;
- static CsTeams:Team[ 2 ];
- Team[ 0 ] = cs_get_user_team( attacker );
- Team[ 1 ] = cs_get_user_team( victim );
- return ( Team[ 0 ] == CS_TEAM_CT && Team[ 1 ] == Team[ 0 ] && BlockDamage ) ? HAM_SUPERCEDE : HAM_IGNORED;
- }
- /* --------------------------------------------------------------
- Countdown Menu
- -------------------------------------------------------------- */
- public cmdCountdown( id )
- {
- if ( is_user_alive( id ) && cs_get_user_team( id ) == CS_TEAM_CT || get_user_flags( id ) & ADMIN_SLAY )
- {
- formatex( gTitle, 127, "\y[\d %s \y]\w Countdown Menu", gPrefix );
- new gMenu = menu_create( gTitle, "subCountdown" );
- menu_additem( gMenu, "Start a Coundtown (\r5 Seconds\w)^n", "0" );
- new szItem[ 128 ];
- formatex( szItem, 63, "Guards Freeze (\r%s\w)", CTFreeze ? "On" : "Off" );
- menu_additem( gMenu, szItem, "1", ADMIN_SLAY );
- formatex( szItem, 63, "Prisoners Freeze (\r%s\w)", TFreeze ? "On" : "Off" );
- menu_additem( gMenu, szItem, "2", ADMIN_SLAY );
- menu_display( id, gMenu );
- return PLUGIN_HANDLED;
- }
- if ( cs_get_user_team( id ) != CS_TEAM_CT && !(get_user_flags( id ) & ADMIN_SLAY ) )
- {
- ColorChat( id, "^4ERROR:^3 Prisoners^1 canno't use the cd menu." );
- return PLUGIN_HANDLED;
- }
- if ( !is_user_alive( id ) && !(get_user_flags( id ) & ADMIN_SLAY ) )
- {
- ColorChat( id, "^4ERROR:^3 Dead Players^1 canno't use the cd menu." );
- return PLUGIN_HANDLED;
- }
- return PLUGIN_HANDLED;
- }
- public subCountdown( id, gMenu, gItem )
- {
- if ( is_user_alive( id ) && cs_get_user_team( id ) == CS_TEAM_CT || get_user_flags( id ) & ADMIN_SLAY )
- {
- if ( gItem == MENU_EXIT )
- {
- menu_destroy( gMenu );
- return PLUGIN_HANDLED;
- }
- new iName[ 64 ], gData[ 6 ];
- new gAccess, gCallback;
- menu_item_getinfo( gMenu, gItem, gAccess, gData, 5, iName, 63, gCallback );
- new gKey = str_to_num( gData );
- new szName[ 32 ];
- get_user_name( id, szName, 31 );
- switch ( gKey )
- {
- case 0:
- {
- if ( gCountdown )
- {
- ColorChat( id, "^4ERROR:^3 Countdown^1 is already running." );
- return PLUGIN_HANDLED;
- }
- gCount = 5;
- gCountdown = true;
- ActionCountdown( );
- ColorChat( 0, "^4%s^1 started a^3 Countdown^1." );
- for( new i=1; i<= get_maxplayers(); i++ )
- {
- if ( CTFreeze )
- {
- if ( cs_get_user_team( i ) == CS_TEAM_CT )
- set_pev(i, pev_flags, pev(i, pev_flags) | FL_FROZEN );
- }
- if ( TFreeze )
- {
- if ( cs_get_user_team( i ) == CS_TEAM_T )
- set_pev(i, pev_flags, pev(i, pev_flags) | FL_FROZEN );
- }
- }
- }
- case 1:
- {
- if ( gCountdown )
- {
- ColorChat( id, "^4ERROR:^3 Countdown^1 is already running." );
- return PLUGIN_HANDLED;
- }
- CTFreeze = !CTFreeze;
- cmdCountdown( id );
- }
- case 2:
- {
- if ( gCountdown )
- {
- ColorChat( id, "^4ERROR:^3 Countdown^1 is already running." );
- return PLUGIN_HANDLED;
- }
- TFreeze = !TFreeze;
- cmdCountdown( id );
- }
- }
- }
- return menu_destroy( gMenu );
- }
- public ActionCountdown( )
- {
- if ( !gCountdown )
- return PLUGIN_HANDLED;
- if ( gCountdown )
- {
- new Vox[ 32 ]; num_to_word( gCount, Vox, charsmax( Vox ) );
- client_cmd( 0, "spk ^"vox/%s second%s^"", Vox, (gCount>1)?"s":"" );
- set_hudmessage( 255, 0, 0, -1.0, 0.35 );
- show_hudmessage(0, "%d Seconds Left", gCount );
- set_task( 1.0, "ActionCountdown", 103 );
- if ( gCount <= 0 )
- {
- for( new i = 1; i <= get_maxplayers( ); i++ )
- {
- set_pev( i, pev_flags, pev(i, pev_flags) & ~FL_FROZEN );
- }
- set_hudmessage( 0, 255, 0, -1.0, 0.35 )
- show_hudmessage( 0, "Countdown is Over^nGo Go Go..." );
- TFreeze = false;
- CTFreeze = false;
- gCountdown = false;
- gCount = 5;
- remove_task( 103 );
- return PLUGIN_HANDLED;
- }
- gCount -= 1;
- for( new i=1; i<= get_maxplayers(); i++ )
- {
- if ( CTFreeze )
- {
- if ( cs_get_user_team( i ) == CS_TEAM_CT )
- set_pev(i, pev_flags, pev(i, pev_flags) | FL_FROZEN );
- }
- if ( TFreeze )
- {
- if ( cs_get_user_team( i ) == CS_TEAM_T )
- set_pev( i, pev_flags, pev(i, pev_flags) | FL_FROZEN );
- }
- }
- return PLUGIN_HANDLED;
- }
- return PLUGIN_HANDLED;
- }
- /* --------------------------------------------------------------
- Glow Menu
- -------------------------------------------------------------- */
- public fwHardOpen( id )
- {
- if ( !(get_user_flags( id ) & ADMIN_BAN) )
- return PLUGIN_HANDLED;
- new szName[ 32 ];
- get_user_name( id, szName, sizeof (szName) - 1 );
- ColorChat( 0, "^4%s^1 has opened the cells ^3(^4 Hard Open ^3)^1.", szName );
- new ent = -1
- while( (ent = engfunc( EngFunc_FindEntityByString, ent, "classname", "func_door" ) ) )
- dllfunc( DLLFunc_Use, ent, 0 );
- while( ( ent = engfunc( EngFunc_FindEntityByString, ent, "classname", "func_door_rotating" ) ) )
- dllfunc( DLLFunc_Use, ent, 0 );
- return PLUGIN_HANDLED;
- }
- /* --------------------------------------------------------------
- Glow Menu
- -------------------------------------------------------------- */
- public cmdGlow( id )
- {
- if ( is_user_alive( id ) && cs_get_user_team( id ) == CS_TEAM_CT || get_user_flags( id ) & ADMIN_SLAY )
- {
- new players[ 32 ], pnum;
- new szName[ 32 ], szItem[ 64 ], szTempId[ 3 ];
- formatex( gTitle, charsmax( gTitle ), "[\d %s \y]\w Glow Menu", gPrefix );
- new gMenu = menu_create( gTitle, "subGlow" );
- get_players( players, pnum, "ae", "TERRORIST" );
- for( new i=0; i<pnum; i+=1 )
- {
- new tempid = players[ i ];
- num_to_str( tempid, szTempId, charsmax( szTempId ) );
- get_user_name( tempid, szName, charsmax( szName ) );
- formatex( szItem, charsmax( szItem ), "\w%s %s", szName, Glow[ tempid ] ? "\r[\w Glow \r]" : "" );
- if ( !is_user_alive( tempid ) )
- return PLUGIN_HANDLED;
- menu_additem( gMenu, szItem, szTempId );
- }
- menu_setprop( gMenu, MPROP_PERPAGE, 6 );
- menu_setprop( gMenu, MPROP_NUMBER_COLOR, "\y" );
- menu_display( id, gMenu );
- return PLUGIN_HANDLED;
- }
- if ( cs_get_user_team( id ) != CS_TEAM_CT && !(get_user_flags( id ) & ADMIN_SLAY ) )
- {
- ColorChat( id, "^4ERROR:^3 Prisoners^1 canno't use the glow menu." );
- return PLUGIN_HANDLED;
- }
- if ( !is_user_alive( id ) && !(get_user_flags( id ) & ADMIN_SLAY ) )
- {
- ColorChat( id, "^4ERROR:^3 Dead Players^1 canno't use the glow menu." );
- return PLUGIN_HANDLED;
- }
- return PLUGIN_HANDLED;
- }
- public subGlow( id, gMenu, gItem )
- {
- new mData[ 6 ], _Trash;
- menu_item_getinfo( gMenu, gItem, _Trash, mData, charsmax( mData ), "", 0, _Trash );
- if( gItem != MENU_EXIT )
- {
- new tempid = str_to_num( mData );
- if ( is_user_alive( id ) && cs_get_user_team( id ) == CS_TEAM_CT || get_user_flags( id ) & ADMIN_SLAY )
- {
- new szName[ 32 ], szTempid[ 32 ];
- get_user_name( id, szName, sizeof (szName) - 1 );
- get_user_name( tempid, szTempid, sizeof (szTempid) - 1 );
- fm_set_user_rendering( tempid, kRenderFxGlowShell, !Glow[ tempid ] ? 255 : 0, !Glow[ tempid ] ? 127 : 0, 0, kRenderNormal, !Glow[ tempid ] ? 75 : 0 );
- ColorChat( 0, "^4%s^3 %s^4 Glow^1 %s^4 %s^1 and is now^4 %s^1!",
- szName, !Glow[tempid]?"Gave":"Took Away", !Glow[tempid]?"to":"from", szTempid, !Glow[tempid]?"Glowing":"Not Glowing" );
- Glow[ tempid ] = !Glow[ tempid ];
- return PLUGIN_HANDLED;
- }
- if ( cs_get_user_team( tempid ) != CS_TEAM_T )
- {
- ColorChat( id, "^4ERROR:^3 Player^1 is not a^4 Prisoner^1." );
- return PLUGIN_HANDLED;
- }
- if ( !is_user_alive( tempid ) )
- {
- ColorChat( id, "^4ERROR:^3 Player^1 is not ^4Alive^1." );
- return PLUGIN_HANDLED;
- }
- if ( cs_get_user_team( id ) != CS_TEAM_CT && !(get_user_flags( id ) & ADMIN_SLAY ) )
- {
- ColorChat( id, "^4ERROR:^3 Prisoners^1 canno't use the glow menu." );
- return PLUGIN_HANDLED;
- }
- if ( !is_user_alive( id ) || !(get_user_flags( id ) & ADMIN_SLAY ) )
- {
- ColorChat( id, "^4ERROR:^3 Dead Players^1 canno't use the glow menu." );
- return PLUGIN_HANDLED;
- }
- }
- menu_destroy( gMenu );
- return PLUGIN_HANDLED;
- }
- /* --------------------------------------------------------------
- First Actions
- -------------------------------------------------------------- */
- public cmdSay( id )
- {
- new szMsg[ 192 ], szName[ 32 ];
- read_argv( 1, szMsg, charsmax( szMsg ) );
- get_user_name( id, szName, sizeof (szName) - 1 );
- if ( equal( szMsg, "/ts" ) || equal( szMsg, "/translate" ) )
- {
- if ( cs_get_user_team( id ) != CS_TEAM_CT )
- {
- ColorChat( id, "^4ERROR:^3 Prisoners^1 canno't start^4 Translate^1." );
- return PLUGIN_HANDLED;
- }
- if ( !is_user_alive( id ) )
- {
- ColorChat( id, "^4ERROR:^3 Dead Players^1 canno't start^4 Translate^1." );
- return PLUGIN_HANDLED;
- }
- if ( fwTranslate )
- {
- ColorChat( id, "^4ERROR:^3 Translate Event^1 is already running^1." );
- return PLUGIN_HANDLED;
- }
- if ( fwFirstwrites )
- {
- ColorChat( id, "^4ERROR:^3 Firstwrites Event^1 is running^1." );
- return PLUGIN_HANDLED;
- }
- if ( fwMath )
- {
- ColorChat( id, "^4ERROR:^3 Math Event^1 is running^1." );
- return PLUGIN_HANDLED;
- }
- ColorChat( 0, "^4%s^1 just started a^3 Translate Event^1!", szName );
- fwWords = "!׳”׳׳‘׳” ׳”׳׳™׳׳” ׳×׳ ׳׳’׳¨׳×";
- fwTranslate = true;
- fwCount = 5;
- set_task( 1.0, "Countdown", 999, _,_, "b" );
- }
- if ( equal( szMsg, "/sts" ) || equal( szMsg, "/stopts" ) )
- {
- if ( cs_get_user_team( id ) != CS_TEAM_CT )
- {
- ColorChat( id, "^4ERROR:^3 Prisoners^1 canno't stop^4 Translate^1." );
- return PLUGIN_HANDLED;
- }
- if ( !is_user_alive( id ) )
- {
- ColorChat( id, "^4ERROR:^3 Dead Players^1 canno't stop^4 Translate^1." );
- return PLUGIN_HANDLED;
- }
- if ( fwFirstwrites )
- {
- ColorChat( id, "^4ERROR:^3 Firstwrites Event^1 is running^1." );
- return PLUGIN_HANDLED;
- }
- if ( !fwTranslate )
- {
- ColorChat( id, "^4ERROR:^3 Translate Event^1 is not running^1." );
- return PLUGIN_HANDLED;
- }
- if ( fwMath )
- {
- ColorChat( id, "^4ERROR:^3 Math Event^1 is running^1." );
- return PLUGIN_HANDLED;
- }
- ColorChat( 0, "^4%s^1 just stopped a^3 Translate Event^1!", szName );
- Move = false;
- fwTranslate = false;
- remove_task( 999 );
- }
- if ( equal( szMsg, "/fw" ) || equal( szMsg, "/fwstart" ) )
- {
- if ( !(get_user_flags( id ) & ADMIN_KICK ) )
- {
- ColorChat( id, "^4ERROR:^3 Only Admin^1 can start^4 First Writes^1." );
- return PLUGIN_HANDLED;
- }
- if ( fwFirstwrites )
- {
- ColorChat( id, "^4ERROR:^3 Firstwrites Event^1 is already running^1." );
- return PLUGIN_HANDLED;
- }
- if ( fwMath )
- {
- ColorChat( id, "^4ERROR:^3 Math Event^1 is running^1." );
- return PLUGIN_HANDLED;
- }
- if ( fwTranslate )
- {
- ColorChat( id, "^4ERROR:^3 Translate Event^1 is running^1." );
- return PLUGIN_HANDLED;
- }
- ColorChat( 0, "^4%s^1 just started a^3 Fristwrites Event^1!", szName );
- fwWords = "The first one to write will move to the Guards team!^n";
- fwFirstwrites = true;
- fwCount = 5;
- set_task( 1.0, "Countdown", 999, _,_, "b" );
- }
- if ( equal( szMsg, "/sfw" ) || equal( szMsg, "/stopfw" ) || equal( szMsg, "/stopfirst" ) )
- {
- if ( !(get_user_flags( id ) & ADMIN_KICK ) )
- {
- ColorChat( id, "^4ERROR:^3 Only Admin^1 can stop^4 First Writes^1." );
- return PLUGIN_HANDLED;
- }
- if ( !fwFirstwrites )
- {
- ColorChat( id, "^4ERROR:^3 Firstwrites Event^1 is not running^1." );
- return PLUGIN_HANDLED;
- }
- if ( fwMath )
- {
- ColorChat( id, "^4ERROR:^3 Math Event^1 is running^1." );
- return PLUGIN_HANDLED;
- }
- if ( fwTranslate )
- {
- ColorChat( id, "^4ERROR:^3 Translate Event^1 is running^1." );
- return PLUGIN_HANDLED;
- }
- ColorChat( 0, "^4%s^1 just stopped a^3 Translate Event^1!", szName );
- Move = false;
- fwFirstwrites = false;
- remove_task( 999 );
- }
- if ( fwTranslate )
- {
- if ( equal( szMsg, fw_engChars ) )
- {
- if ( !Move ) return PLUGIN_HANDLED;
- if ( cs_get_user_team( id ) == CS_TEAM_CT ) return PLUGIN_HANDLED;
- if ( !is_user_alive( id ) ) return PLUGIN_HANDLED;
- ColorChat( 0, "^4%s^1 won the^3 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 Translate Event, The answer was %s", szName, fw_engChars );
- fwTranslate = false;
- remove_task( 999 );
- Move = false;
- }
- }
- if ( fwFirstwrites )
- {
- if ( equal( szMsg, fw_Chars ) )
- {
- if ( !Move ) return PLUGIN_HANDLED;
- if ( cs_get_user_team( id ) == CS_TEAM_CT ) return PLUGIN_HANDLED;
- set_hudmessage( 0, 160, 0, -1.0, 0.31, 1, 1.0, 8.0 );
- show_hudmessage( 0, "%s won the Firstwrites Event! and was moved to the Guards Team!", szName );
- ColorChat( 0, "^4%s^1 won the^3 Firstwrites Event^1! and was moved to the^3 Guards Team^1!", szName );
- fwFirstwrites = false;
- remove_task( 999 );
- Move = false;
- cs_set_user_team( id, CS_TEAM_CT );
- dllfunc( DLLFunc_Spawn, id );
- }
- }
- if ( equal( szMsg, "/math" ) )
- {
- if ( cs_get_user_team( id ) != CS_TEAM_CT )
- {
- ColorChat( id, "^4ERROR:^3 Prisoners^1 canno't start^4 Math^1." );
- return PLUGIN_HANDLED;
- }
- if ( !is_user_alive( id ) )
- {
- ColorChat( id, "^4ERROR:^3 Dead Players^1 canno't start^4 Math^1." );
- return PLUGIN_HANDLED;
- }
- if ( fwTranslate )
- {
- ColorChat( id, "^4ERROR:^3 Translate Event^1 is already running^1." );
- return PLUGIN_HANDLED;
- }
- if ( fwFirstwrites )
- {
- ColorChat( id, "^4ERROR:^3 Firstwrites Event^1 is running^1." );
- return PLUGIN_HANDLED;
- }
- if ( fwMath )
- {
- ColorChat( id, "^4ERROR:^3 Math Event^1 is already running^1." );
- return PLUGIN_HANDLED;
- }
- ColorChat( 0, "^4%s^1 just started a^3 Math Event^1!", szName );
- fwMath = true;
- fwCount = 5;
- set_task( 1.0, "Countdown", 999, _,_, "b" );
- }
- if ( equal( szMsg, "/stopmath" ) )
- {
- if ( cs_get_user_team( id ) != CS_TEAM_CT )
- {
- ColorChat( id, "^4ERROR:^3 Prisoners^1 canno't stop^4 Math^1." );
- return PLUGIN_HANDLED;
- }
- if ( !is_user_alive( id ) )
- {
- ColorChat( id, "^4ERROR:^3 Dead Players^1 canno't stop^4 Math^1." );
- return PLUGIN_HANDLED;
- }
- if ( fwFirstwrites )
- {
- ColorChat( id, "^4ERROR:^3 Firstwrites Event^1 is running^1." );
- return PLUGIN_HANDLED;
- }
- if ( fwTranslate )
- {
- ColorChat( id, "^4ERROR:^3 Translate Event^1 is running^1." );
- return PLUGIN_HANDLED;
- }
- if ( !fwMath )
- {
- ColorChat( id, "^4ERROR:^3 Math Event^1 is not running^1." );
- return PLUGIN_HANDLED;
- }
- ColorChat( 0, "^4%s^1 just stopped a^3 Math Event^1!", szName );
- Move = false;
- fwMath = false;
- remove_task( 999 );
- }
- if ( fwMath )
- {
- if ( equal( szMsg, fwAnswer ) )
- {
- if ( !Move ) return PLUGIN_HANDLED;
- if ( cs_get_user_team( id ) == CS_TEAM_CT ) return PLUGIN_HANDLED;
- if ( !is_user_alive( id ) ) return PLUGIN_HANDLED;
- ColorChat( 0, "^4%s^1 won the^3 Math Event^1, The answer was^4 %s^1.", szName, fwAnswer );
- 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, fwAnswer );
- fwMath = false;
- remove_task( 999 );
- Move = false;
- }
- }
- return PLUGIN_CONTINUE;
- }
- public Countdown( )
- {
- if ( fwTranslate )
- {
- 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 );
- ColorChat( 0, "^"^4 %s ^1^"^3 %s", fw_hebChars, fwWords );
- remove_task( 999 );
- set_task( 20.0, "eventFailed", 999 );
- }
- }
- if ( fwFirstwrites )
- {
- 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 )
- ColorChat( 0, "^3%s^1 ^"^4%s^1^"", fwWords, fw_Chars )
- remove_task( 999 );
- set_task( 20.0, "eventFailed", 999 );
- }
- }
- if ( fwMath )
- {
- if( fwCount <= 0 )
- {
- Move = true;
- fwNums[ 0 ] = random( 500 );
- fwNums[ 1 ] = random( 450 );
- 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 ] );
- ColorChat( 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 eventFailed( )
- {
- if ( fwTranslate )
- {
- ColorChat( 0, "Nobody has answered^4 correctly^1 ^3(^1 Translate Failed ^3)^1. [^4Answer:^3 %s^1]", fw_engChars );
- fwTranslate = false;
- Move = false;
- return PLUGIN_HANDLED;
- }
- if ( fwFirstwrites )
- {
- ColorChat( 0, "Nobody has answered^4 correctly^1 ^3(^1 Firstwrites Failed ^3)^1. [^4Combination:^3 %s^1]", fw_Chars );
- fwFirstwrites = false;
- Move = false;
- return PLUGIN_HANDLED;
- }
- if ( fwMath )
- {
- ColorChat( 0, "Nobody has answered^4 correctly^1 ^3(^1 Math Failed ^3)^1. [^4Answer:^3 %s^1]", fwAnswer );
- fwMath = false;
- Move = false;
- return PLUGIN_HANDLED;
- }
- return PLUGIN_CONTINUE;
- }
- /* --------------------------------------------------------------
- Get Menu
- -------------------------------------------------------------- */
- public ShowGetMenu( client )
- {
- if ( fm_get_user_team( client ) != FM_TEAM_CT )
- ColorChat( client, "This command is for Gurad-Team Only" );
- else if ( !is_user_alive( client ) )
- ColorChat( client, "This command is for Alive CT Only" );
- else
- {
- new title[ 32 ];
- formatex( title, charsmax( title ), "\r[\w Galactic \r]\y Get Menu");
- new menu = menu_create( title, "HandleGetMenu" );
- new szName[ 32 ], players[ 32 ], szTemp[ 10 ], pnum, player;
- get_players( players, pnum, "ch" );
- for ( new i; i < pnum; i++ )
- {
- player = players[ i ];
- if ( !is_user_alive( player ) || !is_user_connected( player ) || fm_get_user_team( player ) != FM_TEAM_T )
- continue;
- get_user_name( player, szName, charsmax( szName ) );
- num_to_str( player, szTemp, charsmax( szTemp ) );
- menu_additem( menu, szName, szTemp );
- }
- menu_setprop( menu, MPROP_EXIT, MENU_EXIT );
- menu_display( client, menu );
- }
- }
- public HandleGetMenu( client, menu, item )
- {
- if ( item == MENU_EXIT )
- {
- menu_destroy( menu );
- return;
- }
- new data[ 6 ], szName[ 64 ], access, callback;
- menu_item_getinfo( menu, item, access, data, charsmax( data ), szName, charsmax( szName ), callback );
- new player = str_to_num( data );
- if ( !is_user_connected( player ) )
- return;
- if ( !is_user_alive( player ) )
- ColorChat( client, "This player has to be alive" );
- else if ( fm_get_user_team( player ) != FM_TEAM_T )
- ColorChat( client, "You can Switch team with a Terrorist Only" );
- else
- ShowGetAcceptMenu( player, client );
- }
- public ShowGetAcceptMenu( player, client )
- {
- new title[ 64 ], szName[ 32 ], szYes[ 32 ], szNo[ 32 ], szTemp[ 10 ];
- get_user_name( client, szName, charsmax( szName ) );
- formatex( title, charsmax( title ), "\r[\w Galactic-Jail \r]\y Would you like to Switch\w %s ?",szName );
- new menu = menu_create( title, "HandleGetAcceptMenu" );
- num_to_str( client, szTemp, charsmax( szTemp ) );
- formatex( szYes, charsmax( szYes ), "1 %s", szTemp );
- formatex( szNo, charsmax( szNo ), "2 %s", szTemp );
- menu_additem( menu, "Yes", szYes );
- menu_additem( menu, "No", szNo );
- menu_setprop( menu, MPROP_EXIT, MENU_EXIT );
- menu_display( player, menu );
- }
- public HandleGetAcceptMenu( player, menu, item )
- {
- new data[ 6 ], Name[ 64 ], szName[ 32 ], szName2[ 32 ], szKey[ 10 ], szClient[ 10 ], access, callback;
- menu_item_getinfo( menu, item, access, data, charsmax( data ), Name, charsmax( Name ), callback );
- parse( data, szKey, charsmax( szKey ), szClient, charsmax( szClient ) );
- new key = item == MENU_EXIT ? 2 : str_to_num( szKey );
- new client = str_to_num( szClient );
- get_user_name( client, szName2, charsmax( szName2 ) );
- get_user_name( player, szName, charsmax( szName ) );
- switch( key )
- {
- case 1:
- {
- if(cs_get_user_team(client) != CS_TEAM_T)
- {
- ColorChat( 0, "^3%s^1 and^3 %s^1 Switched Teams !", szName, szName2 );
- fm_set_user_team( client, FM_TEAM_T );
- fm_set_user_team( player, FM_TEAM_CT );
- dllfunc( DLLFunc_Spawn, client );
- dllfunc( DLLFunc_Spawn, player );
- }
- }
- case 2:
- {
- if(cs_get_user_team(client) != CS_TEAM_T)
- ColorChat( client, "^3%s^1 Denied your request to switch Teams.", szName );
- }
- }
- }
- /* --------------------------------------------------------------
- Stocks
- -------------------------------------------------------------- */
- stock fm_get_user_team( client ) {
- return get_pdata_int( client, 114 );
- }
- stock fm_set_user_team(client, team) {
- set_pdata_int( client, 114, team );
- static const TeamInfo[ Teams ][] =
- {
- "UNASSIGNED",
- "TERRORIST",
- "CT",
- "SPECTATOR"
- };
- message_begin( MSG_ALL, get_user_msgid( "TeamInfo" ) ) ;
- write_byte( client );
- write_string( TeamInfo[ team ] );
- message_end( );
- }
- 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 ) ] );
- }
- stock ColorChat( const id, const string[], any:... )
- {
- new msg[191], players[32], count = 1;
- static len; len = formatex(msg, charsmax(msg), "^1[^4 %s ^1] ", gPrefix );
- vformat(msg[len], charsmax(msg) - len, string, 3);
- if(id) players[0] = id;
- 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();
- }
- }
- }
- stock PushEntity( const szClassname[] )
- {
- static szClass[ 32 ], target[ 32 ], ent = -1, door;
- while( ( ent = fm_find_ent_by_class( ent, szClassname ) ) )
- {
- pev( ent, pev_target, target, charsmax( target ) );
- door = engfunc( EngFunc_FindEntityByString, 0, "targetname", target );
- if( !pev_valid( door ) )
- continue;
- pev( door, pev_classname, szClass, charsmax( szClass ) );
- if( !equali( szClass, "func_door" ) )
- continue;
- dllfunc( DLLFunc_Use, ent, 0 );
- }
- }
Add Comment
Please, Sign In to add comment