Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include < amxmodx >
- #include < amxmisc >
- #include < cstrike >
- #include < fun >
- #include < hamsandwich >
- new const PLUGIN [ ] = "[XMAS FURIOUS]";
- new const OWNER_CONTACT [ ] = "Steam:i'm back";
- new const OUR_FORUM [ ] = "www.furious.ro";
- new g_bPoints [ 33 ];
- new bool: ZU [33 ], bool: KISS [ 33 ], bool: DIZZ [ 33 ];
- native csdm_get_user_points ( id );
- native csdm_set_user_points ( id, iNum );
- new const g_access_file [ ] = "addons/amxmodx/configs/users.ini";
- new const g_password_field [ ] = "_pw";
- new const g_admin_flags [ ] = "abcdefghijk"; // flagurile pe care le cumpara
- public plugin_init ( )
- {
- register_plugin ( "XMAS Game Menu", "1.0", "LondoN #" );
- register_clcmd ( "chooseteam", "game_menu" );
- register_clcmd ( "say /stop", "cmd_stop" );
- set_task ( 42.5, "TaskAnnounce", _, _, _, "b" );
- }
- public game_menu ( id ) {
- new menu = menu_create ( "rXMAS.RANGFORT.RO yGame Menu", "menu_principal" );
- menu_additem ( menu, "r[1] wContact Owner", "1", 0 );
- menu_additem ( menu, "r[2] wRadio Menu", "2", 0 );
- menu_additem ( menu, "r[3] wPoints Shop", "3", 0 );
- menu_additem ( menu, "r[4] wJoin Spectators", "4", 0 );
- menu_additem ( menu, "r[5] wForum", "5", 0 );
- menu_setprop ( menu, MPROP_EXIT, MEXIT_ALL );
- menu_display ( id, menu, 0 );
- return PLUGIN_CONTINUE;
- }
- public menu_principal ( id, menu, item ) {
- if ( item == MENU_EXIT ) {
- menu_destroy ( menu );
- ColorChat ( id, "!x04%s !x03You closed the !x04Game Menu", PLUGIN );
- return PLUGIN_HANDLED;
- }
- new szData [ 7 ], szName [ 64 ];
- new Access, Callback;
- menu_item_getinfo ( menu, item, Access, szData, 5, szName, 63, Callback );
- new szKey = str_to_num ( szData );
- g_bPoints [ id ] = csdm_get_user_points ( id );
- switch ( szKey ) {
- case 1 : {
- ColorChat ( id, "!x03Contact Detinator: !x04%s", OWNER_CONTACT );
- return PLUGIN_CONTINUE;
- }
- case 2 : {
- new g_menu = menu_create ( "rRadio wMenu", "menu_radio" );
- menu_additem ( g_menu, "r[1] wRadio DIZZ", "1", 0 );
- menu_additem ( g_menu, "r[2] wRadio KISS", "2", 0 );
- menu_additem ( g_menu, "r[3] wRadio ZU", "3", 0 );
- menu_setprop ( g_menu, MPROP_EXIT, MEXIT_ALL );
- menu_display ( id, g_menu, 0 );
- return PLUGIN_CONTINUE;
- }
- case 3 : {
- new title [ 256 ];
- formatex ( title, charsmax ( title ), "r Points Shop ^nwPoints: r%d", g_bPoints );
- new l_menu = menu_create ( title, "menu_points" );
- menu_additem ( l_menu, "r[1] wBuy Respawn [r50 Pointsw]", "1", 0 );
- menu_additem ( l_menu, "r[2] wBuy Trider [r150 Pointsw]", "2", 0 );
- menu_additem ( l_menu, "r[3] wBuy Money [r250 Pointsw]", "3", 0 );
- menu_additem ( l_menu, "r[4] w75 Frags [r550 Pointsw]", "4", 0 );
- menu_additem ( l_menu, "r[5] wBuy SLOT [r1500 Pointsw]", "5", 0 );
- menu_additem ( l_menu, "r[6] wBuy ADMIN [r9500 Pointsw]", "6", 0 );
- menu_setprop ( l_menu, MPROP_EXIT, MEXIT_ALL );
- menu_display ( id, l_menu, 0 );
- return PLUGIN_CONTINUE;
- }
- case 4 : {
- if ( is_user_alive ( id ) ) {
- ColorChat ( id, "!x04%s !x03We can't put you to spectators because you're alive.", PLUGIN );
- return PLUGIN_HANDLED;
- }
- if ( is_user_admin ( id ) )
- {
- cs_set_user_team ( id, CS_TEAM_SPECTATOR );
- ColorChat ( id, "!x04%s !x03We moved you to the !x04Spectators", PLUGIN );
- }
- if ( !is_user_alive ( id ) )
- {
- cs_set_user_team ( id, CS_TEAM_SPECTATOR );
- ColorChat ( id, "!x04%s !x03We moved you to the !x04Spectators", PLUGIN );
- }
- }
- case 5 : {
- ColorChat ( 0, "!x03Forumul este: !x04%s", OUR_FORUM );
- }
- }
- return PLUGIN_CONTINUE;
- }
- public menu_radio ( id, g_menu, item ) {
- if ( item == MENU_EXIT ) {
- menu_destroy ( g_menu );
- ColorChat ( id, "!x04%s !x03You closed !x04Radio Menu", PLUGIN );
- return PLUGIN_HANDLED;
- }
- new szData [ 7 ], szName [ 64 ];
- new Access, Callback;
- menu_item_getinfo ( g_menu, item, Access, szData, 5, szName, 63, Callback );
- new szKey = str_to_num ( szData );
- switch ( szKey ) {
- case 1 : {
- show_motd ( id, "addons/amxmodx/configs/xmas/radio/dizz.html" );
- DIZZ [ id ] = true;
- }
- case 2 : {
- show_motd ( id, "addons/amxmodx/configs/xmas/radio/kiss.html" );
- KISS [ id ] = true;
- }
- case 3 : {
- show_motd ( id, "addons/amxmodx/configs/xmas/radio/zu.html" );
- ZU [ id ] = true;
- }
- }
- return PLUGIN_CONTINUE;
- }
- public menu_points ( id, l_menu, item ) {
- if ( item == MENU_EXIT ) {
- menu_destroy ( l_menu );
- ColorChat ( id, "!x04%s !x03You closed !x04Points Shop", PLUGIN );
- return PLUGIN_HANDLED;
- }
- g_bPoints [ id ] = csdm_get_user_points ( id );
- new szData [ 7 ], szName [ 64 ];
- new Access, Callback;
- menu_item_getinfo ( l_menu, item, Access, szData, 5, szName, 63, Callback );
- new szKey = str_to_num ( szData );
- switch ( szKey ) {
- case 1 : {
- if ( g_bPoints [ id ] < 50 )
- {
- ColorChat ( id, "!x04%s !x03You need !x0450 !x03points to buy !x04RESPAWN", PLUGIN );
- ColorChat ( id, "!x04%s !x03Avaible Points: !x04%d", PLUGIN, g_bPoints [ id ] );
- return PLUGIN_HANDLED;
- }
- if ( is_user_alive ( id ) ) {
- ColorChat ( id, "!x04%s !x03You are !x04alive", PLUGIN );
- return PLUGIN_HANDLED;
- }
- ExecuteHamB ( Ham_CS_RoundRespawn, id );
- csdm_set_user_points ( id, g_bPoints [ id ] - 50 );
- ColorChat ( id, "!x04%s !x03You bought !x04RESPAWN", PLUGIN );
- }
- case 2 : {
- if ( g_bPoints [ id ] < 150 )
- {
- ColorChat ( id, "!x04%s !x03You need !x04150 !x03points to buy !x04TRYDER", PLUGIN );
- ColorChat ( id, "!x04%s !x03Avaible Points: !x04%d", PLUGIN, g_bPoints [ id ] );
- return PLUGIN_HANDLED;
- }
- /* Strip Weapons */
- strip_user_weapons ( id );
- /* Giving Weapons */
- give_item ( id, "weapon_knife" );
- give_item ( id, "weapon_deagle" );
- give_item ( id, "weapon_ak47" );
- give_item ( id, "weapon_m4a1" );
- give_item ( id, "weapon_hegrenade" );
- give_item ( id, "weapon_flashbang" );
- give_item ( id, "weapon_flashbang" );
- give_item ( id, "weapon_smokegrenade" );
- /* Setting Player HP/AP */
- set_user_armor ( id, 100 );
- set_user_health ( id, 150 );
- /* Setting Weapon Ammo */
- cs_set_user_bpammo ( id, CSW_DEAGLE, 35 );
- cs_set_user_bpammo ( id, CSW_AK47, 90 );
- cs_set_user_bpammo ( id, CSW_M4A1, 90 );
- csdm_set_user_points ( id, g_bPoints [ id ] - 150 );
- ColorChat ( id, "!x04%s !x03You bought !x04TRYDER", PLUGIN );
- }
- case 3 : {
- if ( g_bPoints [ id ] < 250 )
- {
- ColorChat ( id, "!x04%s !x03You need !x04250 !x03points to buy !x04Money (16000)", PLUGIN );
- ColorChat ( id, "!x04%s !x03Avaible Points: !x04%d", PLUGIN, g_bPoints [ id ] );
- return PLUGIN_HANDLED;
- }
- if ( !is_user_alive ( id ) )
- {
- ColorChat ( id, "!x04%s !x03You're not !x04alive", PLUGIN );
- return PLUGIN_HANDLED;
- }
- if ( cs_get_user_money ( id ) == 16000 )
- {
- ColorChat ( id, "!x04%s !x03You already have !x0416000 $", PLUGIN );
- return PLUGIN_HANDLED;
- }
- cs_set_user_money ( id, 16000 );
- csdm_set_user_points ( id, g_bPoints [ id ] - 250 );
- ColorChat ( id, "!x04%s !x03You bought !x04Money", PLUGIN );
- }
- case 4 : {
- if ( g_bPoints [ id ] < 550 )
- {
- ColorChat ( id, "!x04%s !x03You need !x04550 !x03points to buy !x0475 Frags", PLUGIN );
- ColorChat ( id, "!x04%s !x03Avaible Points: !x04%d", PLUGIN, g_bPoints [ id ] );
- return PLUGIN_HANDLED;
- }
- set_user_frags ( id, get_user_frags ( id ) + 75 );
- csdm_set_user_points ( id, g_bPoints [ id ] - 550 );
- ColorChat ( id, "!x04%s !x03You bought !x0475 Frags", PLUGIN );
- }
- case 5 : {
- if ( g_bPoints [ id ] < 1500 )
- {
- ColorChat ( id, "!x04%s !x03You need !x041500 !x03points to buy !x04SLOT", PLUGIN );
- ColorChat ( id, "!x04%s !x03Avaible Points: !x04%d", PLUGIN, g_bPoints [ id ] );
- return PLUGIN_HANDLED;
- }
- if ( get_user_flags ( id ) & read_flags ( "b" ) )
- {
- ColorChat ( id, "!x04%s !x03You already have !x04SLOT", PLUGIN );
- return PLUGIN_HANDLED;
- }
- new szPassword [ 3 ], szBuffer [ 512 ], szName [ 32 ];
- formatex ( szPassword, charsmax ( szPassword ), "%c%c%c", random_num ( 'A', 'Z' ), random_num ( 'a', 'z' ), random_num ( '1', '9' ) );
- get_user_name ( id, szName, charsmax ( szName ) );
- formatex ( szBuffer, charsmax ( szBuffer ), " ^"%s^" ^"%s^" ^"b^" ^"a^" // Slot Cumparat cu points", szName, szPassword );
- ColorChat ( 0, "!x04%s !x03Player !x04%s !x03bought !x04SLOT!", PLUGIN, szName );
- ColorChat ( id, "!x04%s !x03YOUR PASSWORD: !x04%s", PLUGIN, szPassword );
- ColorChat ( id, "!x04%s !x03USE: !x04setinfo %s %s", PLUGIN, g_password_field, szPassword );
- set_hudmessage(0, 127, 255, 0.32, 0.15, 0, 6.0, 5.0 );
- show_hudmessage(id, "You bought SLOT!^nYour Password: %s", szPassword );
- write_file ( g_access_file, szBuffer );
- console_print ( id, "[XMAS Outstanding] SLOT PASSWORD: %s", szPassword );
- console_print ( id, "[XMAS Outstanding] SLOT PASSWORD: %s", szPassword );
- console_print ( id, "[XMAS Outstanding] SLOT PASSWORD: %s", szPassword );
- csdm_set_user_points ( id, g_bPoints [ id ] - 1500 );
- }
- case 6 : {
- if ( g_bPoints [ id ] < 9500 )
- {
- ColorChat ( id, "!x04%s !x03You need !x049500 !x03points to buy !x04ADMIN", PLUGIN );
- ColorChat ( id, "!x04%s !x03Avaible Points: !x04%d", PLUGIN, g_bPoints [ id ] );
- return PLUGIN_HANDLED;
- }
- if ( is_user_admin ( id ) )
- {
- ColorChat ( id, "!x04%s !x03You already have !x04ADMIN", PLUGIN );
- return PLUGIN_HANDLED;
- }
- new szPassword [ 5 ], szBuffer [ 512 ], szName [ 32 ];
- get_user_name ( id, szName, charsmax ( szName ) );
- formatex ( szPassword, charsmax ( szPassword ), "%c%c%c%c%c", random_num ( 'A', 'Z' ), random_num ( '1', '9' ), random_num ( 'a', 'z' ), random_num ( 'l', 'q' ), random_num ( '3', '6' ) );
- formatex ( szBuffer, charsmax ( szBuffer ), " ^"%s^" ^"%s^" ^"%s^" ^"a^" // Admin Cumparat cu points", szName, szPassword, g_admin_flags );
- ColorChat ( 0, "!x04%s !x03Player !x04%s !x03bought !x04ADMIN", PLUGIN, szName );
- ColorChat ( id, "!x04%s !x03YOUR PASSWORD: !x04%s", PLUGIN, szPassword );
- ColorChat ( id, "!x04%s !x03USE: !x04setinfo %s %s", PLUGIN, g_password_field, szPassword );
- set_hudmessage(0, 127, 255, 0.32, 0.15, 0, 6.0, 5.0 );
- show_hudmessage(id, "You bought ADMIN!^nYour Password: %s", szPassword );
- write_file ( g_access_file, szBuffer );
- console_print ( id, "[XMAS Outstanding] ADMIN PASSWORD: %s", szPassword );
- console_print ( id, "[XMAS Outstanding] ADMIN PASSWORD: %s", szPassword );
- console_print ( id, "[XMAS Outstanding] ADMIN PASSWORD: %s", szPassword );
- csdm_set_user_points ( id, g_bPoints [ id ] - 9500 );
- }
- }
- return PLUGIN_CONTINUE;
- }
- public TaskAnnounce ( )
- {
- ColorChat ( 0, "!x04%s !x03Say !x04/stop !x03to stop the radio", PLUGIN );
- return PLUGIN_CONTINUE;
- }
- public cmd_stop ( id )
- {
- if ( KISS [ id ] )
- {
- show_motd ( id, "addons/amxmodx/configs/xmas/radio/kiss_stop.html" );
- KISS [ id ] = false;
- }
- if ( DIZZ [ id ] )
- {
- show_motd ( id, "addons/amxmodx/configs/xmas/radio/dizz_stop.html" );
- DIZZ [ id ] = false;
- }
- if ( ZU [ id ] )
- {
- show_motd ( id, "addons/amxmodx/configs/xmas/radio/zu_stop.html" );
- ZU [ id ] = false;
- }
- return PLUGIN_CONTINUE;
- }
- stock ColorChat(const id, const input[], any:...) {
- new count = 1, players[32];
- static msg[191];
- vformat(msg, 190, input, 3);
- replace_all(msg, 190, "!x04", "!g"); // verde
- replace_all(msg, 190, "!x01", "!n"); // galben/alb/negru
- replace_all(msg, 190, "!x03", "!g"); // rosu/albastru/gri
- 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();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement