Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- *Multumiri*:
- - Sn!ff3r
- */
- #include < amxmodx >
- #include < amxmisc>
- #include < engine >
- #include < cstrike >
- #include < fun >
- #include < hamsandwich >
- #include < fakemeta_util >
- #pragma tabsize 0
- native fcs_get_user_credits(client);
- native fcs_set_user_credits(client, credits);
- #define PLUGIN "Furien Shop"
- #define VERSION "0.1"
- #define AUTHOR "HyperioN."
- #define IsPlayer(%0) ( 1 <= %0 <= g_iMaxPlayers )
- // -- | Shop | -- //
- new bool: g_blockshop[ 33 ];
- new const Prefix[ ] = "^x04[Furien]^x01";
- // == | Super-Knife | == //
- new bool:Knife2X [ 33 ];
- new v_Knife2X [ 66 ] = "models/ultimate_furien/v_thunderknife.mdl";
- // -- | Take Damage | -- //
- new g_iMaxPlayers;
- new bool: HaveNoFlash [ 33 ];
- new g_msgScreenFade;
- new g_msgSayText;
- public plugin_init() {
- register_plugin(PLUGIN, VERSION, AUTHOR);
- //Register Shop
- register_clcmd("say /shop", "FurienShop" );
- register_clcmd("say shop", "FurienShop" );
- register_clcmd("say_team /shop", "FurienShop" );
- register_clcmd("say_team shop", "FurienShop" );
- //Register Arme
- register_event ( "CurWeapon", "CurrWeapon", "be", "1=1" );
- RegisterHam ( Ham_TakeDamage, "player", "Player_TakeDamage" );
- RegisterHam ( Ham_Spawn, "player", "Spawn", true );
- register_event("ScreenFade", "eventFlash", "be", "4=255", "5=255", "6=255", "7>199")
- g_iMaxPlayers = get_maxplayers ( );
- g_msgScreenFade = get_user_msgid("ScreenFade")
- g_msgSayText = get_user_msgid("SayText")
- }
- public plugin_precache ( ) {
- //Super-Knife
- precache_model ( v_Knife2X );
- }
- public client_putinserver(id)
- {
- g_blockshop[ id ] = true;
- }
- public Spawn( id ) {
- fm_strip_user_weapons(id)
- fm_give_item(id, "weapon_knife" );
- HaveNoFlash [ id ] = false;
- if( get_user_team(id) == 2 )
- {
- Knife2X [ id ] = false;
- }
- }
- public CurrWeapon ( id ) {
- if ( Knife2X [ id ] && get_user_weapon ( id ) == CSW_KNIFE ) {
- set_pev ( id, pev_viewmodel2, v_Knife2X );
- }
- }
- public FurienShop ( id ) {
- if(g_blockshop[ id ])
- {
- g_blockshop[ id ] = false;
- if ( get_user_team(id) == 1 ) {
- ShopFurien( id )
- }
- if ( get_user_team (id ) == 2 ) {
- ShopAntiFurien ( id )
- }
- set_task(5.0, "ShopBlock", id);
- }
- else
- {
- ColorChat( id, "%s Poti accesa meniul odata la 5 secunde.", Prefix );
- }
- }
- public ShopBlock(id)
- {
- g_blockshop[ id ] = true;
- remove_task(id)
- }
- public ShopAntiFurien ( id ) {
- new Temp[101], credits = fcs_get_user_credits(id);
- formatex(Temp,100, "\yShop Anti-Furien \r[ v0.1 ]\y:^nCreditele Tale:\r %d", credits);
- new menu = menu_create(Temp, "AntiFurien")
- menu_additem(menu, "\y25AP [\r5 Credite\y]", "1", 0);
- menu_additem(menu, "\y25HP [\r10 Credite\y]", "2", 0);
- menu_additem(menu, "\y50HP + 50 AP [\r20 Credite\y]", "3", 0);
- menu_additem(menu, "\yHe Grenade [\r3 Credite\y]", "4", 0);
- menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
- menu_display(id, menu, 0);
- return 1;
- }
- public ShopFurien( id ) {
- new Temp[101], credits = fcs_get_user_credits(id);
- formatex(Temp,100, "\yShop Furien \r[ v0.1 ]\y:^nCreditele Tale:\r %d", credits);
- new menu = menu_create(Temp, "Furien")
- menu_additem(menu, "\y50AP [\r5 Credite\y]", "1", 0);
- menu_additem(menu, "\y100HP [\r10 Credite\y]", "2", 0 );
- menu_additem(menu, "\y250HP + 100AP [\r20 Credite\y]", "3", 0 );
- menu_additem(menu, "\yNo Flash [\r5 Credite\y]", "4", 0);
- menu_additem(menu, "\ySuperKnife ( 2X ) [\r15 Credite\y]^n", "5", 0);
- menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
- menu_display(id, menu, 0);
- return 1;
- }
- public Furien(id, menu, item) {
- if( item == MENU_EXIT )
- {
- return 1;
- }
- new data [ 6 ], szName [ 64 ];
- new access, callback;
- menu_item_getinfo ( menu, item, access, data,charsmax ( data ), szName,charsmax ( szName ), callback );
- new key = str_to_num ( data );
- switch ( key )
- {
- case 1:
- {
- if( get_user_team(id) == 1 )
- {
- new iCredits = fcs_get_user_credits ( id ) - 5;
- if( iCredits < 0 )
- {
- ColorChat( id, "%s Nu ai suficiente credite.", Prefix );
- return 1;
- }
- else
- {
- new Armor = get_user_armor ( id );
- if ( Armor < 100 ) {
- fm_set_user_armor( id, get_user_armor ( id ) + 50 );
- ColorChat(id, "%s Ai cumparat 50 AP.", Prefix );
- fcs_set_user_credits ( id, iCredits );
- return 1;
- }
- if ( Armor >= 100 )
- {
- ColorChat( id, "%s Ai atins limita de AP.", Prefix);
- return 1;
- }
- }
- }
- else
- {
- ColorChat(id, "%s Doar Teroristi au acces la accest meniu.", Prefix );
- }
- }
- case 2:
- {
- if( get_user_team(id) == 1 )
- {
- new iCredits = fcs_get_user_credits ( id ) - 10;
- if( iCredits < 0 )
- {
- ColorChat( id, "!%s Nu ai suficiente credite.", Prefix);
- return 1;
- }
- else
- {
- new Health = get_user_health ( id );
- if ( Health < 3500 ) {
- fm_set_user_health( id, get_user_health ( id ) + 50 );
- ColorChat(id, "%s Ai cumparat 50 HP.", Prefix );
- fcs_set_user_credits ( id, iCredits );
- return 1;
- }
- if ( Health >= 3500 )
- {
- ColorChat( id, "%s Ai atins limita de HP.", Prefix);
- return 1;
- }
- }
- }
- else
- {
- ColorChat(id, "%s Doar Teroristi au acces la accest meniu.", Prefix );
- }
- }
- case 3:
- {
- if( get_user_team(id) == 1 )
- {
- new iCredits = fcs_get_user_credits ( id ) - 20;
- if( iCredits < 0 )
- {
- ColorChat( id, "!%s Nu ai suficiente credite.", Prefix);
- return 1;
- }
- else
- {
- new Health = get_user_health ( id );
- if ( Health < 3500 ) {
- fm_set_user_health( id, get_user_health ( id ) + 100 );
- fm_set_user_armor( id, get_user_armor ( id ) + 100 );
- ColorChat(id, "%s Ai cumparat 100 HP si 100 AP.", Prefix );
- fcs_set_user_credits ( id, iCredits );
- return 1;
- }
- if ( Health >= 3500 ) {
- ColorChat( id, "%s Ai atins limita de HP.", Prefix);
- return 1;
- }
- }
- }
- else
- {
- ColorChat(id, "%s Doar Teroristi au acces la accest meniu.", Prefix );
- }
- }
- case 4:
- {
- if( get_user_team(id) == 1 )
- {
- new iCredits = fcs_get_user_credits ( id ) - 5;
- if( iCredits < 0 )
- {
- ColorChat( id, "%s Nu ai suficiente credite.", Prefix);
- return 1;
- }
- else
- {
- HaveNoFlash [ id ] = true;
- ColorChat(id, "%s Ai cumparat No Flash.", Prefix );
- fcs_set_user_credits(id, iCredits);
- return 1;
- }
- }
- else
- {
- ColorChat(id, "%s Doar Teroristi au acces la accest meniu.", Prefix );
- }
- }
- case 5:
- {
- if( get_user_team(id) == 1 )
- {
- new iCredits = fcs_get_user_credits ( id ) - 15;
- if( iCredits < 0 )
- {
- ColorChat( id, "%s Nu ai credite suficiente.", Prefix);
- return 1;
- }
- else
- {
- Knife2X [ id ] = true;
- CurrWeapon(id);
- ColorChat(id, "%s Ai cumparat SuperKnife ( 2X ).", Prefix );
- fcs_set_user_credits(id, iCredits);
- }
- }
- else
- {
- ColorChat(id, "%s Doar Teroristi au acces la accest meniu.", Prefix );
- }
- }
- case 6:
- {
- if( get_user_team(id) == 1 )
- {
- new iCredits = fcs_get_user_credits ( id ) - 30;
- if( iCredits < 0 )
- {
- ColorChat( id, "%s Nu ai credite suficiente.", Prefix);
- return 1;
- }
- else
- {
- Knife2X [ id ] = false;
- }
- }
- else
- {
- ColorChat(id, "%s Doar Teroristi au acces la accest meniu.", Prefix );
- }
- }
- }
- menu_destroy(menu);
- return 1;
- }
- public AntiFurien(id, menu, item ) {
- if( item == MENU_EXIT )
- {
- return 1;
- }
- new data [ 6 ], szName [ 64 ];
- new access, callback;
- menu_item_getinfo ( menu, item, access, data,charsmax ( data ), szName,charsmax ( szName ), callback );
- new key = str_to_num ( data );
- switch ( key )
- {
- case 1:
- {
- if( get_user_team(id) == 2 )
- {
- new iCredits = fcs_get_user_credits ( id ) - 3;
- if( iCredits < 0 )
- {
- ColorChat( id, "%s Nu ai suficiente credite.", Prefix );
- return 1;
- }
- else
- {
- new Armor = get_user_armor ( id );
- if ( Armor < 100 ) {
- fm_set_user_armor( id, get_user_armor ( id ) + 25 );
- ColorChat(id, "%s Ai cumparat 25 AP.", Prefix );
- fcs_set_user_credits ( id, iCredits );
- return 1;
- }
- if ( Armor >= 100 ) {
- ColorChat( id, "%s Ai atins limita de AP.", Prefix);
- return 1;
- }
- }
- }
- else
- {
- ColorChat(id, "%s Doar Counter-Teroristi au acces la accest meniu.", Prefix );
- }
- }
- case 2:
- {
- if( get_user_team(id) == 2 )
- {
- new iCredits = fcs_get_user_credits ( id ) - 3;
- if( iCredits < 0 )
- {
- ColorChat( id, "!%s Nu ai suficiente credite.", Prefix);
- return 1;
- }
- else
- {
- new Health = get_user_health ( id );
- if ( Health < 150 ) {
- fm_set_user_health( id, get_user_health ( id ) + 25 );
- ColorChat(id, "%s Ai cumparat 25 HP.", Prefix );
- fcs_set_user_credits ( id, iCredits );
- return 1;
- }
- if ( Health >= 150 ) {
- ColorChat( id, "%s Ai atins limita de HP.", Prefix);
- return 1;
- }
- }
- }
- else
- {
- ColorChat(id, "%s Doar Counter-Teroristi au acces la accest meniu.", Prefix );
- }
- }
- case 3:
- {
- if( get_user_team(id) == 2 )
- {
- new iCredits = fcs_get_user_credits ( id ) - 9;
- if( iCredits < 0 )
- {
- ColorChat( id, "!%s Nu ai suficiente credite.", Prefix);
- return 1;
- }
- else
- {
- new Health = get_user_health ( id );
- if ( Health < 150 ) {
- fm_set_user_health( id, get_user_health ( id ) + 50 );
- fm_set_user_armor( id, get_user_armor ( id ) + 50 );
- ColorChat(id, "%s Ai cumparat 50 HP si 50 AP.", Prefix );
- fcs_set_user_credits ( id, iCredits );
- return 1;
- }
- if ( Health >= 150 ) {
- ColorChat( id, "%s Ai atins limita de HP.", Prefix);
- return 1;
- }
- }
- }
- else
- {
- ColorChat(id, "%s Doar Counter-Teroristi au acces la accest meniu.", Prefix );
- }
- }
- case 4:
- {
- if( get_user_team(id) == 2 )
- {
- new iCredits = fcs_get_user_credits ( id ) - 5;
- if( iCredits < 0 )
- {
- ColorChat( id, "%s Nu ai credite suficiente.", Prefix);
- return 1;
- }
- else
- {
- if( get_user_weapon(id) == CSW_HEGRENADE)
- {
- ColorChat(id, "%s Detii deja un HE.", Prefix );
- }
- else
- {
- fm_give_item(id, "weapon_hegrenade");
- fcs_set_user_credits(id, iCredits);
- return 1;
- }
- }
- }
- else
- {
- ColorChat(id, "%s Doar Counter-Teroristi au acces la accest meniu.", Prefix );
- }
- }
- case 5:
- {
- if( get_user_team(id) == 2 )
- {
- new iCredits = fcs_get_user_credits ( id ) - 5;
- if( iCredits < 0 )
- {
- ColorChat( id, "%s Nu ai credite suficiente.", Prefix);
- return 1;
- }
- else
- {
- HaveNoFlash [ id ] = true;
- ColorChat(id, "%s Ai cumparat No Flash.", Prefix );
- fcs_set_user_credits(id, iCredits);
- return 1;
- }
- }
- else
- {
- ColorChat(id, "%s Doar Counter-Teroristi au acces la accest meniu.", Prefix );
- }
- }
- }
- menu_destroy(menu);
- return 1;
- }
- public eventFlash(id)
- {
- if(is_user_connected(id) && HaveNoFlash [ id ])
- {
- message_begin(MSG_ONE, g_msgScreenFade, {0,0,0}, id)
- write_short(1)
- write_short(1)
- write_short(1)
- write_byte(0)
- write_byte(0)
- write_byte(0)
- write_byte(255)
- message_end()
- }
- }
- public Player_TakeDamage ( iVictim, iInflictor, iAttacker, Float:fDamage, iDamageBits )
- {
- if ( IsPlayer ( iAttacker ) ) {
- if( iInflictor == iAttacker && Knife2X [ iAttacker ] && is_user_alive( iAttacker ) && get_user_weapon( iAttacker ) == CSW_KNIFE && cs_get_user_team( iAttacker ) == CS_TEAM_T )
- {
- SetHamParamFloat( 4, fDamage * 2.0);
- return HAM_HANDLED;
- }
- }
- return HAM_IGNORED;
- }
- stock ColorChat(id, const input[], any:...)
- {
- static iPlayersNum[32], iCount; iCount = 1
- static szMsg[191]
- vformat(szMsg, charsmax(szMsg), input, 3)
- replace_all(szMsg, 190, "/g", "^x04") // green txt
- replace_all(szMsg, 190, "/y", "^x01") // orange txt
- replace_all(szMsg, 190, "/ctr", "^x03") // team txt
- replace_all(szMsg, 190, "/w", "^x00") // team txt
- if(id) iPlayersNum[0] = id
- else get_players(iPlayersNum, iCount, "ch")
- for (new i = 0; i < iCount; i++)
- {
- if (is_user_connected(iPlayersNum[i]))
- {
- message_begin(MSG_ONE_UNRELIABLE, g_msgSayText, _, iPlayersNum[i])
- write_byte(iPlayersNum[i])
- write_string(szMsg)
- message_end()
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement