Page 1 of 1

Cerere plugin Weapons Furien

Posted: 04 Jul 2014, 22:43
by SpaZ-
Descriere Plugin : as vrea un plugin pentru serverul meu de furien.... Un meniu la care cand iti da spawn sa apara Primari weapons sa iti alegi pistolul si dupa ce ti-ai ales sa iti apara primary weapons adica m4a1.. si toate celelalte ! + sa iti dea la fiecare runda 1 HE + 2 flash la Furien si anti furieni !
Daca puteti sa faceti sa dea un deagle din prima si doar sa iti alegi arma ar fi bine dar ! FIECARE ARMA SA aibe 200 GL :)
Alte informatii : am cautat pe tot locul plugin dar am gasit doar asta.. dar nu are gl 200 si la nume meniu apare XX ... l-am luat depe alien ala..

am modificat eu pluginul tot.. imi merge bine fiecare arma 200 gl dar Deagleu.. nu are decat 7 gl ! va rog sa modificati..

e cel original sma

Code: Select all

#include <amxmodx> 
#include <cstrike> 
#include <fun> 
#include <amxmisc>  
#include <hamsandwich> 


#define PLUGIN    "Armas"  
#define AUTHOR    "SpEeD"  
#define VERSION    "1.0"  

public plugin_init() 
{ 
    register_plugin("Furiens Weapons", "1.0", "SpEeD'") 
    
    //Hamsandwich 
    RegisterHam(Ham_Spawn, "player", "Player_Spawn", 1) 
} 

public Player_Spawn(id) 
{ 
    if(is_user_alive(id)) 
    { 
        new CsTeams:team = cs_get_user_team(id) 
        switch(team) 
        { 
            case CS_TEAM_T: 
            { 
                strip_user_weapons(id) 
                give_item(id, "weapon_knife") 
                give_item(id, "weapon_hegrenade") //<---- 1 He grenade 
                
                give_item(id, "weapon_flashbang") //<---- 1. flash grenade 
                give_item(id, "weapon_flashbang") //<---- 2. flash grenade 
            } 
            case CS_TEAM_CT: 
            { 
                strip_user_weapons(id) 
                give_item(id, "weapon_deagle") 
                give_item(id, "weapon_hegrenade") //<---- 1 He grenade 
                give_item(id, "weapon_flashbang") //<---- 1. flash grenade 
                give_item(id, "weapon_flashbang") //<---- 2. flash grenade
                give_item(id, "weapon_knife") 
                new menu = menu_create("XX", "menu_handler");  
                
                menu_additem(menu, "AK47", "1", 0);  
                menu_additem(menu, "M4A1", "2", 0);  
                menu_additem(menu, "MP5 Navy", "3", 0);  
                menu_additem(menu, "XM1014", "4", 0);   
                menu_additem(menu, "M3", "5", 0);  
                menu_additem(menu, "AWP ", "6", 0);  
                
                menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);  
                
                menu_display(id, menu, 0);  
                
            }
        }
    }  
}
public menu_handler(id, menu, item)  
{  
    if( item == MENU_EXIT )  
    {  
        menu_destroy(menu);  
        return PLUGIN_HANDLED;  
    }  
    new data[6], iName[64];  
    new access, callback;  
    menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);  
    new key = str_to_num(data);  
    
    switch(key)  
    {  
        case 1:  
        {  
            give_item(id, "weapon_ak47")  
            
            cs_set_user_bpammo(id,CSW_AK47,90)    
            
        }  
        case 2:  
        {  
            give_item(id, "weapon_m4a1")  
            
            cs_set_user_bpammo(id,CSW_M4A1,90)    
            
        }  
        case 3:   
        {  
            give_item(id, "weapon_mp5navy")  
            
            cs_set_user_bpammo(id,CSW_MP5NAVY,120)    
            
        }  
        case 4:   
        {  
            give_item(id, "weapon_xm1014")  
            
            cs_set_user_bpammo(id,CSW_XM1014,32)    
            
        }  
        case 5:   
        {  
            
            give_item(id, "weapon_m3")  
            
            cs_set_user_bpammo(id,CSW_M3,32)    
            
        }  
        case 6:   
        {  
            give_item(id, "weapon_awp")  
            
            
            cs_set_user_bpammo(id,CSW_AWP,35)   
        }  
    }  
    
    
    
    menu_destroy(menu);  
    return PLUGIN_HANDLED;  
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang2070\\ f0\\ fs16 \n\\ par }
*/

Re: Cerere plugin Weapons Furien

Posted: 05 Jul 2014, 00:08
by levin
| Afiseaza codul
#include <amxmodx> 
#include <cstrike> 
#include <fun> 
#include <amxmisc>  
#include <hamsandwich> 


#define PLUGIN    "Armas"  
#define AUTHOR    "SpEeD"  
#define VERSION    "1.0"  

public plugin_init() 
{ 
    register_plugin("Furiens Weapons", "1.0", "SpEeD'") 
    
    //Hamsandwich 
    RegisterHam(Ham_Spawn, "player", "Player_Spawn", 1) 
} 

public Player_Spawn(id) 
{ 
    if(is_user_alive(id)) 
    { 
        new CsTeams:team = cs_get_user_team(id) 
        switch(team) 
        { 
            case CS_TEAM_T: 
            { 
                strip_user_weapons(id) 
                give_item(id, "weapon_knife") 
                give_item(id, "weapon_hegrenade") //<---- 1 He grenade 
                
                give_item(id, "weapon_flashbang") //<---- 1. flash grenade 
                give_item(id, "weapon_flashbang") //<---- 2. flash grenade 
            } 
            case CS_TEAM_CT: 
            { 
                strip_user_weapons(id) 
                give_item(id, "weapon_deagle") 
		cs_set_user_bpammo ( id , CSW_DEAGLE, 200 );
                give_item(id, "weapon_hegrenade") //<---- 1 He grenade 
                give_item(id, "weapon_flashbang") //<---- 1. flash grenade 
                give_item(id, "weapon_flashbang") //<---- 2. flash grenade
                give_item(id, "weapon_knife") 
                new menu = menu_create("XX", "menu_handler");  
                
                menu_additem(menu, "AK47", "1", 0);  
                menu_additem(menu, "M4A1", "2", 0);  
                menu_additem(menu, "MP5 Navy", "3", 0);  
                menu_additem(menu, "XM1014", "4", 0);   
                menu_additem(menu, "M3", "5", 0);  
                menu_additem(menu, "AWP ", "6", 0);  
                
                menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);  
                
                menu_display(id, menu, 0);  
                
            }
        }
    }  
}
public menu_handler(id, menu, item)  
{  
    if( item == MENU_EXIT )  
    {  
        menu_destroy(menu);  
        return PLUGIN_HANDLED;  
    }  
    new data[6], iName[64];  
    new access, callback;  
    menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);  
    new key = str_to_num(data);  
    
    switch(key)  
    {  
        case 1:  
        {  
            give_item(id, "weapon_ak47")  
            
            cs_set_user_bpammo(id,CSW_AK47,90)    
            
        }  
        case 2:  
        {  
            give_item(id, "weapon_m4a1")  
            
            cs_set_user_bpammo(id,CSW_M4A1,90)    
            
        }  
        case 3:   
        {  
            give_item(id, "weapon_mp5navy")  
            
            cs_set_user_bpammo(id,CSW_MP5NAVY,120)    
            
        }  
        case 4:   
        {  
            give_item(id, "weapon_xm1014")  
            
            cs_set_user_bpammo(id,CSW_XM1014,32)    
            
        }  
        case 5:   
        {  
            
            give_item(id, "weapon_m3")  
            
            cs_set_user_bpammo(id,CSW_M3,32)    
            
        }  
        case 6:   
        {  
            give_item(id, "weapon_awp")  
            
            
            cs_set_user_bpammo(id,CSW_AWP,35)   
        }  
    }  
    
    
    
    menu_destroy(menu);  
    return PLUGIN_HANDLED;  
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang2070\\ f0\\ fs16 \n\\ par }
*/

Re: Cerere plugin Weapons Furien

Posted: 05 Jul 2014, 12:46
by SpaZ-
Rezolvat ! Mersi mult

Re: Cerere plugin Weapons Furien

Posted: 05 Jul 2014, 12:47
by First Time
Iti recomand sa bagi meniul acesta! ca in meniul de mai sus daca un ct nu a ales arma si daca devil Tero(Furien) o sa-si poate lua o arma! Furien cu arma nu e deloc interesant!
sursa | Afiseaza codul
/* Plugin generated by AMXX-Studio */

/*
   Credits:

      The YONTU - Code Optimized
      scosmynnnn - Ideea pentru a trimite un task 0.1 la Spawn
*/

#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
#include <fun>

new const PLUGIN[] = "Furien: Anti-Furien Weapons Menu";
new const VERSION[] = "1.3b";

#pragma semicolon 1

new bool: HaveChoosenWeap[33];

public plugin_init()
{
   register_plugin(PLUGIN, VERSION, "Adventx");
   
   register_clcmd("say /gun","SayWeapons");
   register_clcmd("say guns","SayWeapons");
   register_clcmd("say arme","SayWeapons");
   
   RegisterHam(Ham_Spawn, "player", "hamPlayerSpawnPost", 1);
}

public hamPlayerSpawnPost(id)
{
   if(is_user_alive(id) && get_user_team(id) == 1)
   {
      strip_user_weapons(id); 
      set_task(0.1, "FurienItem",id);
   }
   
   if(is_user_alive(id) && get_user_team(id) == 2)
   {
      ShowMenuWeap(id);
      strip_user_weapons(id);
      HaveChoosenWeap[id] = false;
      set_task(0.1, "AntiFurienItem",id);   
   }
}

public FurienItem(id)
{
   give_item(id, "weapon_knife");
   give_item(id, "weapon_hegrenade");
   give_item(id, "weapon_flashbang");
   give_item(id, "weapon_smokegrenade");
}

public AntiFurienItem(id)
{
   give_item(id, "weapon_knife");
   give_item(id, "weapon_deagle");
   give_item(id, "weapon_flashbang");
   give_item(id, "weapon_smokegrenade");
   cs_set_user_bpammo(id, CSW_DEAGLE,250);
}

public ShowMenuWeap(id)
{
   new szMenu = menu_create("Anti-Furien Gun Menu:","AntiFurienWeap");
   
   menu_additem(szMenu, "M4a1","1");
   menu_additem(szMenu, "Ak47","2");
   menu_additem(szMenu, "MP5","3");
   menu_additem(szMenu, "Famas","4");
   menu_additem(szMenu, "Galil","5");
   menu_additem(szMenu, "P90","6");
   
   menu_setprop(szMenu, MPROP_EXIT, MEXIT_ALL);
   menu_display(id, szMenu, 0);
   
   return PLUGIN_HANDLED;
}

public AntiFurienWeap(id, szMenu, item)
{
   if(item == MENU_EXIT)
      return PLUGIN_HANDLED;
   
   if(get_user_team(id) != 2)
      return PLUGIN_HANDLED;
   
   new data [6], szName [64];
   new access, callback;
   menu_item_getinfo (szMenu, item, access, data,charsmax (data), szName,charsmax (szName), callback);
   new key = str_to_num (data);
   
   switch (key)
   {
      case 1:
      {
         HaveChoosenWeap[id] = true;
         give_item(id, "weapon_m4a1");
         cs_set_user_bpammo(id, CSW_M4A1,250);
      }
      
      case 2:
      {
         HaveChoosenWeap[id] = true;
         give_item(id, "weapon_ak47");
         cs_set_user_bpammo(id, CSW_AK47,250);
      }
      
      case 3:
      {
         HaveChoosenWeap[id] = true;
         give_item(id, "weapon_mp5navy");
         cs_set_user_bpammo(id, CSW_MP5NAVY,250);
      }
      
       case 4:
      {
         HaveChoosenWeap[id] = true;
         give_item(id, "weapon_famas");
         cs_set_user_bpammo(id, CSW_FAMAS,250);
      }
      
      case 5:
      {
         HaveChoosenWeap[id] = true;
         give_item(id, "weapon_galil");
         cs_set_user_bpammo(id, CSW_GALIL,250);
      }
      
      case 6:
      {
         HaveChoosenWeap[id] = true;
         give_item(id, "weapon_p90");
         cs_set_user_bpammo(id, CSW_P90,250);
      }
   }
   
   menu_destroy(szMenu);
   return PLUGIN_HANDLED;
}

public SayWeapons(id)
{
   if(get_user_team(id) == 2)
   {
      if(!is_user_alive(id))
      {
         ChatColor(id, "!g[Furien] !nNu poti selecta meniul daca esti mort!");
         return;
      }
      
      if(HaveChoosenWeap[id]==true)
      {
         ChatColor(id, "!g[Furien] !nAi selectat deja meniul runda aceasta!");
         return;
      }
      
      else
      {
         ShowMenuWeap(id);
      }
   }
}

stock ChatColor(const id, const input[], any:...)
{
   new count = 1, players[32];
   static msg[191];
   vformat(msg, 190, input, 3);
   
   replace_all(msg, 190, "!g", "^4"); // Green Color
   replace_all(msg, 190, "!n", "^1"); // Default Color
   replace_all(msg, 190, "!t", "^3"); // Team Color
   replace_all(msg, 190, "!t2", "^0"); // Team2 Color
   
   if (id) players[0] = id; else get_players(players, count, "ch"); {
      for (new i = 0; i < count; i++) {
         if (is_user_connected(players)) {
            message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players);
            write_byte(players);
            write_string(msg);
            message_end();
         }
      }
   }
}

/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/

Re: Cerere plugin Weapons Furien

Posted: 05 Jul 2014, 15:14
by SpaZ-
modifical asta ca mi l-am configurat sa imi dea ce imi trb la fiecare..
da am vazut ca da la furien arma.. daca las meniu

Code: Select all

#include <amxmodx> 
#include <cstrike> 
#include <fun> 
#include <amxmisc>  
#include <hamsandwich> 


#define PLUGIN    "Armas"  
#define AUTHOR    "SpEeD"  
#define VERSION    "1.0"  

public plugin_init() 
{ 
    register_plugin("Furiens Weapons", "1.0", "SpEeD'") 
    
    //Hamsandwich 
    RegisterHam(Ham_Spawn, "player", "Player_Spawn", 1) 
} 

public Player_Spawn(id) 
{ 
    if(is_user_alive(id)) 
    { 
        new CsTeams:team = cs_get_user_team(id) 
        switch(team) 
        { 
            case CS_TEAM_T: 
            { 
                strip_user_weapons(id) 
                give_item(id, "weapon_knife")
                give_item(id, "weapon_hegrenade") //<---- 1. he grenade               
                give_item(id, "weapon_flashbang") //<---- 1. flash grenade 
                give_item(id, "weapon_flashbang") //<---- 2. flash grenade 
            } 
            case CS_TEAM_CT: 
            { 
                strip_user_weapons(id) 
                give_item(id, "weapon_deagle") 
		cs_set_user_bpammo ( id , CSW_DEAGLE, 200 );
                give_item(id, "weapon_flashbang") //<---- 1. flash grenade 
                give_item(id, "weapon_flashbang") //<---- 2. flash grenade
                give_item(id, "weapon_knife") 
                new menu = menu_create("Weapons Menu Anti-Furien", "menu_handler");  
                
                menu_additem(menu, "AK47", "1", 0);  
                menu_additem(menu, "M4A1", "2", 0);  
                menu_additem(menu, "MP5 Navy", "3", 0);  
                menu_additem(menu, "XM1014", "4", 0);   
                menu_additem(menu, "M3", "5", 0);  
                menu_additem(menu, "AWP ", "6", 0);  
                
                menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);  
                
                menu_display(id, menu, 0);  
                
            }
        }
    }  
}
public menu_handler(id, menu, item)  
{  
    if( item == MENU_EXIT )  
    {  
        menu_destroy(menu);  
        return PLUGIN_HANDLED;  
    }  
    new data[6], iName[64];  
    new access, callback;  
    menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);  
    new key = str_to_num(data);  
    
    switch(key)  
    {  
        case 1:  
        {  
            give_item(id, "weapon_ak47")  
            
            cs_set_user_bpammo(id,CSW_AK47,200)    
            
        }  
        case 2:  
        {  
            give_item(id, "weapon_m4a1")  
            
            cs_set_user_bpammo(id,CSW_M4A1,200)    
            
        }  
        case 3:   
        {  
            give_item(id, "weapon_mp5navy")  
            
            cs_set_user_bpammo(id,CSW_MP5NAVY,200)    
            
        }  
        case 4:   
        {  
            give_item(id, "weapon_xm1014")  
            
            cs_set_user_bpammo(id,CSW_XM1014,200)    
            
        }  
        case 5:   
        {  
            
            give_item(id, "weapon_m3")  
            
            cs_set_user_bpammo(id,CSW_M3,200)    
            
        }  
        case 6:   
        {  
            give_item(id, "weapon_awp")  
            
            
            cs_set_user_bpammo(id,CSW_AWP,200)   
        }  
    }  
    
    
    
    menu_destroy(menu);  
    return PLUGIN_HANDLED;  
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang2070\\ f0\\ fs16 \n\\ par }
*/

Re: Cerere plugin Weapons Furien

Posted: 05 Jul 2014, 15:52
by levin
Urat plugin
| Afiseaza codul
#include <amxmodx> 
#include <cstrike> 
#include <fun> 
#include <amxmisc>  
#include <hamsandwich> 

#define PLUGIN    "Armas"  
#define AUTHOR    "SpEeD"  
#define VERSION    "1.0"

new gMenu;

public plugin_init() 
{ 
    register_plugin("Furiens Weapons", "1.0", "SpEeD'") 
    
    //Hamsandwich 
    RegisterHam(Ham_Spawn, "player", "Player_Spawn", 1) 
} 

public Player_Spawn(id) 
{ 
    if(is_user_alive(id)) 
    { 
        new CsTeams:team = cs_get_user_team(id) 
        switch(team) 
        { 
            case CS_TEAM_T: 
            { 
                strip_user_weapons(id) 
                give_item(id, "weapon_knife")
                give_item(id, "weapon_hegrenade") //<---- 1. he grenade               
                give_item(id, "weapon_flashbang") //<---- 1. flash grenade 
                give_item(id, "weapon_flashbang") //<---- 2. flash grenade 
            } 
            case CS_TEAM_CT: 
            { 
                strip_user_weapons(id) 
                give_item(id, "weapon_deagle") 
		cs_set_user_bpammo ( id , CSW_DEAGLE, 200 );
                give_item(id, "weapon_flashbang") //<---- 1. flash grenade 
                give_item(id, "weapon_flashbang") //<---- 2. flash grenade
                give_item(id, "weapon_knife")

                set_task( 0.5, "menu", id );
            }
        }
    }  
}
public menu( )
{
	gMenu = menu_create( "\r[\yMENU\r] \d- Weapons \y[\r Anti-Furien \y]", "thisContent" );

	menu_additem( gMenu, "AK47", "1" );
	menu_additem( gMenu, "M4A1", "2" );
	menu_additem( gMenu, "MP5 Navy", "3" );
	menu_additem( gMenu, "XM1014", "4" );
	menu_additem( gMenu, "M3", "5" );
	menu_additem( gMenu, "AWP", "6" );

	menu_setprop( gMenu, MPROP_EXIT, MEXIT_ALL );

	menu_display( id, gMenu );

	return 1;
}

public thisContent( id, Menu, Item )
{
	if( Item < 0 )
	{
		return 0;
	}

	new Key[ 3 ];
	new Access, CallBack;

	menu_item_getinfo( Menu, Item, Access, Key, 2, _, _, CallBack );

	new isKey = str_to_num( Key );

	switch( isKey )
	{
		case 1:
		{
			give_item(id, "weapon_ak47")  
			cs_set_user_bpammo(id,CSW_AK47,200)    
            
		}  

		case 2:  
		{  
			give_item(id, "weapon_m4a1")
            		cs_set_user_bpammo(id,CSW_M4A1,200)
		}  

		case 3:
		{
			give_item(id, "weapon_mp5navy")
			cs_set_user_bpammo(id,CSW_MP5NAVY,200)
		}

		case 4:
		{
			give_item(id, "weapon_xm1014")
			cs_set_user_bpammo(id,CSW_XM1014,200)
		}

		case 5:
		{
			give_item(id, "weapon_m3")
			cs_set_user_bpammo(id,CSW_M3,200)
            
		}

		case 6:
		{
			give_item(id, "weapon_awp")
			cs_set_user_bpammo(id,CSW_AWP,200)
		}
	}
	return 1;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang2070\\ f0\\ fs16 \n\\ par }
*/

Re: Cerere plugin Weapons Furien

Posted: 05 Jul 2014, 16:06
by SpaZ-
e plin de erori cand il copilez

Re: Cerere plugin Weapons Furien

Posted: 05 Jul 2014, 16:10
by Gabriel eXtream
Foloseste asta si gata
| Afiseaza codul
#include <  amxmodx  >
#include <  cstrike  >
#include <  engine  >
#include <  hamsandwich  >
#include <  fun  >
#include <  ColorChat  >

#pragma semicolon 1


#define PLUGIN "FMU Weapons Menu"
#define VERSION "1.0"



// Null ( do not modify )
#define 	NULL			0

// Max number of secondary weapons ( Pistols.. ).Do not modify.
#define		MAX_SECONDARY		7



// These determine if these secondary weapons ( Pistols.. ) should be enabled or disabled.
// 1 = enabled
// 0 = disabled

#define		ENABLE_USP		1
#define		ENABLE_GLOCK		1
#define		ENABLE_DEAGLE		1
#define		ENABLE_P228		1
#define		ENABLE_ELITE		1
#define		ENABLE_FIVESEVEN	1




// Max number of primary weapons ( Guns.. ).Do not modify.
#define 	MAX_PRIMARY		19


// These determine if these primary weapons ( Guns.. ) should be enabled or disabled.
// 1 = enabled
// 0 = disabled

#define		ENABLE_M4A1		1
#define		ENABLE_AK47		1
#define		ENABLE_AUG		1
#define		ENABLE_SG552		1
#define		ENABLE_GALIL		1
#define		ENABLE_FAMAS		1
#define		ENABLE_SCOUT		1
#define		ENABLE_AWP		1
#define		ENABLE_SG550		1
#define		ENABLE_M249		0
#define		ENABLE_G3SG1		1
#define		ENABLE_UMP45		1
#define		ENABLE_MP5NAVY		1
#define		ENABLE_M3		1
#define		ENABLE_XM1014		1
#define		ENABLE_TMP		1
#define		ENABLE_MAC10		1
#define		ENABLE_P90		1



// Max number of Grenades .Do not modify.
#define 	MAX_NADES		5


// These determine if these grenades should be enabled or disabled.
// 1 = enabled
// 0 = disabled

#define		ENABLE_FURIEN_NADES		1


#define		ENABLE_FURIEN_HE		1
#define		ENABLE_FURIEN_FLASHBANG1	1
#define		ENABLE_FURIEN_FLASHBANG2	0
#define		ENABLE_FURIEN_SMOKEGRENADE	0



#define		ENABLE_ANTIFURIEN_NADES		1


#define		ENABLE_ANTIFURIEN_HE		0
#define		ENABLE_ANTIFURIEN_FLASHBANG1	0
#define		ENABLE_ANTIFURIEN_FLASHBANG2	1
#define		ENABLE_ANTIFURIEN_SMOKEGRENADE	1


/*======================================= - | Askhanar | - =======================================*/

new const gSecondaryWeaponsEnabled[  MAX_SECONDARY  ]  =
{
	
	NULL,
	ENABLE_USP,
	ENABLE_GLOCK,
	ENABLE_DEAGLE,
	ENABLE_P228,
	ENABLE_ELITE,
	ENABLE_FIVESEVEN
	
};

/*======================================= - | Askhanar | - =======================================*/

new const gSecondaryWeaponsName[  MAX_SECONDARY  ][    ]  =
{
	
	"",
	"USP",
	"Glock",
	"Deagle",
	"P228",
	"Elite",
	"Five Seven"
	
};

/*======================================= - | Askhanar | - =======================================*/

new const gSecondaryWeaponsItemName[  MAX_SECONDARY  ][    ]  =
{
	
	"",
	"weapon_usp",
	"weapon_glock18",
	"weapon_deagle",
	"weapon_p228",
	"weapon_elite",
	"weapon_fiveseven"
	
};

/*======================================= - | Askhanar | - =======================================*/

new const gSecondaryWeaponsItemNum[  MAX_SECONDARY  ]  =
{
	
	NULL,
	CSW_USP,
	CSW_GLOCK18,
	CSW_DEAGLE,
	CSW_P228,
	CSW_ELITE,
	CSW_FIVESEVEN
	
};

/*======================================= - | Askhanar | - =======================================*/

new const gSecondaryWeaponsMaxClip[  MAX_SECONDARY  ]  =
{
	NULL,
	12,
	20,
	7,
	13,
	30,
	20
	
};

/*======================================= - | Askhanar | - =======================================*/

new const gSecondaryWeaponsMaxAmmo[  MAX_SECONDARY  ]  =
{
	NULL,
	100,
	120,
	35,
	52,
	120,
	100
	
};

/*======================================= - | Askhanar | - =======================================*/

new const gPrimaryWeaponsEnabled[  MAX_PRIMARY  ]  =
{
	
	NULL,
	ENABLE_M4A1,
	ENABLE_AK47,
	ENABLE_AUG,
	ENABLE_SG552,
	ENABLE_GALIL,
	ENABLE_FAMAS,
	ENABLE_SCOUT,
	ENABLE_AWP,
	ENABLE_SG550,
	ENABLE_M249,
	ENABLE_G3SG1,
	ENABLE_UMP45,
	ENABLE_MP5NAVY,
	ENABLE_M3,
	ENABLE_XM1014,
	ENABLE_TMP,
	ENABLE_MAC10,
	ENABLE_P90
	
};

/*======================================= - | Askhanar | - =======================================*/

new const gPrimaryWeaponsName[  MAX_PRIMARY  ][    ]  =
{
	
	"",
	"M4A1",
	"AK47",
	"AUG",
	"SG552",
	"Galil",
	"Famas",
	"Scout",
	"AWP",
	"SG550",
	"M249",
	"G3SG1",
	"UMP 45",
	"MP5 Navy",
	"M3",
	"XM1014",
	"TMP",
	"Mac 10",
	"P90"
	
};

/*======================================= - | Askhanar | - =======================================*/

new const gPrimaryWeaponsItemName[  MAX_PRIMARY  ][    ]  =
{
	
	"",
	"weapon_m4a1",
	"weapon_ak47",
	"weapon_aug",
	"weapon_sg552",
	"weapon_galil",
	"weapon_famas",
	"weapon_scout",
	"weapon_awp",
	"weapon_sg550",
	"weapon_m249",
	"weapon_g3sg1",
	"weapon_ump45",
	"weapon_mp5navy",
	"weapon_m3",
	"weapon_xm1014",
	"weapon_tmp",
	"weapon_mac10",
	"weapon_p90"
	
};

/*======================================= - | Askhanar | - =======================================*/

new const gPrimaryWeaponsItemNum[  MAX_PRIMARY  ]  =
{
	
	NULL,
	CSW_M4A1,
	CSW_AK47,
	CSW_AUG,
	CSW_SG552,
	CSW_GALIL,
	CSW_FAMAS,
	CSW_SCOUT,
	CSW_AWP,
	CSW_SG550,
	CSW_M249,
	CSW_G3SG1,
	CSW_UMP45,
	CSW_MP5NAVY,
	CSW_M3,
	CSW_XM1014,
	CSW_TMP,
	CSW_MAC10,
	CSW_P90
	
};

/*======================================= - | Askhanar | - =======================================*/

new const gPrimaryWeaponsMaxClip[  MAX_PRIMARY  ]  =
{
	
	NULL,
	30,
	30,
	30,
	30,
	35,
	25,
	10,
	10,
	30,
	100,
	20,
	25,
	30,
	8,
	7,
	30,
	30,
	50
	
};

/*======================================= - | Askhanar | - =======================================*/

new const gPrimaryWeaponsMaxAmmo[  MAX_PRIMARY  ]  =
{
	
	NULL,
	200,
	200,
	200,
	200,
	200,
	200,
	200,
	200,
	200,
	200,
	200,
	200,
	200,
	200,
	200,
	200,
	200,
	200,
	
};

/*======================================= - | Askhanar | - =======================================*/

new const gGrenadesEnabled[  CsTeams  ]  =
{
	
	NULL,
	ENABLE_FURIEN_NADES,
	ENABLE_ANTIFURIEN_NADES,
	NULL
	
};

new const gFurienNadeEnabled[  MAX_NADES  ]  =
{
	
	NULL,
	ENABLE_FURIEN_HE,
	ENABLE_FURIEN_FLASHBANG1,
	ENABLE_FURIEN_FLASHBANG2,
	ENABLE_FURIEN_SMOKEGRENADE
	
};

new const gAntiFurienNadeEnabled[  MAX_NADES  ]  =
{
	
	NULL,
	ENABLE_ANTIFURIEN_HE,
	ENABLE_ANTIFURIEN_FLASHBANG1,
	ENABLE_ANTIFURIEN_FLASHBANG2,
	ENABLE_ANTIFURIEN_SMOKEGRENADE
	
};

/*======================================= - | Askhanar | - =======================================*/

new const gGrenadesItemName[  MAX_NADES  ][    ]  =
{
	
	"",
	"weapon_hegrenade",
	"weapon_flashbang",
	"weapon_flashbang",
	"weapon_smokegrenade"
	
};

/*======================================= - | Askhanar | - =======================================*/

new gUserLastSecondaryWeapons[  33  ];
new gUserLastPrimaryWeapons[  33  ];

/*======================================= - | Askhanar | - =======================================*/

public plugin_init(    )
{
	register_plugin(  PLUGIN,  VERSION,  "Askhanar"  );
	
	register_clcmd(  "say /weapons", "ClCmdSayWeapons"  );
	
	RegisterHam(  Ham_Spawn,  "player",  "Ham_PlayerSpawnPost",  true  );
	
}

/*======================================= - | Askhanar | - =======================================*/

public client_putinserver(  id  )
{
	
	if(  is_user_bot(  id  )  ||  is_user_hltv(  id  )  )  return 0;
	
	gUserLastSecondaryWeapons[  id  ]  =  0;
	gUserLastPrimaryWeapons[  id  ]  =  0;
		
	return 0;
}

/*======================================= - | Askhanar | - =======================================*/

public client_disconnect(  id  )
{
		
	if(  is_user_bot(  id  )  ||  is_user_hltv(  id  )  )  return 0;
	
	gUserLastSecondaryWeapons[  id  ]  =  0;
	gUserLastPrimaryWeapons[  id  ]  =  0;
		
	return 0;
}

/*======================================= - | Askhanar | - =======================================*/

public ClCmdSayWeapons(  id  )
{
	if(  !IsUserAntiFurien(  id  )  ||  !is_user_alive(  id  )  )  return 1;
	
	if(  UserHasNoWeapon(  id  )  )
	{
		ShowWeaponsMenu(  id  );
		return 0;
	}
	else
	{
		ColorChat(  id,  RED, "^x04[Furien Ultimate]^x03 Ti-ai ales deja armele !"  );
		return 1;
	}
	
	return 0;
}
	
/*======================================= - | Askhanar | - =======================================*/

