Plugin Gold Weapons

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

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

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
Damageee
Membru nou
Membru nou
Posts: 2
Joined: 17 Jul 2019, 15:12
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0

10 Aug 2019, 12:31

Plugin Cerut:Gold weapons
Descriere (adica ce face el mai exact): Sa scriu /vmenu si sa imi apara un meniu cu arme gold si sa dea 2x damage doar la vip, flagul "q", parca era ADMIN_LEVEL_E, armele pe care le vreau sa apara in meniu:AK47 + DEAGLE, M4A1 + DEAGLE si AWP + DEAGLE
Serverul ruleaza (HLDS/ReHLDS):ReHLDS
Versiune AMX Mod X:1.3.1
Modul Serverului:Furien
User avatar
L E V I N
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2552
Joined: 24 Aug 2011, 11:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Has thanked: 37 times
Been thanked: 387 times
Contact:

10 Aug 2019, 13:55

Code: Select all

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

#define VIP_LEVEL ADMIN_LEVEL_E //flag Q
#define VIP_BONUS_DMG 2.0
#define TAG "!v[!nESTRIKE!v]!n"

new const VWM[][] =
{
	"models/vip/v_m4a1_golden.mdl",
	"models/vip/v_ak47_golden.mdl",
	"models/vip/v_awp_golden.mdl",
	"models/vip/v_dg_golden.mdl"
}

new const WEAPONENTNAMES[][] =
{
	"weapon_m4a1",
	"weapon_ak47",
	"weapon_awp",
	"weapon_deagle"
}

#define is_valid_player(%1) (1 <= %1 <= g_MaxPlayers)

new bool:choice_m4[33],bool:choice_ak[33],bool:choice_awp[33],bool:choice_dg[33]

new g_MaxPlayers;

public plugin_init()
{
       register_clcmd ( "say /vmenu", "DisplayMenu",VIP_LEVEL );
       register_clcmd ( "say_team /vmenu", "DisplayMenu",VIP_LEVEL );

       RegisterHam(Ham_Spawn, "player", "PlayerSpawn", 1 )
       for (new i; i < sizeof WEAPONENTNAMES; i++)	if (WEAPONENTNAMES[i][0]) RegisterHam(Ham_Item_Deploy, WEAPONENTNAMES[i], "OnItemDeployPost", 1);
       RegisterHam(Ham_TakeDamage, "player", "player_damage",1)
       g_MaxPlayers = get_maxplayers();
}

public plugin_precache()	for (new i; i < sizeof VWM; i++)	precache_model(VWM[i]);

