[Cerere plugin]Shop credite+plugin credite

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
K-Lumea
Membru, skill 0
Membru, skill 0
Posts: 17
Joined: 01 Dec 2013, 01:04
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 2 times
Contact:

01 Dec 2013, 01:07

Salut eXtreamCS !

Am si eu o rugaminte mare pentru voi , m-ati putea ajuta cu un shop pe CREDITE + un plugin de credite STABIL ? :D Apreciez enorm :D

PS : As dori alta versiune nu cea de FCS a lui Askhanar . Multumesc frumos !
User avatar
-Turbo-
Membru, skill +4
Membru, skill +4
Posts: 1658
Joined: 11 Nov 2012, 01:28
Detinator Steam: Da
CS Status: Bored !
Detinator server CS: Da
SteamID: kingforbidden
Reputatie: Utilizator neserios ( tepar )
Restrictie moderator
Ban scos ( achitat )
Nume anterior: Turbo19973
Location: Botosani
Has thanked: 47 times
Been thanked: 210 times
Contact:

01 Dec 2013, 02:08

| Afiseaza codul
#include < amxmodx >
#include < amxmisc>
#include < engine >
#include < cstrike >
#include < hamsandwich >
#include < fakemeta >
#include < fakemeta_util >
#include < CC_ColorChat >
#include < fun >
#include < fcs >

#define PLUGIN "Furien Shop"
#define VERSION "0.2"
#define AUTHOR "-Turbo-"

#define   FL_WATERJUMP   (1<<11)
#define   FL_ONGROUND         (1<<9)

new bool:UserHaveBhop[33];
new bool:super_knife [ 33 ];

new super_knife_v_model [ 66 ] = "models/v_super_cutit3.mdl";

public plugin_init() {
   register_plugin(PLUGIN, VERSION, AUTHOR);
   
   register_clcmd("say /shop", "FurienShop", 0);
   register_clcmd("say shop", "FurienShop", 0);
   register_clcmd("say_team /shop", "FurienShop", 0);
   register_clcmd("say_team shop", "FurienShop", 0);
   register_event ( "CurWeapon", "CurrentWeapon", "be", "1=1" );
   RegisterHam ( Ham_TakeDamage, "player", "Player_TakeDamage" );
   RegisterHam ( Ham_Spawn, "player", "Spawn", 1 ); 
   
}
public plugin_precache ( ) {
   
   precache_model ( super_knife_v_model );
}
public Spawn ( id ) {
   
   strip_user_weapons ( id );
   give_item ( id, "weapon_knife" );
   super_knife [ id ] = false;
         UserHaveBhop[id] = false;

}
public CurrentWeapon ( id ) {
   
   if ( super_knife [ id ] && get_user_weapon ( id ) == CSW_KNIFE ) {
      
      set_pev ( id, pev_viewmodel2, super_knife_v_model );
   }
}
public FurienShop ( id ) {
   
   if (get_user_team(id) == 1 ) {
      
      set_task( 0.1, "ShowFurien", id );
   }
   
   if (get_user_team (id ) == 2 ) {
      
      set_task( 0.1, "ShowAntiFurien", id );
   }
}
public ShowAntiFurien(id, level, cid) {   
 
   new menu = menu_create( "\r Credite\w Shop", "antifurienhandler");
   menu_additem(menu, "HP + AP - \r6 \yCredite", "1", 0);
   menu_additem(menu, "Defuse Kit - \r2 \yCredite", "2", 0 );
   menu_additem(menu, "50 HP - \r2 \yCredite", "3", 0);
   menu_additem(menu, "50 AP - \r2 \yCredite", "4", 0);
   menu_additem(menu, "Autobhop - \r6 \yCredite", "5", 0);
   
   menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
   menu_display(id, menu, 0);

}
public ShowFurien(id, level, cid) {    

   new menu = menu_create( "\r Credite\w Shop", "furienhandler");
   menu_additem(menu, "SuperKnife - \r5 \yCredite", "1", 0);
   menu_additem(menu, "HE Grenade - \r3 \yCredite", "2", 0 );
   menu_additem(menu, "50 HP - \r2 \yCredite", "3", 0);
   menu_additem(menu, "50 AP - \r2 \yCredite", "4", 0);
   menu_additem(menu, "Autobhop - \r6 \yCredite", "5", 0);

   menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
   menu_display(id, menu, 0);

}

public furienhandler(id, menu, item, level, cid) {
   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:
      {
         new iCredits = fcs_get_user_credits ( id ) - 5;
         if( iCredits < 0 )
         {
            ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
            return 1;
            
         }
         else
         { 
            super_knife[ id ] = true;
                                   CurrentWeapon( id );
               
            fcs_set_user_credits( id, iCredits );
            return 1;
         }
      }
  
      case 2:
      {
         new iCredits = fcs_get_user_credits ( id ) - 3;
         if( iCredits < 0 )
         {
            ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
            return 1;
            
         }
         else
         {
            give_item( id, "weapon_hegrenade" );
            fcs_set_user_credits( id, iCredits );
            return 1;
         }
      } 

      case 3:
      {
         new iCredits = fcs_get_user_credits ( id ) - 2;
         if( iCredits < 0 )
         {
            ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
            return 1;
            
         }
         else
         {
            new Health = get_user_health ( id );
            if( Health <= 100 )
            {
               fm_set_user_health( id, get_user_health ( id ) + 50 );
               fcs_set_user_credits( id, iCredits );
               return 1;
            }
            
            if( Health > 100 ) {
               
               ColorChat( id, GREEN, "[Furien]^x01 Trebuie sa ai mai putin de^x03 100 HP^x01 sa poti cumpara inca 50 hp" );
               return 1;
            }
         }
      }

      case 4:
      {
         new iCredits = fcs_get_user_credits ( id ) - 2;
         if( iCredits < 0 )
         {
            ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
            return 1;
            
         }
         else
         {
            new Armor = get_user_armor ( id );
            if ( Armor <= 100 ) {
               fm_set_user_armor( id, get_user_armor ( id ) + 50 );
               fcs_set_user_credits ( id, iCredits );
               return 1;
            }
            
            if ( Armor > 100 ) {
               
               ColorChat( id, GREEN, "[Furien]^x01 Trebuie sa ai mai putin de^4 100 AP^x01 sa poti cumpara inca 50 AP" );
               return 1;
            }
         }
      }

      case 5:
      {
         new iCredits = fcs_get_user_credits ( id ) - 6;
         if( iCredits < 0 )
         {
            ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
            return 1;
            
         }
         if(UserHaveBhop[id]) {
            ColorChat( id, GREEN, "[Furien]^x01 Tu ai Bhop.");
         } 
         else if(!UserHaveBhop[id]) {
            ColorChat( id, GREEN, "[Furien]^x01 Ai luat Bhop.");
            UserHaveBhop[id] = true;
            fcs_set_user_credits ( id, iCredits );
            return 1;
         }
      }
   }
   menu_destroy(menu);
   return 1;
}
   
public antifurienhandler(id, menu, item, level, cid) {
      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:
         {
            new iCredits = fcs_get_user_credits ( id ) - 6;
            if( iCredits < 0 )
            {
               ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
               return 1;
               
            }
            else
            { 
               new Health = get_user_health ( id );
               
               if ( Health <= 100 )
               {
                  fm_set_user_health ( id, get_user_health ( id ) + 80 );
               }
               
               new Armor = get_user_armor ( id );
               
               if ( Armor <= 100 )
               {
                  fm_set_user_armor( id, get_user_armor ( id ) + 80 );
               }
               
               fcs_set_user_credits ( id, iCredits );
               return 1;
            }
         }  

         case 2:
         {
            new iCredits = fcs_get_user_credits ( id ) - 2;
            if( iCredits < 0 )
            {
               ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
               return 1;
               
            }
            else
            { 
                                        fm_give_item ( id, "item_thighpack" )
               fcs_set_user_credits ( id, iCredits );
               return 1;
            }
         }
  
         case 3:
         {
            new iCredits = fcs_get_user_credits ( id ) - 2;
            if( iCredits < 0 )
            {
               ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
               return 1;
               
            }
            else
            {
               new Health = get_user_health ( id );
               if ( Health <= 100 ) {
                  fm_set_user_health ( id, get_user_health ( id ) + 50 );
                  fcs_set_user_credits ( id, iCredits );
                  return 1;
               }
               
               if ( Health > 100 ) {
                  
                  ColorChat ( id, GREEN, "[Furien]^x01 Trebuie sa ai mai putin de^x03 100 HP^x01 sa poti cumpara inca 50 HP" );
                  return 1;
               }
            }
         }

         case 4:
         {
            new iCredits = fcs_get_user_credits ( id ) - 2;
            if( iCredits < 0 )
            {
               ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
               return 1;
               
            }
            else
            {
               new Armor = get_user_armor ( id );
               if ( Armor <= 100 ) {
                  fm_set_user_armor( id, get_user_armor ( id ) + 50 );
                  fcs_set_user_credits ( id, iCredits );
                  return 1;
               }
               
               if ( Armor > 100 ) {
                  
                  ColorChat( id, GREEN, "[Furien]^x01 Trebuie sa ai mai putin de ^4 100 AP^x01 sa poti cumpara inca 50 AP" );
                  return 1;
               }
            }
         }

         case 5:
         {
            new iCredits = fcs_get_user_credits ( id ) - 6;
            if( iCredits < 0 )
            {
               ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
               return 1;
               
            }
            if(UserHaveBhop[id]) {
               ColorChat( id, GREEN, "[Furien]^x01 Tu ai Bhop");
            } 
            else if(!UserHaveBhop[id]) {
               ColorChat( id, GREEN, "[Furien]^x01 Ai luat Bhop");
               UserHaveBhop[id] = true;
               fcs_set_user_credits ( id, iCredits );
               return 1;
            }
         }
         
      }
      menu_destroy(menu);
      return 1;
}

public client_PreThink(id) {
   if(!UserHaveBhop[id])
      return 0;
   
   entity_set_float(id, EV_FL_fuser2, 0.0);
   
   if(entity_get_int(id, EV_INT_button) & 2) {
      new flags = entity_get_int(id, EV_INT_flags);

      if(flags & FL_WATERJUMP)
         return 0;
         
      if(entity_get_int(id, EV_INT_waterlevel) >= 2)
         return 0;
         
      if(!(flags & FL_ONGROUND))
         return 0;
      
      new Float:velocity[3];
      entity_get_vector(id, EV_VEC_velocity, velocity);
      velocity[2] += 250.0;
      entity_set_vector(id, EV_VEC_velocity, velocity);

      entity_set_int(id, EV_INT_gaitsequence, 6);
   }
   
   return 0;
}
public Player_TakeDamage ( iVictim, iInflictor, iAttacker, Float:fDamage, iDamageBits )
{
   if( iInflictor == iAttacker && super_knife [ 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;
}
K-Lumea
Membru, skill 0
Membru, skill 0
Posts: 17
Joined: 01 Dec 2013, 01:04
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 2 times
Contact:

01 Dec 2013, 09:15

Multumesc frumos , Turbo !

Dar se poate face o modificare ? As dori sa se scoata acel AutoBhop din shop de la ambele echipe ; in plus as vrea sa se adauge HE Grenade la Antifurien .
User avatar
-Turbo-
Membru, skill +4
Membru, skill +4
Posts: 1658
Joined: 11 Nov 2012, 01:28
Detinator Steam: Da
CS Status: Bored !
Detinator server CS: Da
SteamID: kingforbidden
Reputatie: Utilizator neserios ( tepar )
Restrictie moderator
Ban scos ( achitat )
Nume anterior: Turbo19973
Location: Botosani
Has thanked: 47 times
Been thanked: 210 times
Contact:

02 Dec 2013, 01:29

| Afiseaza codul
#include < amxmodx >
#include < amxmisc>
#include < engine >
#include < cstrike >
#include < hamsandwich >
#include < fakemeta >
#include < fakemeta_util >
#include < CC_ColorChat >
#include < fun >
#include < fcs >

#define PLUGIN "Furien Shop"
#define VERSION "0.2"
#define AUTHOR "-Turbo-"


new bool:super_knife [ 33 ];
new super_knife_v_model [ 66 ] = "models/v_super_cutit3.mdl";

public plugin_init() {
	
	register_plugin(PLUGIN, VERSION, AUTHOR);
	
	register_clcmd("say /shop", "FurienShop", 0);
	register_clcmd("say shop", "FurienShop", 0);
	register_clcmd("say_team /shop", "FurienShop", 0);
	register_clcmd("say_team shop", "FurienShop", 0);
	register_event ( "CurWeapon", "CurrentWeapon", "be", "1=1" );
	RegisterHam ( Ham_TakeDamage, "player", "Player_TakeDamage" );
	RegisterHam ( Ham_Spawn, "player", "Spawn", 1 ); 
	
}
public plugin_precache ( ) {
	
	precache_model ( super_knife_v_model );
}
public Spawn ( id ) {
	
	strip_user_weapons ( id );
	give_item ( id, "weapon_knife" );
	super_knife [ id ] = false;
	
}
public CurrentWeapon ( id ) {
	
	if ( super_knife [ id ] && get_user_weapon ( id ) == CSW_KNIFE ) {
		
		set_pev ( id, pev_viewmodel2, super_knife_v_model );
	}
}
public FurienShop ( id ) {
	
	if (get_user_team(id) == 1 ) {
		
		set_task( 0.1, "ShowFurien", id );
	}
	
	if (get_user_team (id ) == 2 ) {
		
		set_task( 0.1, "ShowAntiFurien", id );
	}
}
public ShowAntiFurien(id, level, cid) {   
	
	new menu = menu_create( "\r Credite\w Shop", "antifurienhandler");
	menu_additem(menu, "HP + AP - \r6 \yCredite", "1", 0);
	menu_additem(menu, "Defuse Kit - \r2 \yCredite", "2", 0 );
	menu_additem(menu, "50 HP - \r2 \yCredite", "3", 0);
	menu_additem(menu, "50 AP - \r2 \yCredite", "4", 0);
	menu_additem(menu, "He Grenade - \r6 \yCredite", "5", 0);
	
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, menu, 0);
	
}
public ShowFurien(id, level, cid) {    
	
	new menu = menu_create( "\r Credite\w Shop", "furienhandler");
	menu_additem(menu, "SuperKnife - \r5 \yCredite", "1", 0);
	menu_additem(menu, "HE Grenade - \r3 \yCredite", "2", 0 );
	menu_additem(menu, "50 HP - \r2 \yCredite", "3", 0);
	menu_additem(menu, "50 AP - \r2 \yCredite", "4", 0);
	
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, menu, 0);
	
}

public furienhandler(id, menu, item, level, cid) {
	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:
		{
			new iCredits = fcs_get_user_credits ( id ) - 5;
			if( iCredits < 0 )
			{
				ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
				return 1;
				
			}
			else
			{ 
				super_knife[ id ] = true;
				CurrentWeapon( id );
				
				fcs_set_user_credits( id, iCredits );
				return 1;
			}
		}
		
		case 2:
		{
			new iCredits = fcs_get_user_credits ( id ) - 3;
			if( iCredits < 0 )
			{
				ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
				return 1;
				
			}
			else
			{
				give_item( id, "weapon_hegrenade" );
				fcs_set_user_credits( id, iCredits );
				return 1;
			}
		} 
		
		case 3:
		{
			new iCredits = fcs_get_user_credits ( id ) - 2;
			if( iCredits < 0 )
			{
				ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
				return 1;
				
			}
			else
			{
				new Health = get_user_health ( id );
				if( Health <= 100 )
				{
					fm_set_user_health( id, get_user_health ( id ) + 50 );
					fcs_set_user_credits( id, iCredits );
					return 1;
				}
				
				if( Health > 100 ) {
					
					ColorChat( id, GREEN, "[Furien]^x01 Trebuie sa ai mai putin de^x03 100 HP^x01 sa poti cumpara inca 50 hp" );
					return 1;
				}
			}
		}
		
		case 4:
		{
			new iCredits = fcs_get_user_credits ( id ) - 2;
			if( iCredits < 0 )
			{
				ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
				return 1;
				
			}
			else
			{
				new Armor = get_user_armor ( id );
				if ( Armor <= 100 ) {
					fm_set_user_armor( id, get_user_armor ( id ) + 50 );
					fcs_set_user_credits ( id, iCredits );
					return 1;
				}
				
				if ( Armor > 100 ) {
					
					ColorChat( id, GREEN, "[Furien]^x01 Trebuie sa ai mai putin de^4 100 AP^x01 sa poti cumpara inca 50 AP" );
					return 1;
				}
			}
		}
	}
	menu_destroy(menu);
	return 1;
}

public antifurienhandler(id, menu, item, level, cid) {
	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:
		{
			new iCredits = fcs_get_user_credits ( id ) - 6;
			if( iCredits < 0 )
			{
				ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
				return 1;
				
			}
			else
			{ 
				new Health = get_user_health ( id );
				
				if ( Health <= 100 )
				{
					fm_set_user_health ( id, get_user_health ( id ) + 80 );
				}
				
				new Armor = get_user_armor ( id );
				
				if ( Armor <= 100 )
				{
					fm_set_user_armor( id, get_user_armor ( id ) + 80 );
				}
				
				fcs_set_user_credits ( id, iCredits );
				return 1;
			}
		}  
		
		case 2:
		{
			new iCredits = fcs_get_user_credits ( id ) - 2;
			if( iCredits < 0 )
			{
				ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
				return 1;
				
			}
			else
			{ 
				fm_give_item ( id, "item_thighpack" )
				fcs_set_user_credits ( id, iCredits );
				return 1;
			}
		}
		
		case 3:
		{
			new iCredits = fcs_get_user_credits ( id ) - 2;
			if( iCredits < 0 )
			{
				ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
				return 1;
				
			}
			else
			{
				new Health = get_user_health ( id );
				if ( Health <= 100 ) {
					fm_set_user_health ( id, get_user_health ( id ) + 50 );
					fcs_set_user_credits ( id, iCredits );
					return 1;
				}
				
				if ( Health > 100 ) {
					
					ColorChat ( id, GREEN, "[Furien]^x01 Trebuie sa ai mai putin de^x03 100 HP^x01 sa poti cumpara inca 50 HP" );
					return 1;
				}
			}
		}
		
		case 4:
		{
			new iCredits = fcs_get_user_credits ( id ) - 2;
			if( iCredits < 0 )
			{
				ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
				return 1;
				
			}
			else
			{
				new Armor = get_user_armor ( id );
				if ( Armor <= 100 ) {
					fm_set_user_armor( id, get_user_armor ( id ) + 50 );
					fcs_set_user_credits ( id, iCredits );
					return 1;
				}
				
				if ( Armor > 100 ) {
					
					ColorChat( id, GREEN, "[Furien]^x01 Trebuie sa ai mai putin de ^4 100 AP^x01 sa poti cumpara inca 50 AP" );
					return 1;
				}
			}
		}
		
		case 5:
		{
			new iCredits = fcs_get_user_credits ( id ) - 6;
			if( iCredits < 0 )
			{
				ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
				return 1;
				
			}
			else
			{ 
				fm_give_item ( id, "weapon_hegrenade" )
				fcs_set_user_credits ( id, iCredits );
				return 1;
			}
		}
		
	}
	menu_destroy(menu);
	return 1;
}

