Editare vip Biohazard

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
User avatar
[Bio]King
Membru, skill 0
Membru, skill 0
Posts: 26
Joined: 28 Nov 2015, 19:20
Detinator Steam: Da
CS Status: Fericit
Detinator server CS: Bio.Max-CS.Ro
Fond eXtream: 0
Location: Bio.*** Reclama ***
Contact:

18 Dec 2015, 11:43

Salut,am un plugin vip biohazard care are niste buguri.
1.Vreau ca "/vm" sa nu poata fii folosit de zombi.. (nici dupa infectie,exemplu:Sunt Human(ct) si dupa ce un zm m-a infectat sa nu mai am acces la /vm...
2.Bug la speed.Dupa ce cumpar speed..si schimb arma nu mai e.
3.Invizibilitate.. Sa fie cam 80% ( sa o cumpueri. acuma ti-o da direct..)
Tot ce cumpar din /vm e doar pentru Human.. sa nu poti cumpara cand esti mort,sau zombi..Cam atat.Daca se poate sa faceti o calasa de zombi pentru vip..
| Afiseaza codul
#include <amxmodx>
#include <fun>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta>
#include <engine>
#include <biohazard>
#pragma tabsize 0

#define ADMIN_ACCESS ADMIN_LEVEL_H
#define is_user(%1) (1 <= %1 <= maxPlayers)
#define HE_GRENADE	(1<<0)
#define SMOKE_GRENADE	(1<<1)
#define FLASH_GRENADE	(1<<2)

new gCvar_flags;
new bool:has_ammo[33]
new maxPlayers;

new speed,gravity;
new ciocan[33],arma[33];
new g_armura[33],g_hp[33],smk[33];
public plugin_init()
{
     register_plugin("VIP", "1.0", "D3luxe")

     register_clcmd("say /vm", "open_vip")
     register_clcmd("say /vipmenu", "open_vip")
     register_clcmd("say /vips", "ShowVipsOnline", ADMIN_ALL, "Show Vips Online");
     
     speed = register_cvar( "vipmenu_speed", "520.0" )
     gravity = register_cvar( "vipmenu_gravity", "0.6" )
	 
	 gCvar_flags = register_cvar("ammo_nade_flags" , "ac");
     register_event("CurWeapon", "Event_CurWeapon", "be", "1=1")   
     register_event("CurWeapon" , "event_CurWeapon" , "be" , "1=1");
	 register_event("ResetHUD", "resetModel", "b")	 

     RegisterHam(Ham_Spawn, "player", "Spawn_player", 1)
     RegisterHam(Ham_TakeDamage, "player", "Player_TakeDamage")	 
     
     maxPlayers = get_maxplayers();
}
public plugin_precache()
{
precache_model("models/arme/v_ciocan.mdl")
precache_model("models/arme/p_ciocan.mdl")

precache_model("models/arme/v_arma.mdl")
precache_model("models/arme/p_arma.mdl")

precache_model("models/player/vip/vip.mdl")//am pus asa pentru ca daca e server de zm nu are sens sa pui model cand playerul e zombie
}
public Spawn_player(id)
{
   if(is_user_alive(id) && is_user_connected(id))
   {
      set_user_rendering( id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 100 )
      has_ammo[id] = false;
	  g_armura[id] = false;
	  g_hp[id] = false;
	  smk[id] = false;
      ciocan[id] = 0;
      arma[id] = 0;
   }
}
public resetModel(id, level, cid) 
{
    if(is_user_vip(id)) 
	{
        new CsTeams:userTeam = cs_get_user_team(id)
        if(userTeam == CS_TEAM_CT) 
		{
        cs_set_user_model(id, "vip")
        } else {
        cs_reset_user_model(id)
        }
    }
    return PLUGIN_CONTINUE
}
public event_CurWeapon(id)
{
	if(!(is_user_alive(id) && is_user_vip(id)))
		return PLUGIN_CONTINUE;

	if(has_ammo[id])
	{
		static wpnid, clip;
		wpnid = read_data(2);
		clip = read_data(3);

		give_ammo(id , wpnid , clip);
	}

	return PLUGIN_CONTINUE;
}
public client_connect(id)
{
	has_ammo[id] = false;
	if(task_exists(id))
	remove_task(id);
}

public client_disconnect(id)
{
	has_ammo[id] = false;
	if(task_exists(id))
	remove_task(id);
}
bool:is_user_vip(id)
{
	if(id < 0 || id > 32)
		return false
	
	if( !(get_user_flags(id) & ADMIN_ACCESS) )
		return false
	
	return true
}
public VipStatus(const MsgId, const MsgType, const MsgDest)
{
	static id;
	id = get_msg_arg_int(1);

	if(is_user_vip(id) && !get_msg_arg_int(2))
	set_msg_arg_int(2, ARG_BYTE, (1 << 2 ));
} 

public ShowVipsOnline(id)
{
	new message[256], name[32], count = 0;
	new len = format(message, charsmax(message), "Vip-uri online: ");
	
	for (new player = 1; player <= maxPlayers; player++)
	{
		if (is_user_connected(player) && is_user_vip(player))
		{
			get_user_name(player, name, charsmax(name));
			
			if (count && len)
			{
				len += format(message[len], 255 - len, ", ");
			}
			
			len += format(message[len], 255 - len, "%s", name);
			
			if (len > 96) {
				client_print(id, print_chat, "%s", message);
				len = format(message, charsmax(message), "");
			}
			
			count++;
		}
	}
	
	if (len)
	{
		if (!count)
		{
			len += format(message[len], 255 - len, "Nu este nici un vip online.");
		}
		
		client_print(id, print_chat, "%s", message);
	}
	
	return PLUGIN_HANDLED;
}

public Event_CurWeapon(player)
{
        if(!(ciocan[player] || arma[player]))
		return PLUGIN_CONTINUE

        if(!is_user_vip(player) || !is_user_alive(player))
		return PLUGIN_CONTINUE

        if(read_data(2) == CSW_KNIFE && ciocan[player] == 1)
	    {
       set_pev(player, pev_viewmodel2, "models/arme/v_ciocan.mdl")
	   set_pev(player, pev_weaponmodel2, "models/arme/p_ciocan.mdl")
        }
       if(read_data(2) == CSW_XM1014 && arma[player] == 1)
	    {
       set_pev(player, pev_viewmodel2, "models/arme/v_arma.mdl")
	   set_pev(player, pev_weaponmodel2, "models/arme/p_arma.mdl")
        }
    return PLUGIN_CONTINUE
}

public Player_TakeDamage(victim, inflicator, attacker, Float:damage, damage_type, bitsDamage)
{
    if (!is_user(attacker) || !is_user(victim))
		return;
		
    if(get_user_weapon(attacker) == CSW_KNIFE)		
    {
	if(pev(attacker, pev_button) & IN_ATTACK && ciocan[attacker] == 1)
	{
            user_slap(victim,0,0)
            user_slap(victim,0,0)
            user_slap(victim,0,0)
            user_slap(victim,0,0)
            SetHamParamFloat(4, damage = 100.0)
	}
	else if(pev(attacker, pev_button) & IN_ATTACK2 && ciocan[attacker] == 1)
	{
            user_slap(victim,0,0)
            user_slap(victim,0,0)
            user_slap(victim,0,0)
            user_slap(victim,0,0)
            user_slap(victim,0,0)
            user_slap(victim,0,0)
           SetHamParamFloat(4, damage = 100.0)
	}
   }
   if(get_user_weapon(attacker) == CSW_XM1014 )		
  {
	if(pev(attacker, pev_button) & IN_ATTACK && arma[attacker] == 1)
	{
            SetHamParamFloat(4, damage = 170.0)
	}
  }
}
public abilitati(id)
{
     if(!is_user_vip(id) || is_user_infected(id) || !is_user_alive(id))
     {
          ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL!y deoarece nu esti VIP sau nu esti HUMAN!")
          return PLUGIN_HANDLED
     }
     else if(get_user_team(id) == 2 || !is_user_infected(id) )
	{
     new menu = menu_create( "\r[BIO.MAX-CS.RO] \yVIP \yMENU", "abilitati_handler" );
     
     menu_additem(menu, "\yInvizibilitate \r[80%inv.]", "1", 0); 
     menu_additem(menu, "\y250 \rHp", "2", 0);
     menu_additem(menu, "\y150 \rAp", "3", 0); 
     menu_additem(menu, "\ySpeed", "4", 0);
     menu_additem(menu, "\yGravity", "5", 0);
	 menu_additem(menu, "\yAmmo Infinit \r[1 runda]", "6", 0);
	 
     menu_setprop( menu, MPROP_EXITNAME, "Exit")
     menu_display( id, menu, 0);
    }
	return PLUGIN_CONTINUE;
}
public abilitati_handler(id, menu, item, client)
{
	if(item == MENU_EXIT || !is_user_alive(id))
	{
		menu_destroy(menu)
		return PLUGIN_HANDLED
		
	}
	
	static data[6], name[64], acs, cllbck, key
	menu_item_getinfo(menu, item, acs, data, 5, name, 63, cllbck)
	key = str_to_num(data)
	switch(key)
	{
		case 1:
		{
                  if(is_user_alive(id))
                  {
                  set_user_rendering( id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 20 )
                  ChatColor(id, "!g[VIP] !yAi ales !teamInvizibilitate[80% invizibilitate]!")  
                 }else
                  {
                  ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!")   
                  }
		}
		case 2: 
		{  
        		if(g_hp[id])
                {
                ChatColor(id, "!g[VIP]!yAi !teamluat deja 250 hp!yrunda asta.")				
                }else   
                if(is_user_alive(id))
                {
                set_user_health(id, 250) 
				g_hp[id] = true;
                ChatColor(id, "!g[VIP]!yAi ales !team250 hp!")				
                }
                else
                  {
                  ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!")   
                  }
		}
		case 3:
		{    
        		if(g_armura[id])
                {
                ChatColor(id, "!g[VIP]!yAi !teamluat deja 150 armura !yrunda asta!")				
                }else  
                if(is_user_alive(id))
                {
                set_user_armor(id,150) 
				g_armura[id] = true;
                ChatColor(id, "!g[VIP]!yAi ales !team150 armura!")				
                }
                else
                  {
                  ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!")   
                  }
		}
		case 4:
		{
                if(is_user_alive(id))
                {
                set_user_maxspeed(id, get_pcvar_float(speed))
                ChatColor(id, "!g[VIP] !yAi ales !teamSpeed!")  
                }
                else
                  {
                   ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!")   
                  }
		}
		case 5:
		{
               if(is_user_alive(id))
               {
               set_user_gravity(id, get_pcvar_float(gravity))
               ChatColor(id, "!g[VIP] !yAi ales !teamGravity !")  
                } else
                  {
                  ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!")    
                  }
		}
		case 6:
		{
               if(is_user_alive(id))
               {
                has_ammo[id] = true;
                ChatColor(id, "!g[VIP] !yAi ales !teamInfinite Ammo pentru o runda!")  
                }else
                {
                ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!")    
                }
		}
	}
	
	menu_destroy(menu)
	return PLUGIN_HANDLED
}
public open_vip(id)
{
     if(!is_user_vip(id) || is_user_infected(id) || !is_user_alive(id))
     {
          ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL!y deoarece nu esti VIP sau nu esti HUMAN!")
          return PLUGIN_HANDLED
     }
     else if(get_user_team(id) == 2 || !is_user_infected(id))
	 {
     new menu = menu_create( "\r[BIO.MAX-CS.RO] \yVIP \yMENU", "vip_handler" );
     
     menu_additem(menu, "\yCiocan \yAruncator \r[Slap]", "1", 0); 
     menu_additem(menu, "\yAbilitati", "2", 0);
     menu_additem(menu, "\ySmoke \yGrenade", "3", 0); 
     menu_additem(menu, "\yMX1014", "4", 0);
    
     menu_setprop( menu, MPROP_EXITNAME, "Exit")
     menu_display( id, menu, 0);
    }
return PLUGIN_CONTINUE;
}
public vip_handler(id, menu, item, client)
{
	if(item == MENU_EXIT || !is_user_alive(id))
	{
		menu_destroy(menu)
		return PLUGIN_HANDLED
		
	}
	
	static data[6], name[64], acs, cllbck, key
	menu_item_getinfo(menu, item, acs, data, 5, name, 63, cllbck)
	key = str_to_num(data)
	switch(key)
	{
		case 1:
		{
                  if(is_user_alive(id))
                  {
                  engclient_cmd(id, "weapon_knife")
                  ciocan[id] = 1
                  set_pev(id, pev_viewmodel2, "models/arme/v_ciocan.mdl")
	              set_pev(id, pev_weaponmodel2, "models/arme/p_ciocan.mdl")  
                  ChatColor(id, "!g[VIP] !yAi ales !teamCiocan Aruncator!")  
                 }
	         else
                   {
                  ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!")   
                   }
		}
		case 2:
		{
                if(is_user_alive(id))
                {
                abilitati(id)  
				ChatColor(id, "!g[VIP] !yAi deschis !teamMeniul de Abilitati !")  
                }
                else
                   {
                  ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!")   
                   }
		}
		case 3:
		{
		        if(smk[id])
				 {
				ChatColor(id, "!g[VIP] !yAi ales deja !teamSmoke Grenade!y runda asta!") 
				 }
	       else
                if(is_user_alive(id))
                {
                give_item(id, "weapon_smokegrenade")
				smk[id] = true;
                ChatColor(id, "!g[VIP] !yAi ales !teamSmoke Grenade!")  
                }
                else
                  {
                   ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!")   
                  }
		}
		case 4:
		{
               if(is_user_alive(id))
               {
               engclient_cmd(id, "weapon_xm1014")
			   give_item(id, "weapon_xm1014")
			   cs_set_user_bpammo(id, CSW_XM1014, 200)
               arma[id] = 1;
               set_pev(id, pev_viewmodel2, "models/arme/v_arma.mdl")
	           set_pev(id, pev_weaponmodel2, "models/arme/p_arma.mdl")
               ChatColor(id, "!g[VIP] !yAi ales !teamarma xm1014!")  
                } 
		else
                  {
                  ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!")    
                  }
		}
	}
	
	menu_destroy(menu)
	return PLUGIN_HANDLED
	
}
//unlimited ammo
public give_ammo(id , wpnid , clip)
{
	if(!is_user_alive(id) && !is_user_vip(id) && has_ammo[id] != true )
		return;

	if(	wpnid==CSW_C4		||
		wpnid==CSW_KNIFE	||
		wpnid==CSW_HEGRENADE	||
		wpnid==CSW_SMOKEGRENADE	||
		wpnid==CSW_FLASHBANG	) 
			return;

	if(!clip)
	{
		static weapname[33];
		get_weaponname(wpnid , weapname , 32);

		static wpn
		wpn = -1;
		while((wpn = find_ent_by_class(wpn , weapname)) != 0)
		{
			if(id == entity_get_edict(wpn , EV_ENT_owner))
			{
				cs_set_weapon_ammo(wpn , maxclip(wpnid))
				break;
			}
		}
	}
}

public check_for_nades(id)
{
	if(!is_user_alive(id))
		return;

	if(nade_flags() & HE_GRENADE)
	{
		if(!user_has_weapon(id , CSW_HEGRENADE))
			give_item(id , "weapon_hegrenade");
	}
	if(nade_flags() & SMOKE_GRENADE)
	{
		if(!user_has_weapon(id , CSW_SMOKEGRENADE))
			give_item(id , "weapon_smokegrenade");
	}
	if(nade_flags() & FLASH_GRENADE)
	{
		if(!user_has_weapon(id , CSW_FLASHBANG))
			give_item(id , "weapon_flashbang");
	}
}

stock maxclip(wpnid) 
{
	static ca;
	ca = 0;

	switch (wpnid) 
	{
		case CSW_P228 : ca = 13;
		case CSW_SCOUT : ca = 10;
		case CSW_HEGRENADE : ca = 0;
		case CSW_XM1014 : ca = 7;
		case CSW_C4 : ca = 0;
		case CSW_MAC10 : ca = 30;
		case CSW_AUG : ca = 30;
		case CSW_SMOKEGRENADE : ca = 0;
		case CSW_ELITE : ca = 15;
		case CSW_FIVESEVEN : ca = 20;
		case CSW_UMP45 : ca = 25;
		case CSW_SG550 : ca = 30;
		case CSW_GALI : ca = 35;
		case CSW_FAMAS : ca = 25;
		case CSW_USP : ca = 12;
		case CSW_GLOCK18 : ca = 20;
		case CSW_AWP : ca = 10;
		case CSW_MP5NAVY : ca = 30;
		case CSW_M249 : ca = 100;
		case CSW_M3 : ca = 8;
		case CSW_M4A1 : ca = 30;
		case CSW_TMP : ca = 30;
		case CSW_G3SG1 : ca = 20;
		case CSW_FLASHBANG : ca = 0;
		case CSW_DEAGLE	: ca = 7;
		case CSW_SG552 : ca = 30;
		case CSW_AK47 : ca = 30;
		case CSW_P90 : ca = 50;
	}
	return ca;
}

stock nade_flags()
{
	static buffer[8];
	get_pcvar_string(gCvar_flags , buffer , 7);

	return read_flags(buffer);
}
//stock
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")
    replace_all(msg, 190, "!y", "^1")
    replace_all(msg, 190, "!team", "^3")
    
    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 }
*/
Image
RoyalServer
User avatar
cyby
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 1777
Joined: 16 Jul 2011, 21:46
Detinator Steam: Da
Detinator server CS: Da
Reputatie: Scripter eXtreamCS
Fost Moderator ajutator
Has thanked: 146 times
Been thanked: 396 times

18 Dec 2015, 23:45

| Afiseaza codul
#include <amxmodx>
#include <fun>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta>
#include <engine>
#include <biohazard>
#pragma tabsize 0

#define ADMIN_ACCESS ADMIN_LEVEL_H
#define is_user(%1) (1 <= %1 <= maxPlayers)
#define HE_GRENADE	(1<<0)
#define SMOKE_GRENADE	(1<<1)
#define FLASH_GRENADE	(1<<2)

new gCvar_flags;
new bool:has_ammo[33]
new maxPlayers;

new speed,gravity;
new ciocan[33],arma[33];
new g_armura[33],g_hp[33],smk[33], g_speed[33];
public plugin_init()
{
     register_plugin("VIP", "1.0", "D3luxe")

     register_clcmd("say /vm", "open_vip")
     register_clcmd("say /vipmenu", "open_vip")
     register_clcmd("say /vips", "ShowVipsOnline", ADMIN_ALL, "Show Vips Online");
     
     speed = register_cvar( "vipmenu_speed", "520.0" )
     gravity = register_cvar( "vipmenu_gravity", "0.6" )
	 
	 gCvar_flags = register_cvar("ammo_nade_flags" , "ac");
     register_event("CurWeapon", "Event_CurWeapon", "be", "1=1")   
     register_event("CurWeapon" , "event_CurWeapon" , "be" , "1=1");
	 register_event("ResetHUD", "resetModel", "b")	 

     RegisterHam(Ham_Spawn, "player", "Spawn_player", 1)
     RegisterHam(Ham_TakeDamage, "player", "Player_TakeDamage")	 
     
     maxPlayers = get_maxplayers();
}
public plugin_precache()
{
precache_model("models/arme/v_ciocan.mdl")
precache_model("models/arme/p_ciocan.mdl")

precache_model("models/arme/v_arma.mdl")
precache_model("models/arme/p_arma.mdl")

precache_model("models/player/vip/vip.mdl")//am pus asa pentru ca daca e server de zm nu are sens sa pui model cand playerul e zombie
}
public Spawn_player(id)
{
   if(is_user_alive(id) && is_user_connected(id))
   {
      set_user_rendering( id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 255 )
      has_ammo[id] = false;
	  g_armura[id] = false;
	  g_speed[id] = false;
	  g_hp[id] = false;
	  smk[id] = false;
      ciocan[id] = 0;
      arma[id] = 0;
   }
}
public resetModel(id, level, cid) 
{
    if(is_user_vip(id)) 
	{
        new CsTeams:userTeam = cs_get_user_team(id)
        if(userTeam == CS_TEAM_CT) 
		{
        cs_set_user_model(id, "vip")
        } else {
        cs_reset_user_model(id)
        }
    }
    return PLUGIN_CONTINUE
}
public event_CurWeapon(id)
{
	if(!(is_user_alive(id) && is_user_vip(id)) || is_user_infected(id))
		return PLUGIN_CONTINUE;

	if(g_speed[id])
		set_user_maxspeed(id, get_pcvar_float(speed));
		
	if(has_ammo[id])
	{
		static wpnid, clip;
		wpnid = read_data(2);
		clip = read_data(3);

		give_ammo(id , wpnid , clip);
	}

	return PLUGIN_CONTINUE;
}
public client_connect(id)
{
	has_ammo[id] = false;
	if(task_exists(id))
	remove_task(id);
}

public client_disconnect(id)
{
	has_ammo[id] = false;
	if(task_exists(id))
	remove_task(id);
}
bool:is_user_vip(id)
{
	if(id < 0 || id > 32)
		return false
	
	if( !(get_user_flags(id) & ADMIN_ACCESS) )
		return false
	
	return true
}
public VipStatus(const MsgId, const MsgType, const MsgDest)
{
	static id;
	id = get_msg_arg_int(1);

	if(is_user_vip(id) && !get_msg_arg_int(2))
	set_msg_arg_int(2, ARG_BYTE, (1 << 2 ));
} 

public ShowVipsOnline(id)
{
	new message[256], name[32], count = 0;
	new len = format(message, charsmax(message), "Vip-uri online: ");
	
	for (new player = 1; player <= maxPlayers; player++)
	{
		if (is_user_connected(player) && is_user_vip(player))
		{
			get_user_name(player, name, charsmax(name));
			
			if (count && len)
			{
				len += format(message[len], 255 - len, ", ");
			}
			
			len += format(message[len], 255 - len, "%s", name);
			
			if (len > 96) {
				client_print(id, print_chat, "%s", message);
				len = format(message, charsmax(message), "");
			}
			
			count++;
		}
	}
	
	if (len)
	{
		if (!count)
		{
			len += format(message[len], 255 - len, "Nu este nici un vip online.");
		}
		
		client_print(id, print_chat, "%s", message);
	}
	
	return PLUGIN_HANDLED;
}

public Event_CurWeapon(player)
{
        if(!(ciocan[player] || arma[player]))
		return PLUGIN_CONTINUE

        if(!is_user_vip(player) || !is_user_alive(player) || is_user_infected(player))
		return PLUGIN_CONTINUE

        if(read_data(2) == CSW_KNIFE && ciocan[player] == 1)
	    {
       set_pev(player, pev_viewmodel2, "models/arme/v_ciocan.mdl")
	   set_pev(player, pev_weaponmodel2, "models/arme/p_ciocan.mdl")
        }
       if(read_data(2) == CSW_XM1014 && arma[player] == 1)
	    {
       set_pev(player, pev_viewmodel2, "models/arme/v_arma.mdl")
	   set_pev(player, pev_weaponmodel2, "models/arme/p_arma.mdl")
        }
    return PLUGIN_CONTINUE
}

public Player_TakeDamage(victim, inflicator, attacker, Float:damage, damage_type, bitsDamage)
{
    if (!is_user(attacker) || !is_user(victim))
		return;
		
    if((get_user_weapon(attacker) == CSW_KNIFE) && !is_user_infected(attacker))		
    {
	if(pev(attacker, pev_button) & IN_ATTACK && ciocan[attacker] == 1)
	{
            user_slap(victim,0,0)
            user_slap(victim,0,0)
            user_slap(victim,0,0)
            user_slap(victim,0,0)
            SetHamParamFloat(4, damage = 100.0)
	}
	else if(pev(attacker, pev_button) & IN_ATTACK2 && ciocan[attacker] == 1)
	{
            user_slap(victim,0,0)
            user_slap(victim,0,0)
            user_slap(victim,0,0)
            user_slap(victim,0,0)
            user_slap(victim,0,0)
            user_slap(victim,0,0)
           SetHamParamFloat(4, damage = 100.0)
	}
   }
   if(get_user_weapon(attacker) == CSW_XM1014 )		
  {
	if(pev(attacker, pev_button) & IN_ATTACK && arma[attacker] == 1)
	{
            SetHamParamFloat(4, damage = 170.0)
	}
  }
}
public abilitati(id)
{
     if(!is_user_vip(id) || is_user_infected(id) || !is_user_alive(id))
     {
          ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL!y deoarece nu esti VIP sau nu esti HUMAN!")
          return PLUGIN_HANDLED
     }
     else if(get_user_team(id) == 2 || !is_user_infected(id) )
	{
     new menu = menu_create( "\r[BIO.MAX-CS.RO] \yVIP \yMENU", "abilitati_handler" );
     
     menu_additem(menu, "\yInvizibilitate \r[80%inv.]", "1", 0); 
     menu_additem(menu, "\y250 \rHp", "2", 0);
     menu_additem(menu, "\y150 \rAp", "3", 0); 
     menu_additem(menu, "\ySpeed", "4", 0);
     menu_additem(menu, "\yGravity", "5", 0);
	 menu_additem(menu, "\yAmmo Infinit \r[1 runda]", "6", 0);
	 
     menu_setprop( menu, MPROP_EXITNAME, "Exit")
     menu_display( id, menu, 0);
    }
	return PLUGIN_CONTINUE;
}
public abilitati_handler(id, menu, item, client)
{
	if(item == MENU_EXIT || !is_user_alive(id) || is_user_infected(id))
	{
		menu_destroy(menu)
		return PLUGIN_HANDLED
		
	}
	
	static data[6], name[64], acs, cllbck, key
	menu_item_getinfo(menu, item, acs, data, 5, name, 63, cllbck)
	key = str_to_num(data)
	switch(key)
	{
		case 1:
		{
                  if(is_user_alive(id))
                  {
                  set_user_rendering( id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 35)
                  ChatColor(id, "!g[VIP] !yAi ales !teamInvizibilitate[80% invizibilitate]!")  
                 }else
                  {
                  ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!")   
                  }
		}
		case 2: 
		{  
        		if(g_hp[id])
                {
                ChatColor(id, "!g[VIP]!yAi !teamluat deja 250 hp!yrunda asta.")				
                }else   
                if(is_user_alive(id))
                {
                set_user_health(id, 250) 
				g_hp[id] = true;
                ChatColor(id, "!g[VIP]!yAi ales !team250 hp!")				
                }
                else
                  {
                  ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!")   
                  }
		}
		case 3:
		{    
        		if(g_armura[id])
                {
                ChatColor(id, "!g[VIP]!yAi !teamluat deja 150 armura !yrunda asta!")				
                }else  
                if(is_user_alive(id))
                {
                set_user_armor(id,150) 
				g_armura[id] = true;
                ChatColor(id, "!g[VIP]!yAi ales !team150 armura!")				
                }
                else
                  {
                  ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!")   
                  }
		}
		case 4:
		{
                if(is_user_alive(id))
                {
                set_user_maxspeed(id, get_pcvar_float(speed))
                g_speed[id] = true;
                ChatColor(id, "!g[VIP] !yAi ales !teamSpeed!")  
                }
                else
                  {
                   ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!")   
                  }
		}
		case 5:
		{
               if(is_user_alive(id))
               {
               set_user_gravity(id, get_pcvar_float(gravity))
               ChatColor(id, "!g[VIP] !yAi ales !teamGravity !")  
                } else
                  {
                  ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!")    
                  }
		}
		case 6:
		{
               if(is_user_alive(id))
               {
                has_ammo[id] = true;
                ChatColor(id, "!g[VIP] !yAi ales !teamInfinite Ammo pentru o runda!")  
                }else
                {
                ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!")    
                }
		}
	}
	
	menu_destroy(menu)
	return PLUGIN_HANDLED
}
public open_vip(id)
{
     if(!is_user_vip(id) || is_user_infected(id) || !is_user_alive(id))
     {
          ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL!y deoarece nu esti VIP sau nu esti HUMAN!")
          return PLUGIN_HANDLED
     }
     else if(get_user_team(id) == 2 || !is_user_infected(id))
	 {
     new menu = menu_create( "\r[BIO.MAX-CS.RO] \yVIP \yMENU", "vip_handler" );
     
     menu_additem(menu, "\yCiocan \yAruncator \r[Slap]", "1", 0); 
     menu_additem(menu, "\yAbilitati", "2", 0);
     menu_additem(menu, "\ySmoke \yGrenade", "3", 0); 
     menu_additem(menu, "\yMX1014", "4", 0);
    
     menu_setprop( menu, MPROP_EXITNAME, "Exit")
     menu_display( id, menu, 0);
    }
return PLUGIN_CONTINUE;
}
public vip_handler(id, menu, item, client)
{
	if(item == MENU_EXIT || !is_user_alive(id) || is_user_infected(id))
	{
		menu_destroy(menu)
		return PLUGIN_HANDLED
		
	}

	static data[6], name[64], acs, cllbck, key
	menu_item_getinfo(menu, item, acs, data, 5, name, 63, cllbck)
	key = str_to_num(data)
	switch(key)
	{
		case 1:
		{
                  if(is_user_alive(id))
                  {
                  engclient_cmd(id, "weapon_knife")
                  ciocan[id] = 1
                  set_pev(id, pev_viewmodel2, "models/arme/v_ciocan.mdl")
	              set_pev(id, pev_weaponmodel2, "models/arme/p_ciocan.mdl")  
                  ChatColor(id, "!g[VIP] !yAi ales !teamCiocan Aruncator!")  
                 }
	         else
                   {
                  ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!")   
                   }
		}
		case 2:
		{
                if(is_user_alive(id))
                {
                abilitati(id)  
				ChatColor(id, "!g[VIP] !yAi deschis !teamMeniul de Abilitati !")  
                }
                else
                   {
                  ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!")   
                   }
		}
		case 3:
		{
		        if(smk[id])
				 {
				ChatColor(id, "!g[VIP] !yAi ales deja !teamSmoke Grenade!y runda asta!") 
				 }
	       else
                if(is_user_alive(id))
                {
                give_item(id, "weapon_smokegrenade")
				smk[id] = true;
                ChatColor(id, "!g[VIP] !yAi ales !teamSmoke Grenade!")  
                }
                else
                  {
                   ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!")   
                  }
		}
		case 4:
		{
               if(is_user_alive(id))
               {
               engclient_cmd(id, "weapon_xm1014")
			   give_item(id, "weapon_xm1014")
			   cs_set_user_bpammo(id, CSW_XM1014, 200)
               arma[id] = 1;
               set_pev(id, pev_viewmodel2, "models/arme/v_arma.mdl")
	           set_pev(id, pev_weaponmodel2, "models/arme/p_arma.mdl")
               ChatColor(id, "!g[VIP] !yAi ales !teamarma xm1014!")  
                } 
		else
                  {
                  ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!")    
                  }
		}
	}
	
	menu_destroy(menu)
	return PLUGIN_HANDLED
	
}
//unlimited ammo
public give_ammo(id , wpnid , clip)
{
	if(!is_user_alive(id) && !is_user_vip(id) && has_ammo[id] != true )
		return;

	if(	wpnid==CSW_C4		||
		wpnid==CSW_KNIFE	||
		wpnid==CSW_HEGRENADE	||
		wpnid==CSW_SMOKEGRENADE	||
		wpnid==CSW_FLASHBANG	) 
			return;

	if(!clip)
	{
		static weapname[33];
		get_weaponname(wpnid , weapname , 32);

		static wpn
		wpn = -1;
		while((wpn = find_ent_by_class(wpn , weapname)) != 0)
		{
			if(id == entity_get_edict(wpn , EV_ENT_owner))
			{
				cs_set_weapon_ammo(wpn , maxclip(wpnid))
				break;
			}
		}
	}
}

stock maxclip(wpnid) 
{
	static ca;
	ca = 0;

	switch (wpnid) 
	{
		case CSW_P228 : ca = 13;
		case CSW_SCOUT : ca = 10;
		case CSW_HEGRENADE : ca = 0;
		case CSW_XM1014 : ca = 7;
		case CSW_C4 : ca = 0;
		case CSW_MAC10 : ca = 30;
		case CSW_AUG : ca = 30;
		case CSW_SMOKEGRENADE : ca = 0;
		case CSW_ELITE : ca = 15;
		case CSW_FIVESEVEN : ca = 20;
		case CSW_UMP45 : ca = 25;
		case CSW_SG550 : ca = 30;
		case CSW_GALI : ca = 35;
		case CSW_FAMAS : ca = 25;
		case CSW_USP : ca = 12;
		case CSW_GLOCK18 : ca = 20;
		case CSW_AWP : ca = 10;
		case CSW_MP5NAVY : ca = 30;
		case CSW_M249 : ca = 100;
		case CSW_M3 : ca = 8;
		case CSW_M4A1 : ca = 30;
		case CSW_TMP : ca = 30;
		case CSW_G3SG1 : ca = 20;
		case CSW_FLASHBANG : ca = 0;
		case CSW_DEAGLE	: ca = 7;
		case CSW_SG552 : ca = 30;
		case CSW_AK47 : ca = 30;
		case CSW_P90 : ca = 50;
	}
	return ca;
}

stock nade_flags()
{
	static buffer[8];
	get_pcvar_string(gCvar_flags , buffer , 7);

	return read_flags(buffer);
}
//stock
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")
    replace_all(msg, 190, "!y", "^1")
    replace_all(msg, 190, "!team", "^3")
    
    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();
            }
        }
    }
}
93.114.82.17:27015 - Monster Invasion CO-OP Mod
User avatar
[Bio]King
Membru, skill 0
Membru, skill 0
Posts: 26
Joined: 28 Nov 2015, 19:20
Detinator Steam: Da
CS Status: Fericit
Detinator server CS: Bio.Max-CS.Ro
Fond eXtream: 0
Location: Bio.*** Reclama ***
Contact:

19 Dec 2015, 11:01

multumesc cyby,dar tot am problema ... daca sunt human si dupa primesc infectie tot pot sa foloesc /vm.. Si daca ai putea sa faci(daca e ceva simplu) cand cumperi arma din /vm sa-ti arunce arma care o ai in mana..De exemplu ai m4a1 si cumperi arma din .vm sa o arunce pe aia .. sa nu aibe 2 arme.. atat :* Uite si o poza cu bugu ala..


Image
Image
User avatar
[Bio]King
Membru, skill 0
Membru, skill 0
Posts: 26
Joined: 28 Nov 2015, 19:20
Detinator Steam: Da
CS Status: Fericit
Detinator server CS: Bio.Max-CS.Ro
Fond eXtream: 0
Location: Bio.*** Reclama ***
Contact:

22 Dec 2015, 13:01

up...
Image
User avatar
^ionutz^
Fost moderator
Fost moderator
Posts: 1995
Joined: 05 Oct 2013, 15:12
Detinator Steam: Da
CS Status: activitate scazuta !
SteamID: /id/ionutz_cs/
Reputatie: Fost moderator ajutator
Location: Galati
Has thanked: 46 times
Been thanked: 23 times

22 Dec 2015, 18:25

probeaza abia mi-am instalat windowsul si nu stiu daca mege | Afiseaza codul
#include <amxmodx>
#include <fun>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta>
#include <engine>
#include <biohazard>
#pragma tabsize 0

#define ADMIN_ACCESS ADMIN_LEVEL_H
#define is_user(%1) (1 <= %1 <= maxPlayers)
#define HE_GRENADE	(1<<0)
#define SMOKE_GRENADE	(1<<1)
#define FLASH_GRENADE	(1<<2)

new gCvar_flags;
new bool:has_ammo[33]
new maxPlayers;