public DisplayMenu( id )
{
	new menu = menu_create( "Equipment", "menu_handler" )

	menu_additem( menu, "AK47 + DEAGLE", "1" )
	menu_additem( menu, "M4A1 + DEAGLE", "2" )
	menu_additem( menu, "AWP + DEAGLE", "3" )

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

public menu_handler( id, Menu, Item )
{
	if( Item < 0 || !is_user_alive(id) )	return 0;

	new Key[ 3 ],Access, CallBack;
	menu_item_getinfo( Menu, Item, Access, Key, 2, _, _, CallBack );
	new isKey = str_to_num( Key );

	switch( isKey )
	{
		case 1:
		{       
			choice_ak[id] =choice_dg[id]= true
			give_item(id, "weapon_ak47")     
			give_item(id, "weapon_deagle") 
			cs_set_user_bpammo(id, CSW_AK47, 90)
			cs_set_user_bpammo(id, CSW_DEAGLE, 35)
			xCoLoR(id,"%s Ai ales!e AK47!n+!vDEAGLE!n, spor la!e fraguri!n!",TAG)
		}
		case 2:
		{
			choice_m4[id] =choice_dg[id]= true
			give_item(id, "weapon_m4a1")     
			give_item(id, "weapon_deagle") 
			cs_set_user_bpammo(id, CSW_M4A1, 90)
			cs_set_user_bpammo(id, CSW_DEAGLE, 35)
			xCoLoR(id,"%s Ai ales!e M4A1!n+!vDEAGLE!n, spor la!e fraguri!n!",TAG)
		}
		case 3:
		{
			choice_awp[id] =choice_dg[id]= true
			give_item(id, "weapon_awp")     
			give_item(id, "weapon_deagle") 
			cs_set_user_bpammo(id, CSW_AWP, 30)
			cs_set_user_bpammo(id, CSW_DEAGLE, 35)
			xCoLoR(id,"%s Ai ales!e AWP!n+!vDEAGLE!n, spor la!e fraguri!n!",TAG)
		}  
	}
	menu_destroy(Menu) 
	return PLUGIN_HANDLED
}

public PlayerSpawn(id)
{
	if(is_user_connected(id)&&is_client_vip(id))
	{
		if(choice_m4[id])	choice_m4[id]=false
		if(choice_ak[id])	choice_ak[id]=false
		if(choice_awp[id])	choice_ak[id]=false
		if(choice_dg[id])	choice_dg[id]=false
	}
}

public player_damage(victim, inflictor, attacker, Float:damage, bits)
{
	if(!is_user_alive(attacker))	return HAM_IGNORED;
	if(is_valid_player(attacker)&&is_client_vip(attacker))
	{
		SetHamParamFloat(4, damage * VIP_BONUS_DMG)
		return HAM_SUPERCEDE;
	}

	return HAM_HANDLED;
}

public OnItemDeployPost(ent)
{
	if( pev_valid(ent) != 2 )	return
	static id; id = get_pdata_cbase(ent, 41, 4);

	if(pev_valid(id)&&is_user_alive(id)&&is_client_vip(id))
	{
	switch(cs_get_weapon_id(ent))//n am chef de enum....
	{
		case CSW_M4A1:
		{
			if(choice_m4[id])	set_pev(id, pev_viewmodel2, VWM[0])
			//set_pev(id, pev_weaponmodel2, "models/p_custom.mdl")
		}
		case CSW_AK47:	if(choice_ak[id])	set_pev(id, pev_viewmodel2, VWM[1])
		case CSW_AWP:	if(choice_awp[id])	set_pev(id, pev_viewmodel2, VWM[2])
		case CSW_DEAGLE:	if(choice_dg[id])	set_pev(id, pev_viewmodel2, VWM[3])
	}
	}
}

is_client_vip(id)
{
	if(get_user_flags(id) & VIP_LEVEL)	return true

	return false
}

stock xCoLoR(id, String[], any:...) 
{
	static szMesage[192];
	vformat(szMesage, charsmax(szMesage), String, 3);
	
	replace_all(szMesage, charsmax(szMesage), "!n", "^1");
	replace_all(szMesage, charsmax(szMesage), "!e", "^3");
	replace_all(szMesage, charsmax(szMesage), "!v", "^4");
	replace_all(szMesage, charsmax(szMesage), "!e2", "^0");
	
	static g_msg_SayText = 0;
	if(!g_msg_SayText)	g_msg_SayText = get_user_msgid("SayText");
	
	new Players[32], iNum = 1, i;

 	if(id) Players[0] = id;
	else get_players(Players, iNum, "c");
	
	for(--iNum; iNum >= 0; iNum--) 
	{
		i = Players[iNum];
		
		message_begin(MSG_ONE_UNRELIABLE, g_msg_SayText, _, i);
		write_byte(i);
		write_string(szMesage);
		message_end();
	}
}
Nu fac nimic contra cost! Faceți cerere bine detaliată aici, pe forum. Nu-mi mai dați add pe Steam doar pentru a mă avea în lista de prieteni.
Am cont și activez doar aici! Aveți grijă la cei ce încearcă să mă copieze..Puteți lua legătura cu mine dacă aveți o problemă/nelămurire în acest caz.
În cazul în care utilizați ceva din addonsurile postate de mine aici, e bine să fiți la curent cu modificările aduse unor plugine, aici.
Damageee
Membru nou
Membru nou
Posts: 2
Joined: 17 Jul 2019, 15:12
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0

10 Aug 2019, 15:15

e bug, pot sa iau si la tero armele, fa sa le pot lua doar la ct
User avatar
L E V I N
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2552
Joined: 24 Aug 2011, 11:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Has thanked: 37 times
Been thanked: 387 times
Contact:

10 Aug 2019, 16:58

ăsta nu e bug:))

Code: Select all

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

#define VIP_LEVEL ADMIN_LEVEL_E //flag Q
#define VIP_BONUS_DMG 2.0
#define TAG "!v[!nESTRIKE!v]!n"

new const VWM[][] =
{
	"models/vip/v_m4a1_golden.mdl",
	"models/vip/v_ak47_golden.mdl",
	"models/vip/v_awp_golden.mdl",
	"models/vip/v_dg_golden.mdl"
}

new const WEAPONENTNAMES[][] =
{
	"weapon_m4a1",
	"weapon_ak47",
	"weapon_awp",
	"weapon_deagle"
}

#define is_valid_player(%1) (1 <= %1 <= g_MaxPlayers)

new bool:choice_m4[33],bool:choice_ak[33],bool:choice_awp[33],bool:choice_dg[33]

new g_MaxPlayers;

public plugin_init()
{
       register_clcmd ( "say /vmenu", "DisplayMenu",VIP_LEVEL );
       register_clcmd ( "say_team /vmenu", "DisplayMenu",VIP_LEVEL );

       RegisterHam(Ham_Spawn, "player", "PlayerSpawn", 1 )
       for (new i; i < sizeof WEAPONENTNAMES; i++)	if (WEAPONENTNAMES[i][0]) RegisterHam(Ham_Item_Deploy, WEAPONENTNAMES[i], "OnItemDeployPost", 1);
       RegisterHam(Ham_TakeDamage, "player", "player_damage",1)
       g_MaxPlayers = get_maxplayers();
}

public plugin_precache()	for (new i; i < sizeof VWM; i++)	precache_model(VWM[i]);