public Ham_PlayerSpawnPost(  id  )
{
	if( is_user_alive(  id  )  && !is_user_bot(  id  )  &&  !is_user_hltv(  id  )  )
	{
		
		new CsTeams:Team  =  cs_get_user_team(  id  );
		if( Team  ==  CS_TEAM_T  ||  Team  ==  CS_TEAM_CT  )
		{
			
			if(  Team  == CS_TEAM_CT  )	ShowWeaponsMenu(  id  );
			
			if(  gGrenadesEnabled[  Team  ]  )
			{
				switch(  Team  )
				{
					case CS_TEAM_T:
					{
						for(  new  i  = 1;  i  <  MAX_NADES;  i++  )
						{
							if(  gFurienNadeEnabled[  i  ]  )
							{
								give_item(  id,  gGrenadesItemName[  i  ]  );
							}
						}
					}
					case CS_TEAM_CT:
					{
						for(  new  i  = 1;  i  <  MAX_NADES;  i++  )
						{
							if(  gAntiFurienNadeEnabled[  i  ]  )
							{
								give_item(  id,  gGrenadesItemName[  i  ]  );
							}
						}
					}
				}
			}
		}
	}
	
	return HAM_IGNORED;
}

/*======================================= - | Askhanar | - =======================================*/

public ShowWeaponsMenu(  id  )
{
	new menu = menu_create(  "\rAntiFurien:\y Equip", "WeaponsMenuHandler" );	
	
	menu_additem(  menu,  "New Weapons",  "1", 0  );
	menu_additem(  menu,  "Previous Setup",  "2", 0  );
	
	menu_setprop( menu, MPROP_EXIT , MEXIT_NEVER );
	menu_display(  id,  menu,  0 );

}

/*======================================= - | Askhanar | - =======================================*/

public WeaponsMenuHandler(  id,  menu,  item  )
{
	
	new data[ 6 ], iName[ 64 ];
	new iaccess, callback;
	
	menu_item_getinfo(  menu,  item,  iaccess,  data,  5,  iName,  63,  callback );
	menu_destroy(  menu  );
	
	new key = str_to_num(  data  );
	
	switch(  key  )
	{
		case 1:
		{
			if(  IsUserAntiFurien(  id  )  )
			{
				ShowSecondaryWeaponsMenu(  id,  0  );
			}
			return 1;
		}
		case 2:
		{
			if(  IsUserAntiFurien(  id  )  )
			{
			
			
				if(  gUserLastPrimaryWeapons[  id  ]  <=  0  ||  gUserLastSecondaryWeapons[  id  ]  <=  0  )
				{
					ShowWeaponsMenu(  id  );
					ColorChat(  id,  RED, "^x04[Furien Ultimate]^x03 Prima data trebuie sa alegi armele!"  );
					return 1;
				}
				
				GiveWeaponAndSetClipAndAmmo(  id,  gSecondaryWeaponsItemName[  gUserLastSecondaryWeapons[  id  ]  ],  gSecondaryWeaponsItemNum[  gUserLastSecondaryWeapons[  id  ]  ],
						gSecondaryWeaponsMaxClip[  gUserLastSecondaryWeapons[  id  ]  ],  gSecondaryWeaponsMaxAmmo[  gUserLastSecondaryWeapons[  id  ]  ]  );
						
				GiveWeaponAndSetClipAndAmmo(  id,  gPrimaryWeaponsItemName[  gUserLastPrimaryWeapons[  id  ]  ],  gPrimaryWeaponsItemNum[  gUserLastPrimaryWeapons[  id  ]  ],
						gPrimaryWeaponsMaxClip[  gUserLastPrimaryWeapons[  id  ]  ],  gPrimaryWeaponsMaxAmmo[  gUserLastPrimaryWeapons[  id  ]  ]  );
				
				return 1;
			}
		}
	}
	
	return 1;
}

/*======================================= - | Askhanar | - =======================================*/

public ShowSecondaryWeaponsMenu(  id,  page  )
{
	new menu = menu_create(  "\rAntiFurien:\y Secondary Weapons", "SecondaryWeaponsMenuHandler" );	
	new callback = menu_makecallback(  "CallbackSecondaryWeapons"  );
	
	for(  new i = 1; i  <  MAX_SECONDARY;  i++  )
	{
		new  szMenuKey[  32  ];
		num_to_str(  i,  szMenuKey,  sizeof  (  szMenuKey  )  );
		
		menu_additem(  menu,  gSecondaryWeaponsName[  i  ],  szMenuKey,  _,  callback  );
	}
	
	menu_setprop( menu, MPROP_EXIT , MEXIT_NEVER );
	menu_display(  id,  menu,  page );

}

/*======================================= - | Askhanar | - =======================================*/

public SecondaryWeaponsMenuHandler(  id,  menu,  item  )
{
	
	new data[ 6 ], iName[ 64 ];
	new iaccess, callback;
	
	menu_item_getinfo(  menu,  item,  iaccess,  data,  5,  iName,  63,  callback );
	menu_destroy(  menu  );
	
	new key = str_to_num(  data  );
	
	if(  IsUserAntiFurien(  id  )  )
	{
			
		GiveWeaponAndSetClipAndAmmo(  id,  gSecondaryWeaponsItemName[  key  ],  gSecondaryWeaponsItemNum[  key  ],
						gSecondaryWeaponsMaxClip[  key  ],  gSecondaryWeaponsMaxAmmo[  key  ]  );
		
		gUserLastSecondaryWeapons[  id  ]  =  key;
		ShowPrimaryWeaponsMenu(  id,  0  );
	}
	
	return 1;
}

/*======================================= - | Askhanar | - =======================================*/