new speed,gravity;
new ciocan[33],arma[33];
new g_armura[33],g_hp[33],smk[33], g_speed[33];
public plugin_init()
{
     register_plugin("VIP", "1.0", "D3luxe")

     register_clcmd("say /vm", "open_vip")
     register_clcmd("say /vipmenu", "open_vip")
     register_clcmd("say /vips", "ShowVipsOnline", ADMIN_ALL, "Show Vips Online");
     
     speed = register_cvar( "vipmenu_speed", "520.0" )
     gravity = register_cvar( "vipmenu_gravity", "0.6" )
	 
	 gCvar_flags = register_cvar("ammo_nade_flags" , "ac");
     register_event("CurWeapon", "Event_CurWeapon", "be", "1=1")   
     register_event("CurWeapon" , "event_CurWeapon" , "be" , "1=1");
	 register_event("ResetHUD", "resetModel", "b")	 

     RegisterHam(Ham_Spawn, "player", "Spawn_player", 1)
     RegisterHam(Ham_TakeDamage, "player", "Player_TakeDamage")	 
     
     maxPlayers = get_maxplayers();
}
public plugin_precache()
{
precache_model("models/arme/v_ciocan.mdl")
precache_model("models/arme/p_ciocan.mdl")

precache_model("models/arme/v_arma.mdl")
precache_model("models/arme/p_arma.mdl")

precache_model("models/player/vip/vip.mdl")//am pus asa pentru ca daca e server de zm nu are sens sa pui model cand playerul e zombie
}
public Spawn_player(id)
{
   if(is_user_alive(id) && is_user_connected(id))
   {
      set_user_rendering( id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 255 )
      has_ammo[id] = false;
	  g_armura[id] = false;
	  g_speed[id] = false;
	  g_hp[id] = false;
	  smk[id] = false;
      ciocan[id] = 0;
      arma[id] = 0;
   }
}
public resetModel(id, level, cid) 
{
    if(is_user_vip(id)) 
	{
        new CsTeams:userTeam = cs_get_user_team(id)
        if(userTeam == CS_TEAM_CT) 
		{
        cs_set_user_model(id, "vip")
        } else {
        cs_reset_user_model(id)
        }
    }
    return PLUGIN_CONTINUE
}
public event_CurWeapon(id)
{
	if(!(is_user_alive(id) && is_user_vip(id)) || is_user_infected(id))
		return PLUGIN_CONTINUE;

	if(g_speed[id])
		set_user_maxspeed(id, get_pcvar_float(speed));
		
	if(has_ammo[id])
	{
		static wpnid, clip;
		wpnid = read_data(2);
		clip = read_data(3);

		give_ammo(id , wpnid , clip);
	}

	return PLUGIN_CONTINUE;
}
public client_connect(id)
{
	has_ammo[id] = false;
	if(task_exists(id))
	remove_task(id);
}

public client_disconnect(id)
{
	has_ammo[id] = false;
	if(task_exists(id))
	remove_task(id);
}
bool:is_user_vip(id)
{
	if(id < 0 || id > 32)
		return false
	
	if( !(get_user_flags(id) & ADMIN_ACCESS) )
		return false
	
	return true
}
public VipStatus(const MsgId, const MsgType, const MsgDest)
{
	static id;
	id = get_msg_arg_int(1);

	if(is_user_vip(id) && !get_msg_arg_int(2))
	set_msg_arg_int(2, ARG_BYTE, (1 << 2 ));
} 

public ShowVipsOnline(id)
{
	new message[256], name[32], count = 0;
	new len = format(message, charsmax(message), "Vip-uri online: ");
	
	for (new player = 1; player <= maxPlayers; player++)
	{
		if (is_user_connected(player) && is_user_vip(player))
		{
			get_user_name(player, name, charsmax(name));
			
			if (count && len)
			{
				len += format(message[len], 255 - len, ", ");
			}
			
			len += format(message[len], 255 - len, "%s", name);
			
			if (len > 96) {
				client_print(id, print_chat, "%s", message);
				len = format(message, charsmax(message), "");
			}
			
			count++;
		}
	}
	
	if (len)
	{
		if (!count)
		{
			len += format(message[len], 255 - len, "Nu este nici un vip online.");
		}
		
		client_print(id, print_chat, "%s", message);
	}
	
	return PLUGIN_HANDLED;
}

public Event_CurWeapon(player)
{
        if(!(ciocan[player] || arma[player]))
		return PLUGIN_CONTINUE

        if(!is_user_vip(player) || !is_user_alive(player) || is_user_infected(player))
		return PLUGIN_CONTINUE

        if(read_data(2) == CSW_KNIFE && ciocan[player] == 1)
	    {
       set_pev(player, pev_viewmodel2, "models/arme/v_ciocan.mdl")
	   set_pev(player, pev_weaponmodel2, "models/arme/p_ciocan.mdl")
        }
       if(read_data(2) == CSW_XM1014 && arma[player] == 1)
	    {
       set_pev(player, pev_viewmodel2, "models/arme/v_arma.mdl")
	   set_pev(player, pev_weaponmodel2, "models/arme/p_arma.mdl")
        }
    return PLUGIN_CONTINUE
}

public Player_TakeDamage(victim, inflicator, attacker, Float:damage, damage_type, bitsDamage)
{
    if (!is_user(attacker) || !is_user(victim))
		return;
		
    if((get_user_weapon(attacker) == CSW_KNIFE) && !is_user_infected(attacker))		
    {
	if(pev(attacker, pev_button) & IN_ATTACK && ciocan[attacker] == 1)
	{
            user_slap(victim,0,0)
            user_slap(victim,0,0)
            user_slap(victim,0,0)
            user_slap(victim,0,0)
            SetHamParamFloat(4, damage = 100.0)
	}
	else if(pev(attacker, pev_button) & IN_ATTACK2 && ciocan[attacker] == 1)
	{
            user_slap(victim,0,0)
            user_slap(victim,0,0)
            user_slap(victim,0,0)
            user_slap(victim,0,0)
            user_slap(victim,0,0)
            user_slap(victim,0,0)
           SetHamParamFloat(4, damage = 100.0)
	}
   }
   if(get_user_weapon(attacker) == CSW_XM1014 )		
  {
	if(pev(attacker, pev_button) & IN_ATTACK && arma[attacker] == 1)
	{
            SetHamParamFloat(4, damage = 170.0)
	}
  }
}
public abilitati(id)
{
     if(!is_user_vip(id) || is_user_infected(id) || !is_user_alive(id) || is_user_zombie(id))
     {
          ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL!y deoarece nu esti VIP sau nu esti HUMAN!")
          return PLUGIN_HANDLED
     }
     else if(get_user_team(id) == 2 || !is_user_infected(id) )
	{
     new menu = menu_create( "\r[BIO.MAX-CS.RO] \yVIP \yMENU", "abilitati_handler" );
     
     menu_additem(menu, "\yInvizibilitate \r[80%inv.]", "1", 0); 
     menu_additem(menu, "\y250 \rHp", "2", 0);
     menu_additem(menu, "\y150 \rAp", "3", 0); 
     menu_additem(menu, "\ySpeed", "4", 0);
     menu_additem(menu, "\yGravity", "5", 0);
	 menu_additem(menu, "\yAmmo Infinit \r[1 runda]", "6", 0);
	 
     menu_setprop( menu, MPROP_EXITNAME, "Exit")
     menu_display( id, menu, 0);
    }
	return PLUGIN_CONTINUE;
}
public abilitati_handler(id, menu, item, client)
{
	if(item == MENU_EXIT || !is_user_alive(id) || is_user_infected(id) || is_user_zombie(id))
	{
		menu_destroy(menu)
		return PLUGIN_HANDLED
		
	}
	
	static data[6], name[64], acs, cllbck, key
	menu_item_getinfo(menu, item, acs, data, 5, name, 63, cllbck)
	key = str_to_num(data)
	switch(key)
	{
		case 1:
		{
                  if(is_user_alive(id))
                  {
                  set_user_rendering( id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 35)
                  ChatColor(id, "!g[VIP] !yAi ales !teamInvizibilitate[80% invizibilitate]!")  
                 }else
                  {
                  ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!")   
                  }
		}
		case 2: 
		{  
        		if(g_hp[id])
                {
                ChatColor(id, "!g[VIP]!yAi !teamluat deja 250 hp!yrunda asta.")				
                }else   
                if(is_user_alive(id))
                {
                set_user_health(id, 250) 
				g_hp[id] = true;
                ChatColor(id, "!g[VIP]!yAi ales !team250 hp!")				
                }
                else
                  {
                  ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!")   
                  }
		}
		case 3:
		{    
        		if(g_armura[id])
                {
                ChatColor(id, "!g[VIP]!yAi !teamluat deja 150 armura !yrunda asta!")				
                }else  
                if(is_user_alive(id))
                {
                set_user_armor(id,150) 
				g_armura[id] = true;
                ChatColor(id, "!g[VIP]!yAi ales !team150 armura!")				
                }
                else
                  {
                  ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!")   
                  }
		}
		case 4:
		{
                if(is_user_alive(id))
                {
                set_user_maxspeed(id, get_pcvar_float(speed))
                g_speed[id] = true;
                ChatColor(id, "!g[VIP] !yAi ales !teamSpeed!")  
                }
                else
                  {
                   ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!")   
                  }
		}
		case 5:
		{
               if(is_user_alive(id))
               {
               set_user_gravity(id, get_pcvar_float(gravity))
               ChatColor(id, "!g[VIP] !yAi ales !teamGravity !")  
                } else
                  {
                  ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!")    
                  }
		}
		case 6:
		{
               if(is_user_alive(id))
               {
                has_ammo[id] = true;
                ChatColor(id, "!g[VIP] !yAi ales !teamInfinite Ammo pentru o runda!")  
                }else
                {
                ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!")    
                }
		}
	}
	
	menu_destroy(menu)
	return PLUGIN_HANDLED
}
public open_vip(id)
{
     if(!is_user_vip(id) || is_user_infected(id) || !is_user_alive(id) || is_user_zombie(id))
     {
          ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL!y deoarece nu esti VIP sau nu esti HUMAN!")
          return PLUGIN_HANDLED
     }
     else if(get_user_team(id) == 2 || !is_user_infected(id))
	 {
     new menu = menu_create( "\r[BIO.MAX-CS.RO] \yVIP \yMENU", "vip_handler" );
     
     menu_additem(menu, "\yCiocan \yAruncator \r[Slap]", "1", 0); 
     menu_additem(menu, "\yAbilitati", "2", 0);
     menu_additem(menu, "\ySmoke \yGrenade", "3", 0); 
     menu_additem(menu, "\yMX1014", "4", 0);
    
     menu_setprop( menu, MPROP_EXITNAME, "Exit")
     menu_display( id, menu, 0);
    }
return PLUGIN_CONTINUE;
}
public vip_handler(id, menu, item, client)
{
	if(item == MENU_EXIT || !is_user_alive(id) || is_user_infected(id) || is_user_zombie(id))
	{
		menu_destroy(menu)
		return PLUGIN_HANDLED
		
	}

	static data[6], name[64], acs, cllbck, key
	menu_item_getinfo(menu, item, acs, data, 5, name, 63, cllbck)
	key = str_to_num(data)
	switch(key)
	{
		case 1:
		{
                  if(is_user_alive(id))
                  {
                  engclient_cmd(id, "weapon_knife")
                  ciocan[id] = 1
                  set_pev(id, pev_viewmodel2, "models/arme/v_ciocan.mdl")
	              set_pev(id, pev_weaponmodel2, "models/arme/p_ciocan.mdl")  
                  ChatColor(id, "!g[VIP] !yAi ales !teamCiocan Aruncator!")  
                 }
	         else
                   {
                  ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!")   
                   }
		}
		case 2:
		{
                if(is_user_alive(id))
                {
                abilitati(id)  
				ChatColor(id, "!g[VIP] !yAi deschis !teamMeniul de Abilitati !")  
                }
                else
                   {
                  ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!")   
                   }
		}
		case 3:
		{
		        if(smk[id])
				 {
				ChatColor(id, "!g[VIP] !yAi ales deja !teamSmoke Grenade!y runda asta!") 
				 }
	       else
                if(is_user_alive(id))
                {
                give_item(id, "weapon_smokegrenade")
				smk[id] = true;
                ChatColor(id, "!g[VIP] !yAi ales !teamSmoke Grenade!")  
                }
                else
                  {
                   ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!")   
                  }
		}
		case 4:
		{
               if(is_user_alive(id))
               {
			   	ham_strip_user_weapon(id,CSW_XM1014)
               engclient_cmd(id, "weapon_xm1014")
			   give_item(id, "weapon_xm1014")
			   cs_set_user_bpammo(id, CSW_XM1014, 200)
               arma[id] = 1;
               set_pev(id, pev_viewmodel2, "models/arme/v_arma.mdl")
	           set_pev(id, pev_weaponmodel2, "models/arme/p_arma.mdl")
               ChatColor(id, "!g[VIP] !yAi ales !teamarma xm1014!")  
                } 
		else
                  {
                  ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!")    
                  }
		}
	}
	
	menu_destroy(menu)
	return PLUGIN_HANDLED
	
}
//unlimited ammo
public give_ammo(id , wpnid , clip)
{
	if(!is_user_alive(id) && !is_user_vip(id) && has_ammo[id] != true )
		return;

	if(	wpnid==CSW_C4		||
		wpnid==CSW_KNIFE	||
		wpnid==CSW_HEGRENADE	||
		wpnid==CSW_SMOKEGRENADE	||
		wpnid==CSW_FLASHBANG	) 
			return;

	if(!clip)
	{
		static weapname[33];
		get_weaponname(wpnid , weapname , 32);

		static wpn
		wpn = -1;
		while((wpn = find_ent_by_class(wpn , weapname)) != 0)
		{
			if(id == entity_get_edict(wpn , EV_ENT_owner))
			{
				cs_set_weapon_ammo(wpn , maxclip(wpnid))
				break;
			}
		}
	}
}