public DisplayMenu( id )
{
	if(!is_user_alive(id)&&get_user_team(id)!=2)	return

	new menu = menu_create( "Equipment", "menu_handler" )

	menu_additem( menu, "AK47 + DEAGLE", "1" )
	menu_additem( menu, "M4A1 + DEAGLE", "2" )
	menu_additem( menu, "AWP + DEAGLE", "3" )

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

public menu_handler( id, Menu, Item )
{
	if( Item < 0 || !is_user_alive(id) )	return 0;

	new Key[ 3 ],Access, CallBack;
	menu_item_getinfo( Menu, Item, Access, Key, 2, _, _, CallBack );
	new isKey = str_to_num( Key );

	switch( isKey )
	{
		case 1:
		{       
			choice_ak[id] =choice_dg[id]= true
			give_item(id, "weapon_ak47")     
			give_item(id, "weapon_deagle") 
			cs_set_user_bpammo(id, CSW_AK47, 90)
			cs_set_user_bpammo(id, CSW_DEAGLE, 35)
			xCoLoR(id,"%s Ai ales!e AK47!n+!vDEAGLE!n, spor la!e fraguri!n!",TAG)
		}
		case 2:
		{
			choice_m4[id] =choice_dg[id]= true
			give_item(id, "weapon_m4a1")     
			give_item(id, "weapon_deagle") 
			cs_set_user_bpammo(id, CSW_M4A1, 90)
			cs_set_user_bpammo(id, CSW_DEAGLE, 35)
			xCoLoR(id,"%s Ai ales!e M4A1!n+!vDEAGLE!n, spor la!e fraguri!n!",TAG)
		}
		case 3:
		{
			choice_awp[id] =choice_dg[id]= true
			give_item(id, "weapon_awp")     
			give_item(id, "weapon_deagle") 
			cs_set_user_bpammo(id, CSW_AWP, 30)
			cs_set_user_bpammo(id, CSW_DEAGLE, 35)
			xCoLoR(id,"%s Ai ales!e AWP!n+!vDEAGLE!n, spor la!e fraguri!n!",TAG)
		}  
	}
	menu_destroy(Menu) 
	return PLUGIN_HANDLED
}

public PlayerSpawn(id)
{
	if(is_user_connected(id)&&is_client_vip(id))
	{
		if(choice_m4[id])	choice_m4[id]=false
		if(choice_ak[id])	choice_ak[id]=false
		if(choice_awp[id])	choice_ak[id]=false
		if(choice_dg[id])	choice_dg[id]=false
	}
}

public player_damage(victim, inflictor, attacker, Float:damage, bits)
{
	if(!is_user_alive(attacker))	return HAM_IGNORED;
	if(is_valid_player(attacker)&&is_client_vip(attacker))
	{
		SetHamParamFloat(4, damage * VIP_BONUS_DMG)
		return HAM_SUPERCEDE;
	}

	return HAM_HANDLED;
}

public OnItemDeployPost(ent)
{
	if( pev_valid(ent) != 2 )	return
	static id; id = get_pdata_cbase(ent, 41, 4);

	if(pev_valid(id)&&is_user_alive(id)&&is_client_vip(id))
	{
	switch(cs_get_weapon_id(ent))//n am chef de enum....
	{
		case CSW_M4A1:
		{
			if(choice_m4[id])	set_pev(id, pev_viewmodel2, VWM[0])
			//set_pev(id, pev_weaponmodel2, "models/p_custom.mdl")
		}
		case CSW_AK47:	if(choice_ak[id])	set_pev(id, pev_viewmodel2, VWM[1])
		case CSW_AWP:	if(choice_awp[id])	set_pev(id, pev_viewmodel2, VWM[2])
		case CSW_DEAGLE:	if(choice_dg[id])	set_pev(id, pev_viewmodel2, VWM[3])
	}
	}
}

is_client_vip(id)
{
	if(get_user_flags(id) & VIP_LEVEL)	return true

	return false
}

stock xCoLoR(id, String[], any:...) 
{
	static szMesage[192];
	vformat(szMesage, charsmax(szMesage), String, 3);
	
	replace_all(szMesage, charsmax(szMesage), "!n", "^1");
	replace_all(szMesage, charsmax(szMesage), "!e", "^3");
	replace_all(szMesage, charsmax(szMesage), "!v", "^4");
	replace_all(szMesage, charsmax(szMesage), "!e2", "^0");
	
	static g_msg_SayText = 0;
	if(!g_msg_SayText)	g_msg_SayText = get_user_msgid("SayText");
	
	new Players[32], iNum = 1, i;

 	if(id) Players[0] = id;
	else get_players(Players, iNum, "c");
	
	for(--iNum; iNum >= 0; iNum--) 
	{
		i = Players[iNum];
		
		message_begin(MSG_ONE_UNRELIABLE, g_msg_SayText, _, i);
		write_byte(i);
		write_string(szMesage);
		message_end();
	}
}
Nu fac nimic contra cost! Faceți cerere bine detaliată aici, pe forum. Nu-mi mai dați add pe Steam doar pentru a mă avea în lista de prieteni.
Am cont și activez doar aici! Aveți grijă la cei ce încearcă să mă copieze..Puteți lua legătura cu mine dacă aveți o problemă/nelămurire în acest caz.
În cazul în care utilizați ceva din addonsurile postate de mine aici, e bine să fiți la curent cu modificările aduse unor plugine, aici.
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: Bing [Bot] and 18 guests