public Player_TakeDamage ( iVictim, iInflictor, iAttacker, Float:fDamage, iDamageBits )
{
	if( iInflictor == iAttacker && super_knife [ 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;
}
K-Lumea
Membru, skill 0
Membru, skill 0
Posts: 17
Joined: 01 Dec 2013, 01:04
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 2 times
Contact:

05 Dec 2013, 23:39

Turbo , ai putea adauga la CT si defuse kit & FlashBang ?

Daca poti adauga sa dea KNIFE automat fiecarei echipe te rog :X

Multumesc frumos !
User avatar
-Turbo-
Membru, skill +4
Membru, skill +4
Posts: 1658
Joined: 11 Nov 2012, 01:28
Detinator Steam: Da
CS Status: Bored !
Detinator server CS: Da
SteamID: kingforbidden
Reputatie: Utilizator neserios ( tepar )
Restrictie moderator
Ban scos ( achitat )
Nume anterior: Turbo19973
Location: Botosani
Has thanked: 47 times
Been thanked: 210 times
Contact:

06 Dec 2013, 14:42

| Afiseaza codul
#include < amxmodx >
#include < amxmisc>
#include < engine >
#include < cstrike >
#include < hamsandwich >
#include < fakemeta >
#include < fakemeta_util >
#include < CC_ColorChat >
#include < fun >

native fcs_get_user_credits(client)
native fcs_set_user_credits(client, credits)

#define PLUGIN "Furien Shop"
#define VERSION "0.2"
#define AUTHOR "-Turbo-"


new bool:super_knife [ 33 ];
new super_knife_v_model [ 66 ] = "models/v_super_cutit3.mdl";

public plugin_init() {
	
	register_plugin(PLUGIN, VERSION, AUTHOR);
	
	register_clcmd("say /shop", "FurienShop", 0);
	register_clcmd("say shop", "FurienShop", 0);
	register_clcmd("say_team /shop", "FurienShop", 0);
	register_clcmd("say_team shop", "FurienShop", 0);
	register_event ( "CurWeapon", "CurrentWeapon", "be", "1=1" );
	RegisterHam ( Ham_TakeDamage, "player", "Player_TakeDamage" );
	RegisterHam ( Ham_Spawn, "player", "Spawn", 1 ); 
	
}
public plugin_precache ( ) {
	
	precache_model ( super_knife_v_model );
}
public Spawn ( id ) {
	
	strip_user_weapons ( id );
	give_item ( id, "weapon_knife" );
	super_knife [ id ] = false;
	
}
public CurrentWeapon ( id ) {
	
	if ( super_knife [ id ] && get_user_weapon ( id ) == CSW_KNIFE ) {
		
		set_pev ( id, pev_viewmodel2, super_knife_v_model );
	}
}
public FurienShop ( id ) {
	
	if(is_user_alive(id)) {
		
		fm_strip_user_weapons ( id )
		fm_give_item(id, "weapon_knife")
		
		if (get_user_team(id) == 1 ) {
			
			set_task( 0.1, "ShowFurien", id );
		}
		
		if (get_user_team (id ) == 2 ) {
			
			set_task( 0.1, "ShowAntiFurien", id );
		}
	}
}
public ShowAntiFurien(id, level, cid) {   
	
	new menu = menu_create( "\r Credite\w Shop", "antifurienhandler");
	menu_additem(menu, "HP + AP - \r6 \yCredite", "1", 0);
	menu_additem(menu, "Defuse Kit - \r2 \yCredite", "2", 0 );
	menu_additem(menu, "50 HP - \r2 \yCredite", "3", 0);
	menu_additem(menu, "50 AP - \r2 \yCredite", "4", 0);
	menu_additem(menu, "He Grenade - \r6 \yCredite", "5", 0);
	menu_additem(menu, "Flash Grenade - \r7 \yCredite", "6", 0);
	menu_additem(menu, "Defuse Kit - \r6 \yCredite", "7", 0);
	
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, menu, 0);
	
}
public ShowFurien(id, level, cid) {    
	
	new menu = menu_create( "\r Credite\w Shop", "furienhandler");
	menu_additem(menu, "SuperKnife - \r5 \yCredite", "1", 0);
	menu_additem(menu, "HE Grenade - \r3 \yCredite", "2", 0 );
	menu_additem(menu, "50 HP - \r2 \yCredite", "3", 0);
	menu_additem(menu, "50 AP - \r2 \yCredite", "4", 0);
	
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, menu, 0);
	
}

public furienhandler(id, menu, item, level, cid) {
	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:
		{
			new iCredits = fcs_get_user_credits ( id ) - 5;
			if( iCredits < 0 )
			{
				ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
				return 1;
				
			}
			else
			{ 
				super_knife[ id ] = true;
				CurrentWeapon( id );
				
				fcs_set_user_credits( id, iCredits );
				return 1;
			}
		}
		
		case 2:
		{
			new iCredits = fcs_get_user_credits ( id ) - 3;
			if( iCredits < 0 )
			{
				ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
				return 1;
				
			}
			else
			{
				give_item( id, "weapon_hegrenade" );
				fcs_set_user_credits( id, iCredits );
				return 1;
			}
		} 
		
		case 3:
		{
			new iCredits = fcs_get_user_credits ( id ) - 2;
			if( iCredits < 0 )
			{
				ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
				return 1;
				
			}
			else
			{
				new Health = get_user_health ( id );
				if( Health <= 100 )
				{
					fm_set_user_health( id, get_user_health ( id ) + 50 );
					fcs_set_user_credits( id, iCredits );
					return 1;
				}
				
				if( Health > 100 ) {
					
					ColorChat( id, GREEN, "[Furien]^x01 Trebuie sa ai mai putin de^x03 100 HP^x01 sa poti cumpara inca 50 hp" );
					return 1;
				}
			}
		}
		
		case 4:
		{
			new iCredits = fcs_get_user_credits ( id ) - 2;
			if( iCredits < 0 )
			{
				ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
				return 1;
				
			}
			else
			{
				new Armor = get_user_armor ( id );
				if ( Armor <= 100 ) {
					fm_set_user_armor( id, get_user_armor ( id ) + 50 );
					fcs_set_user_credits ( id, iCredits );
					return 1;
				}
				
				if ( Armor > 100 ) {
					
					ColorChat( id, GREEN, "[Furien]^x01 Trebuie sa ai mai putin de^4 100 AP^x01 sa poti cumpara inca 50 AP" );
					return 1;
				}
			}
		}
	}
	menu_destroy(menu);
	return 1;
}