stock maxclip(wpnid) 
{
	static ca;
	ca = 0;

	switch (wpnid) 
	{
		case CSW_P228 : ca = 13;
		case CSW_SCOUT : ca = 10;
		case CSW_HEGRENADE : ca = 0;
		case CSW_XM1014 : ca = 7;
		case CSW_C4 : ca = 0;
		case CSW_MAC10 : ca = 30;
		case CSW_AUG : ca = 30;
		case CSW_SMOKEGRENADE : ca = 0;
		case CSW_ELITE : ca = 15;
		case CSW_FIVESEVEN : ca = 20;
		case CSW_UMP45 : ca = 25;
		case CSW_SG550 : ca = 30;
		case CSW_GALI : ca = 35;
		case CSW_FAMAS : ca = 25;
		case CSW_USP : ca = 12;
		case CSW_GLOCK18 : ca = 20;
		case CSW_AWP : ca = 10;
		case CSW_MP5NAVY : ca = 30;
		case CSW_M249 : ca = 100;
		case CSW_M3 : ca = 8;
		case CSW_M4A1 : ca = 30;
		case CSW_TMP : ca = 30;
		case CSW_G3SG1 : ca = 20;
		case CSW_FLASHBANG : ca = 0;
		case CSW_DEAGLE	: ca = 7;
		case CSW_SG552 : ca = 30;
		case CSW_AK47 : ca = 30;
		case CSW_P90 : ca = 50;
	}
	return ca;
}

stock nade_flags()
{
	static buffer[8];
	get_pcvar_string(gCvar_flags , buffer , 7);

	return read_flags(buffer);
}
//stock
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")
    replace_all(msg, 190, "!y", "^1")
    replace_all(msg, 190, "!team", "^3")
    
    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();
            }
        }
    }
}
stock ham_strip_user_weapon(id, iCswId, iSlot = 0, bool:bSwitchIfActive = true)	//ConnorMcLeod
{
	new iWeapon
	if( !iSlot )
	{
		static const iWeaponsSlots[] = {
			-1,
			2, //CSW_P228
			-1,
			1, //CSW_SCOUT
			4, //CSW_HEGRENADE
			1, //CSW_XM1014
			5, //CSW_C4
			1, //CSW_MAC10
			1, //CSW_AUG
			4, //CSW_SMOKEGRENADE
			2, //CSW_ELITE
			2, //CSW_FIVESEVEN
			1, //CSW_UMP45
			1, //CSW_SG550
			1, //CSW_GALIL
			1, //CSW_FAMAS
			2, //CSW_USP
			2, //CSW_GLOCK18
			1, //CSW_AWP
			1, //CSW_MP5NAVY
			1, //CSW_M249
			1, //CSW_M3
			1, //CSW_M4A1
			1, //CSW_TMP
			1, //CSW_G3SG1
			4, //CSW_FLASHBANG
			2, //CSW_DEAGLE
			1, //CSW_SG552
			1, //CSW_AK47
			3, //CSW_KNIFE
			1 //CSW_P90
		}
		iSlot = iWeaponsSlots[iCswId]
	}

	const XTRA_OFS_PLAYER = 5
	const m_rgpPlayerItems_Slot0 = 367

	iWeapon = get_pdata_cbase(id, m_rgpPlayerItems_Slot0 + iSlot, XTRA_OFS_PLAYER)

	const XTRA_OFS_WEAPON = 4
	const m_pNext = 42
	const m_iId = 43

	while( iWeapon > 0 )
	{
		if( get_pdata_int(iWeapon, m_iId, XTRA_OFS_WEAPON) == iCswId )
		{
			break
		}
		iWeapon = get_pdata_cbase(iWeapon, m_pNext, XTRA_OFS_WEAPON)
	}

	if( iWeapon > 0 )
	{
		const m_pActiveItem = 373
		if( bSwitchIfActive && get_pdata_cbase(id, m_pActiveItem, XTRA_OFS_PLAYER) == iWeapon )
		{
			ExecuteHamB(Ham_Weapon_RetireWeapon, iWeapon)
		}

		if( ExecuteHamB(Ham_RemovePlayerItem, id, iWeapon) )
		{
			user_has_weapon(id, iCswId, 0)
			ExecuteHamB(Ham_Item_Kill, iWeapon)
			return 1
		}
	}

	return 0
}
User avatar
[Bio]King
Membru, skill 0
Membru, skill 0
Posts: 26
Joined: 28 Nov 2015, 19:20
Detinator Steam: Da
CS Status: Fericit
Detinator server CS: Bio.Max-CS.Ro
Fond eXtream: 0
Location: Bio.*** Reclama ***
Contact:

22 Dec 2015, 20:43