public CallbackSecondaryWeapons(  id,  menu,  item  )
{
	static  _access,  info[  4  ],  callback;
	menu_item_getinfo(  menu,  item,  _access,  info,  sizeof (  info  )  - 1,  _,  _,  callback  );
	
	if(  !gSecondaryWeaponsEnabled[  str_to_num(  info  )  ]  )  return ITEM_DISABLED;
	
	return ITEM_ENABLED;
}

/*======================================= - | Askhanar | - =======================================*/

public ShowPrimaryWeaponsMenu(  id,  page  )
{
	new menu = menu_create(  "\rAntiFurien:\y Primary Weapons", "PrimaryWeaponsMenuHandler" );	
	new callback = menu_makecallback(  "CallbackPrimaryWeapons"  );
	
	for(  new i = 1; i  <  MAX_PRIMARY;  i++  )
	{
		new  szMenuKey[  32  ];
		num_to_str(  i,  szMenuKey,  sizeof  (  szMenuKey  )  );
		
		menu_additem(  menu,  gPrimaryWeaponsName[  i  ],  szMenuKey,  _,  callback  );
	}
	
	menu_setprop( menu, MPROP_EXIT , MEXIT_NEVER );
	menu_display(  id,  menu,  page );

}

/*======================================= - | Askhanar | - =======================================*/

public PrimaryWeaponsMenuHandler(  id,  menu,  item  )
{
	
	new data[ 6 ], iName[ 64 ];
	new iaccess, callback;
	
	menu_item_getinfo(  menu,  item,  iaccess,  data,  5,  iName,  63,  callback  );
	menu_destroy(  menu  );
	
	new key = str_to_num( data );
	
	if(  IsUserAntiFurien(  id  )  )
	{
		GiveWeaponAndSetClipAndAmmo(  id,  gPrimaryWeaponsItemName[  key  ],  gPrimaryWeaponsItemNum[  key  ],
						gPrimaryWeaponsMaxClip[  key  ],  gPrimaryWeaponsMaxAmmo[  key  ]  );
		
		gUserLastPrimaryWeapons[  id  ]  =  key;
	
	}
	
	return 1;
}

/*======================================= - | Askhanar | - =======================================*/

public CallbackPrimaryWeapons(  id,  menu,  item  )
{
	static _access, info[4], callback;
	menu_item_getinfo(menu, item, _access, info, sizeof(info) - 1, _, _, callback);
	
	if(  !gPrimaryWeaponsEnabled[  str_to_num(  info  )  ]  )  return ITEM_DISABLED;
	
	return ITEM_ENABLED;
}

/*======================================= - | Askhanar | - =======================================*/

public GiveWeaponAndSetClipAndAmmo(  id,  const WeaponName[    ],  const WeaponId,  const WeaponMaxClip,  const WeaponMaxAmmo  )
{
	
	if( !is_user_alive(  id  )  )  return 1;
	
	give_item(  id,  WeaponName  );
	new WeapId  =  find_ent_by_owner(  -1,  WeaponName,  id  );
	
	if(  WeapId  )
	{
		cs_set_weapon_ammo(  WeapId, WeaponMaxClip  );
	} 
	
	if(  WeaponId  !=  0  )
		cs_set_user_bpammo(  id,  WeaponId,  WeaponMaxAmmo  );
	
	return 0;
	
}

/*======================================= - | Askhanar | - =======================================*/

stock bool:IsUserAntiFurien(  id  )
{
	if(  get_user_team(  id  )  ==  2  )
		return true;
		
	return false;
}

/*======================================= - | Askhanar | - =======================================*/

stock bool:UserHasNoWeapon(  id  )
{
	
	new bool:WeaponFound  =  false;
	
	for(  new i  =  1;  i <  MAX_PRIMARY ; i++  )
	{
		if( user_has_weapon(  id,  gPrimaryWeaponsItemNum[  i  ]  )  )
		{
			WeaponFound  =  true;
			break;
		}
	}
	
	for(  new i  =  1;  i <  MAX_SECONDARY; i++  )
	{
		if( user_has_weapon(  id,  gSecondaryWeaponsItemNum[  i  ]  )  )
		{
			WeaponFound  =  true;
			break;
		}
	}
	
	return WeaponFound  ?  false  :  true;
	
}		

/*======================================= - | Askhanar | - =======================================*/

Re: Cerere plugin Weapons Furien

Posted: 05 Jul 2014, 18:25
by SpaZ-
da dar eu nu vreau asta.. vreau acela care l-am lasat.. e greu sa il modifici sa nu mai arete la furien ?

Re: Cerere plugin Weapons Furien

Posted: 05 Jul 2014, 18:27
by Gabriel eXtream
Nu mai fi asa tare in gura, nu il arata la furien.

Re: Cerere plugin Weapons Furien

Posted: 05 Jul 2014, 20:10
by SpaZ-
Nu inteleg... daca sunteti asa mari scripter nu puteti modifica ? :D acel plugin care vi l-am lasat sa nu apara meniu la furien cand las meniu pornit si ma muta ?

Re: Cerere plugin Weapons Furien

Posted: 05 Jul 2014, 21:32
by levin
E plin de erori? Nu ai tu habar cum sa compilez. Sursa pe care ai lasat-o nici nu mergea compilata, am rezolvat-o + am adaugat ce iti mai trebuia :-j si ce chestie, mie imi compileaza perfect + nu a zis nimeni de aici ca e ' mare scripter ', nu te mai comporta ca si cum noi suntem obligati sa te ajutam.