public antifurienhandler(id, menu, item, level, cid) {
	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:
		{
			new iCredits = fcs_get_user_credits ( id ) - 6;
			if( iCredits < 0 )
			{
				ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
				return 1;
				
			}
			else
			{ 
				new Health = get_user_health ( id );
				
				if ( Health <= 100 )
				{
					fm_set_user_health ( id, get_user_health ( id ) + 80 );
				}
				
				new Armor = get_user_armor ( id );
				
				if ( Armor <= 100 )
				{
					fm_set_user_armor( id, get_user_armor ( id ) + 80 );
				}
				
				fcs_set_user_credits ( id, iCredits );
				return 1;
			}
		}  
		
		case 2:
		{
			new iCredits = fcs_get_user_credits ( id ) - 2;
			if( iCredits < 0 )
			{
				ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
				return 1;
				
			}
			else
			{ 
				fm_give_item ( id, "item_thighpack" )
				fcs_set_user_credits ( id, iCredits );
				return 1;
			}
		}
		
		case 3:
		{
			new iCredits = fcs_get_user_credits ( id ) - 2;
			if( iCredits < 0 )
			{
				ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
				return 1;
				
			}
			else
			{
				new Health = get_user_health ( id );
				if ( Health <= 100 ) {
					fm_set_user_health ( id, get_user_health ( id ) + 50 );
					fcs_set_user_credits ( id, iCredits );
					return 1;
				}
				
				if ( Health > 100 ) {
					
					ColorChat ( id, GREEN, "[Furien]^x01 Trebuie sa ai mai putin de^x03 100 HP^x01 sa poti cumpara inca 50 HP" );
					return 1;
				}
			}
		}
		
		case 4:
		{
			new iCredits = fcs_get_user_credits ( id ) - 2;
			if( iCredits < 0 )
			{
				ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
				return 1;
				
			}
			else
			{
				new Armor = get_user_armor ( id );
				if ( Armor <= 100 ) {
					fm_set_user_armor( id, get_user_armor ( id ) + 50 );
					fcs_set_user_credits ( id, iCredits );
					return 1;
				}
				
				if ( Armor > 100 ) {
					
					ColorChat( id, GREEN, "[Furien]^x01 Trebuie sa ai mai putin de ^4 100 AP^x01 sa poti cumpara inca 50 AP" );
					return 1;
				}
			}
		}
		
		case 5:
		{
			new iCredits = fcs_get_user_credits ( id ) - 6;
			if( iCredits < 0 )
			{
				ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
				return 1;
				
			}
			else
			{ 
				fm_give_item ( id, "weapon_hegrenade" )
				fcs_set_user_credits ( id, iCredits );
				return 1;
			}
		}
		case 6:
		{
			new iCredits = fcs_get_user_credits ( id ) - 7;
			if( iCredits < 0 )
			{
				ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
				return 1;
				
			}
			else
			{ 
				fm_give_item ( id, "weapon_flashbang" )
				fcs_set_user_credits ( id, iCredits );
				return 1;
			}
		}
		case 7:
		{
			new iCredits = fcs_get_user_credits ( id ) - 7;
			if( iCredits < 0 )
			{
				ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
				return 1;
				
			}
			else
			{ 
				fm_give_item ( id, "item_thighpack" );
				fcs_set_user_credits ( id, iCredits );
				return 1;
			}
		}
		
	}
	menu_destroy(menu);
	return 1;
}

public Player_TakeDamage ( iVictim, iInflictor, iAttacker, Float:fDamage, iDamageBits )
{
	if( iInflictor == iAttacker && super_knife [ 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 fcs_add_user_credits(client, credits)
{
	return fcs_set_user_credits(client, fcs_get_user_credits(client) + credits);
}

stock fcs_sub_user_credits(client, credits)
{
	return fcs_set_user_credits(client, fcs_get_user_credits(client) - credits);
}
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 8 guests