Bun merge dar acuma imi raman abilitatiele cumparate.. Gen daca sunt human si cumar viteza si ciocanu cand ma infecteaza imi raman.. Si daca poti sa-mi faci si faza aia cu arma.. cand cumar arma din shop sa nu o mai am pe aia gen m4a1.. So daca se poate ca invizibilitate sa fie cam 40% ..

Multumesc :*
Image
User avatar
^ionutz^
Fost moderator
Fost moderator
Posts: 1995
Joined: 05 Oct 2013, 15:12
Detinator Steam: Da
CS Status: activitate scazuta !
SteamID: /id/ionutz_cs/
Reputatie: Fost moderator ajutator
Location: Galati
Has thanked: 46 times
Been thanked: 23 times

22 Dec 2015, 21:19

vezi | Afiseaza codul
#include <amxmodx>
#include <fun>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta>
#include <engine>
#include <biohazard>
#pragma tabsize 0

#define ADMIN_ACCESS ADMIN_LEVEL_H
#define is_user(%1) (1 <= %1 <= maxPlayers)
#define HE_GRENADE	(1<<0)
#define SMOKE_GRENADE	(1<<1)
#define FLASH_GRENADE	(1<<2)
#define PRIMARY_WEAPONS_BITSUM		(1<<CSW_SCOUT | 1<<CSW_XM1014 | 1<<CSW_MAC10 | 1<<CSW_AUG | 1<<CSW_UMP45 | 1<<CSW_SG550 | 1<<CSW_GALIL | 1<<CSW_FAMAS | 1<<CSW_AWP | 1<<CSW_MP5NAVY | 1<<CSW_M249 | 1<<CSW_M3 | 1<<CSW_M4A1 | 1<<CSW_TMP | 1<<CSW_G3SG1 | 1<<CSW_SG552 | 1<<CSW_AK47 | 1<<CSW_P90)

new gCvar_flags;
new bool:has_ammo[33]
new maxPlayers;

new speed,gravity;
new ciocan[33],arma[33];
new g_armura[33],g_hp[33],smk[33], g_speed[33];
public plugin_init()
{
	register_plugin("VIP", "1.0", "D3luxe")
	
	register_clcmd("say /vm", "open_vip")
	register_clcmd("say /vipmenu", "open_vip")
	register_clcmd("say /vips", "ShowVipsOnline", ADMIN_ALL, "Show Vips Online");
	
	speed = register_cvar( "vipmenu_speed", "520.0" )
	gravity = register_cvar( "vipmenu_gravity", "0.6" )
	
	gCvar_flags = register_cvar("ammo_nade_flags" , "ac");
	register_event("CurWeapon", "Event_CurWeapon", "be", "1=1")   
	register_event("CurWeapon" , "event_CurWeapon" , "be" , "1=1");
	register_event("ResetHUD", "resetModel", "b")	 
	
	RegisterHam(Ham_Spawn, "player", "Spawn_player", 1)
	RegisterHam(Ham_TakeDamage, "player", "Player_TakeDamage")	 
	
	maxPlayers = get_maxplayers();
}
public plugin_precache()
{
	precache_model("models/arme/v_ciocan.mdl")
	precache_model("models/arme/p_ciocan.mdl")
	
	precache_model("models/arme/v_arma.mdl")
	precache_model("models/arme/p_arma.mdl")
	
	precache_model("models/player/vip/vip.mdl")//am pus asa pentru ca daca e server de zm nu are sens sa pui model cand playerul e zombie
}
public Spawn_player(id)
{
	if(is_user_alive(id) && is_user_connected(id))
	{
		set_user_rendering( id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 255 )
		has_ammo[id] = false;
		g_armura[id] = false;
		g_speed[id] = false;
		g_hp[id] = false;
		smk[id] = false;
		ciocan[id] = 0;
		arma[id] = 0;
	}
}
public resetModel(id, level, cid) 
{
	if(is_user_vip(id)) 
	{
		new CsTeams:userTeam = cs_get_user_team(id)
		if(userTeam == CS_TEAM_CT) 
		{
			cs_set_user_model(id, "vip")
			} else {
			cs_reset_user_model(id)
		}
	}
	return PLUGIN_CONTINUE
}
public event_CurWeapon(id)
{
	if(!(is_user_alive(id) && is_user_vip(id)) || is_user_infected(id))
		return PLUGIN_CONTINUE;
	
	if(g_speed[id])
		set_user_maxspeed(id, get_pcvar_float(speed));
	
	if(has_ammo[id])
	{
		static wpnid, clip;
		wpnid = read_data(2);
		clip = read_data(3);
		
		give_ammo(id , wpnid , clip);
	}
	
	return PLUGIN_CONTINUE;
}
public client_connect(id)
{
	has_ammo[id] = false;
	if(task_exists(id))
		remove_task(id);
}

public client_disconnect(id)
{
	has_ammo[id] = false;
	if(task_exists(id))
		remove_task(id);
}
bool:is_user_vip(id)
{
if(id < 0 || id > 32)
	return false
	
	if( !(get_user_flags(id) & ADMIN_ACCESS) )
		return false
	
	return true
}
public VipStatus(const MsgId, const MsgType, const MsgDest)
{
	static id;
	id = get_msg_arg_int(1);
	
	if(is_user_vip(id) && !get_msg_arg_int(2))
		set_msg_arg_int(2, ARG_BYTE, (1 << 2 ));
} 

public ShowVipsOnline(id)
{
	new message[256], name[32], count = 0;
	new len = format(message, charsmax(message), "Vip-uri online: ");
	
	for (new player = 1; player <= maxPlayers; player++)
	{
		if (is_user_connected(player) && is_user_vip(player))
		{
			get_user_name(player, name, charsmax(name));
			
			if (count && len)
			{
				len += format(message[len], 255 - len, ", ");
			}
			
			len += format(message[len], 255 - len, "%s", name);
			
			if (len > 96) {
				client_print(id, print_chat, "%s", message);
				len = format(message, charsmax(message), "");
			}
			
			count++;
		}
	}
	
	if (len)
	{
		if (!count)
		{
			len += format(message[len], 255 - len, "Nu este nici un vip online.");
		}
		
		client_print(id, print_chat, "%s", message);
	}
	
	return PLUGIN_HANDLED;
}

public Event_CurWeapon(player)
{
	if(!(ciocan[player] || arma[player]))
		return PLUGIN_CONTINUE
	
	if(!is_user_vip(player) || !is_user_alive(player) || is_user_infected(player))
		return PLUGIN_CONTINUE
	
	if(read_data(2) == CSW_KNIFE && ciocan[player] == 1)
	{
		set_pev(player, pev_viewmodel2, "models/arme/v_ciocan.mdl")
		set_pev(player, pev_weaponmodel2, "models/arme/p_ciocan.mdl")
	}
	if(read_data(2) == CSW_XM1014 && arma[player] == 1)
	{
		set_pev(player, pev_viewmodel2, "models/arme/v_arma.mdl")
		set_pev(player, pev_weaponmodel2, "models/arme/p_arma.mdl")
	}
	if(is_user_infected(player))
	{
		set_user_rendering( player, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 255 )
		has_ammo[player] = false;
		g_armura[player] = false;
		g_speed[player] = false;
		g_hp[player] = false;
		smk[player] = false;
		ciocan[player] = 0;
		arma[player] = 0;
	}
		
	return PLUGIN_CONTINUE
}

public Player_TakeDamage(victim, inflicator, attacker, Float:damage, damage_type, bitsDamage)
{
	if (!is_user(attacker) || !is_user(victim))
		return;
	
	if((get_user_weapon(attacker) == CSW_KNIFE) && !is_user_infected(attacker))		
	{
		if(pev(attacker, pev_button) & IN_ATTACK && ciocan[attacker] == 1)
		{
			user_slap(victim,0,0)
			user_slap(victim,0,0)
			user_slap(victim,0,0)
			user_slap(victim,0,0)
			SetHamParamFloat(4, damage = 100.0)
		}
		else if(pev(attacker, pev_button) & IN_ATTACK2 && ciocan[attacker] == 1)
		{
			user_slap(victim,0,0)
			user_slap(victim,0,0)
			user_slap(victim,0,0)
			user_slap(victim,0,0)
			user_slap(victim,0,0)
			user_slap(victim,0,0)
			SetHamParamFloat(4, damage = 100.0)
		}
	}
	if(get_user_weapon(attacker) == CSW_XM1014 )		
	{
		if(pev(attacker, pev_button) & IN_ATTACK && arma[attacker] == 1)
		{
			SetHamParamFloat(4, damage = 170.0)
		}
	}
}
public abilitati(id)
{
	if(!is_user_vip(id) || is_user_infected(id) || !is_user_alive(id) || is_user_zombie(id))
	{
		ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL!y deoarece nu esti VIP sau nu esti HUMAN!")
		return PLUGIN_HANDLED
	}
	else if(get_user_team(id) == 2 || !is_user_infected(id) )
	{
		new menu = menu_create( "\r[BIO.MAX-CS.RO] \yVIP \yMENU", "abilitati_handler" );
		
		menu_additem(menu, "\yInvizibilitate \r[80%inv.]", "1", 0); 
		menu_additem(menu, "\y250 \rHp", "2", 0);
		menu_additem(menu, "\y150 \rAp", "3", 0); 
		menu_additem(menu, "\ySpeed", "4", 0);
		menu_additem(menu, "\yGravity", "5", 0);
		menu_additem(menu, "\yAmmo Infinit \r[1 runda]", "6", 0);
		
		menu_setprop( menu, MPROP_EXITNAME, "Exit")
		menu_display( id, menu, 0);
	}
	return PLUGIN_CONTINUE;
}
public abilitati_handler(id, menu, item, client)
{
	if(item == MENU_EXIT || !is_user_alive(id) || is_user_infected(id) || is_user_zombie(id))
	{
		menu_destroy(menu)
		return PLUGIN_HANDLED
		
	}
	
	static data[6], name[64], acs, cllbck, key
	menu_item_getinfo(menu, item, acs, data, 5, name, 63, cllbck)
	key = str_to_num(data)
	switch(key)
	{
		case 1:
		{
			if(is_user_alive(id))
			{
				set_user_rendering( id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 35)
				ChatColor(id, "!g[VIP] !yAi ales !teamInvizibilitate[80% invizibilitate]!")  
			}
			else
			{
				ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!")   
			}
		}
		case 2: 
		{  
			if(g_hp[id])
			{
				ChatColor(id, "!g[VIP]!yAi !teamluat deja 250 hp!yrunda asta.")				
			}
			else   
				if(is_user_alive(id))
			{
				set_user_health(id, 250) 
				g_hp[id] = true;
				ChatColor(id, "!g[VIP]!yAi ales !team250 hp!")				
			}
			else
			{
				ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!")   
			}
		}
		case 3:
		{    
			if(g_armura[id])
			{
				ChatColor(id, "!g[VIP]!yAi !teamluat deja 150 armura !yrunda asta!")				
			}
			else  
				if(is_user_alive(id))
			{
				set_user_armor(id,150) 
				g_armura[id] = true;
				ChatColor(id, "!g[VIP]!yAi ales !team150 armura!")				
			}
			else
			{
				ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!")   
			}
		}
		case 4:
		{
			if(is_user_alive(id))
			{
				set_user_maxspeed(id, get_pcvar_float(speed))
				g_speed[id] = true;
				ChatColor(id, "!g[VIP] !yAi ales !teamSpeed!")  
			}
			else
			{
				ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!")   
			}
		}
		case 5:
		{
			if(is_user_alive(id))
			{
				set_user_gravity(id, get_pcvar_float(gravity))
				ChatColor(id, "!g[VIP] !yAi ales !teamGravity !")  
			}
			else
			{
				ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!")    
			}
		}
		case 6:
		{
			if(is_user_alive(id))
			{
				has_ammo[id] = true;
				ChatColor(id, "!g[VIP] !yAi ales !teamInfinite Ammo pentru o runda!")  
			}
			else
			{
				ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!")    
			}
		}
	}
	
	menu_destroy(menu)
	return PLUGIN_HANDLED
}
public open_vip(id)
{
	if(!is_user_vip(id) || is_user_infected(id) || !is_user_alive(id) || is_user_zombie(id))
	{
		ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL!y deoarece nu esti VIP sau nu esti HUMAN!")
		return PLUGIN_HANDLED
	}
	else if(get_user_team(id) == 2 || !is_user_infected(id))
	{
		new menu = menu_create( "\r[BIO.MAX-CS.RO] \yVIP \yMENU", "vip_handler" );
		
		menu_additem(menu, "\yCiocan \yAruncator \r[Slap]", "1", 0); 
		menu_additem(menu, "\yAbilitati", "2", 0);
		menu_additem(menu, "\ySmoke \yGrenade", "3", 0); 
		menu_additem(menu, "\yMX1014", "4", 0);
		
		menu_setprop( menu, MPROP_EXITNAME, "Exit")
		menu_display( id, menu, 0);
	}
	return PLUGIN_CONTINUE;
}
public vip_handler(id, menu, item, client)
{
	if(item == MENU_EXIT || !is_user_alive(id) || is_user_infected(id) || is_user_zombie(id))
	{
		menu_destroy(menu)
		return PLUGIN_HANDLED
		
	}
	
	static data[6], name[64], acs, cllbck, key
	menu_item_getinfo(menu, item, acs, data, 5, name, 63, cllbck)
	key = str_to_num(data)
	switch(key)
	{
		case 1:
		{
			if(is_user_alive(id))
			{
				engclient_cmd(id, "weapon_knife")
				ciocan[id] = 1
				set_pev(id, pev_viewmodel2, "models/arme/v_ciocan.mdl")
				set_pev(id, pev_weaponmodel2, "models/arme/p_ciocan.mdl")  
				ChatColor(id, "!g[VIP] !yAi ales !teamCiocan Aruncator!")  
			}
			else
			{
				ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!")   
			}
		}
		case 2:
		{
			if(is_user_alive(id))
			{
				abilitati(id)  
				ChatColor(id, "!g[VIP] !yAi deschis !teamMeniul de Abilitati !")  
			}
			else
			{
				ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!")   
			}
		}
		case 3:
		{
			if(smk[id])
			{
				ChatColor(id, "!g[VIP] !yAi ales deja !teamSmoke Grenade!y runda asta!") 
			}
			else
				if(is_user_alive(id))
			{
				give_item(id, "weapon_smokegrenade")
				smk[id] = true;
				ChatColor(id, "!g[VIP] !yAi ales !teamSmoke Grenade!")  
			}
			else
			{
				ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!")   
			}
		}
		case 4:
		{
			if(is_user_alive(id))
			{
				drop_primary_weapons(id)
				engclient_cmd(id, "weapon_xm1014")
				give_item(id, "weapon_xm1014")
				cs_set_user_bpammo(id, CSW_XM1014, 200)
				arma[id] = 1;
				set_pev(id, pev_viewmodel2, "models/arme/v_arma.mdl")
				set_pev(id, pev_weaponmodel2, "models/arme/p_arma.mdl")
				ChatColor(id, "!g[VIP] !yAi ales !teamarma xm1014!")  
			} 
			else
			{
				ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!")    
			}
		}
	}
	
	menu_destroy(menu)
	return PLUGIN_HANDLED
	
}
//unlimited ammo
public give_ammo(id , wpnid , clip)
{
	if(!is_user_alive(id) && !is_user_vip(id) && has_ammo[id] != true )
		return;
	
	if(	wpnid==CSW_C4		||
	wpnid==CSW_KNIFE	||
	wpnid==CSW_HEGRENADE	||
	wpnid==CSW_SMOKEGRENADE	||
	wpnid==CSW_FLASHBANG	) 
	return;
	
	if(!clip)
	{
		static weapname[33];
		get_weaponname(wpnid , weapname , 32);
		
		static wpn
		wpn = -1;
		while((wpn = find_ent_by_class(wpn , weapname)) != 0)
		{
			if(id == entity_get_edict(wpn , EV_ENT_owner))
			{
				cs_set_weapon_ammo(wpn , maxclip(wpnid))
				break;
			}
		}
	}
}

stock maxclip(wpnid) 
{
	static ca;
	ca = 0;
	
	switch (wpnid) 
	{
		case CSW_P228 : ca = 13;
			case CSW_SCOUT : ca = 10;
			case CSW_HEGRENADE : ca = 0;
			case CSW_XM1014 : ca = 7;
			case CSW_C4 : ca = 0;
			case CSW_MAC10 : ca = 30;
			case CSW_AUG : ca = 30;
			case CSW_SMOKEGRENADE : ca = 0;
			case CSW_ELITE : ca = 15;
			case CSW_FIVESEVEN : ca = 20;
			case CSW_UMP45 : ca = 25;
			case CSW_SG550 : ca = 30;
			case CSW_GALI : ca = 35;
			case CSW_FAMAS : ca = 25;
			case CSW_USP : ca = 12;
			case CSW_GLOCK18 : ca = 20;
			case CSW_AWP : ca = 10;
			case CSW_MP5NAVY : ca = 30;
			case CSW_M249 : ca = 100;
			case CSW_M3 : ca = 8;
			case CSW_M4A1 : ca = 30;
			case CSW_TMP : ca = 30;
			case CSW_G3SG1 : ca = 20;
			case CSW_FLASHBANG : ca = 0;
			case CSW_DEAGLE	: ca = 7;
			case CSW_SG552 : ca = 30;
			case CSW_AK47 : ca = 30;
			case CSW_P90 : ca = 50;
		}
	return ca;
}

stock nade_flags()
{
	static buffer[8];
	get_pcvar_string(gCvar_flags , buffer , 7);
	
	return read_flags(buffer);
}
//stock
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")
	replace_all(msg, 190, "!y", "^1")
	replace_all(msg, 190, "!team", "^3")
	
	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();
		}
	}
}
}
stock drop_primary_weapons(id) {
	if(is_user_alive(id)) {
		new Weapons[32], Num = 0, WeaponID;
		get_user_weapons(id, Weapons, Num);
		
		for(new i = 0; i < Num; i++) {
			WeaponID = Weapons;
			
			if(((1<<WeaponID) & PRIMARY_WEAPONS_BITSUM)) {
				new WName[32];
				get_weaponname(WeaponID, WName, charsmax(WName));
				
				engclient_cmd(id, "drop", WName);
			}
		}
	}
}
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 6 guests