Skocz do zawartości

  • Zaloguj korzystając z Facebooka Zaloguj korzystając z Twittera Zaloguj przez Steam Zaloguj poprzez Google      Logowanie »   
  • Rejestracja

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.

  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

Problem Menu vipa.


  • Nie możesz napisać tematu
  • Zaloguj się, aby dodać odpowiedź
1 odpowiedź w tym temacie

#1 susel

    Pomocny

  • Użytkownik

Reputacja: 3
Nowy

  • Postów:45
  • Lokalizacja:Pisz
Offline

Napisano 24.08.2014 11:13

Witam mam problem z menu wyborem broni vipa. Chodzi o to gdy jesteśmy w ct to nie dostajemy np.ak47,galila i nie wiem jak to naprawić.

#include <amxmodx>
#include <colorchat>
#include <cstrike>
#include <engine>
#include <fakemeta>
#include <fun>
#include <hamsandwich>
#include <stripweapons>

#define IsPlayer(%1) (1<=%1<=maxPlayers)

forward amxbans_admin_connect(id);

new Array:g_Array, CsArmorType:armortype, bool:g_Vip[33], gRound=0, g_Hudmsg,
ioid, maxPlayers, menu,  skoki[33],
weapon_id;

new const g_Langcmd[][]={"say /vips","say_team /vips","say /vipy","say_team /vipy"};
new const g_Prefix[] = "Vip Chat";

public plugin_init(){
	register_plugin("VIP Ultimate", "12.3.0.2", "benio101 & speedkill");
	register_forward(FM_CmdStart, "CmdStartPre");
	RegisterHam(Ham_Spawn, "player", "SpawnedEventPre", 1);
	register_event("HLTV", "event_new_round", "a", "1=0", "2=0");
	register_logevent("GameCommencing", 2, "1=Game_Commencing");
	RegisterHam(Ham_TakeDamage, "player", "takeDamage", 0);
	register_event("DeathMsg", "DeathMsg", "a");
	register_message(get_user_msgid("ScoreAttrib"), "VipStatus");
	g_Array=ArrayCreate(64,32);
	for(new i;i<sizeof g_Langcmd;i++){
		register_clcmd(g_Langcmd[i], "ShowVips");
	}
	register_clcmd("say /vip", "ShowMotd");
	register_clcmd("say_team", "VipChat");
	g_Hudmsg=CreateHudSyncObj();
	register_logevent("RoundEnd", 2, "1=Round_End");
}
public client_authorized(id){
	if(get_user_flags(id) & ADMIN_LEVEL_G){
		client_authorized_vip(id);
	}
}
public client_authorized_vip(id){
	g_Vip[id]=true;
	new g_Name[64];
	get_user_name(id,g_Name,charsmax(g_Name));
	
	new g_Size = ArraySize(g_Array);
	new szName[64];
	
	for(new i = 0; i < g_Size; i++){
		ArrayGetString(g_Array, i, szName, charsmax(szName));
		
		if(equal(g_Name, szName)){
			return 0;
		}
	}
	ArrayPushString(g_Array,g_Name);
	set_hudmessage(24, 190, 220, 0.25, 0.2, 0, 6.0, 6.0);
	ShowSyncHudMsg(0, g_Hudmsg, "SuperVip (%s) wbija na serwer !",g_Name);
	
	return PLUGIN_CONTINUE;
}
public client_disconnect(id){
	if(g_Vip[id]){
		client_disconnect_vip(id);
	}
}
public client_disconnect_vip(id){
	g_Vip[id]=false;
	new Name[64];
	get_user_name(id,Name,charsmax(Name));
	
	new g_Size = ArraySize(g_Array);
	new g_Name[64];
	
	for(new i = 0; i < g_Size; i++){
		ArrayGetString(g_Array, i, g_Name, charsmax(g_Name));
		
		if(equal(g_Name,Name)){
			ArrayDeleteItem(g_Array,i);
			break;
		}
	}
}
public CmdStartPre(id, uc_handle){
	if(g_Vip[id]){
		if(is_user_alive(id)){
			CmdStartPreVip(id, uc_handle);
		}
	}
}
public CmdStartPreVip(id, uc_handle){
	new flags = pev(id, pev_flags);
	if((get_uc(uc_handle, UC_Buttons) & IN_JUMP) && !(flags & FL_ONGROUND) && !(pev(id, pev_oldbuttons) & IN_JUMP) && skoki[id]>0){
		--skoki[id];
		new Float:velocity[3];
		pev(id, pev_velocity,velocity);
		velocity[2] = random_float(265.0,285.0);
		set_pev(id,pev_velocity,velocity);
	} else if(flags & FL_ONGROUND && skoki[id]!=-1){
		skoki[id] = 2;
	}
}
public SpawnedEventPre(id){
	if(g_Vip[id]){
		if(is_user_alive(id)){
			SpawnedEventPreVip(id);
		}
	}
}
public SpawnedEventPreVip(id){
	skoki[id]=2;
	set_user_health(id, get_user_health(id)+80);
	cs_set_user_armor(id, min(cs_get_user_armor(id,armortype)+100, 100), armortype);
	show_vip_menu(id);
	new g_Model[64];
	formatex(g_Model,charsmax(g_Model),"%s",get_user_team(id) == 1 ? "BractwoSvipTT" : "BractwoSvipCT");
	cs_set_user_model(id,g_Model);
	if(get_user_team(id)==1){
		new sgnum=(user_has_weapon(id,CSW_SMOKEGRENADE)?cs_get_user_bpammo(id,CSW_SMOKEGRENADE):0);
		if(!sgnum && sgnum<1){
			give_item(id, "weapon_smokegrenade");
			++sgnum;
		}
	}
	if(gRound>=2){
		if(get_user_team(id)==1){
			cs_set_user_nvg(id);
		}
	}
}
public menu_1_handler(id){
	StripWeapons(id, Secondary);
	give_item(id, "weapon_deagle");
	give_item(id, "ammo_50ae");
	weapon_id=find_ent_by_owner(-1, "weapon_deagle", id);
	if(weapon_id)cs_set_weapon_ammo(weapon_id, 7);
	cs_set_user_bpammo(id, CSW_DEAGLE, 35);
	StripWeapons(id, Primary);
	give_item(id, "weapon_ak47");
	give_item(id, "ammo_762nato");
	weapon_id=find_ent_by_owner(-1, "weapon_ak47", id);
	if(weapon_id)cs_set_weapon_ammo(weapon_id, 30);
	cs_set_user_bpammo(id, CSW_AK47, 90);
	StripWeapons(id, Primary);
	give_item(id, "weapon_m4a1");
	give_item(id, "ammo_556nato");
	weapon_id=find_ent_by_owner(-1, "weapon_m4a1", id);
	if(weapon_id)cs_set_weapon_ammo(weapon_id, 30);
	cs_set_user_bpammo(id, CSW_M4A1, 90);
}
public menu_2_handler(id){
	StripWeapons(id, Secondary);
	give_item(id, "weapon_deagle");
	give_item(id, "ammo_50ae");
	weapon_id=find_ent_by_owner(-1, "weapon_deagle", id);
	if(weapon_id)cs_set_weapon_ammo(weapon_id, 7);
	cs_set_user_bpammo(id, CSW_DEAGLE, 35);
	StripWeapons(id, Primary);
	give_item(id, "weapon_ak47");
	give_item(id, "ammo_762nato");
	weapon_id=find_ent_by_owner(-1, "weapon_ak47", id);
	if(weapon_id)cs_set_weapon_ammo(weapon_id, 30);
	cs_set_user_bpammo(id, CSW_AK47, 90);
	StripWeapons(id, Primary);
	give_item(id, "weapon_awp");
	give_item(id, "ammo_338magnum");
	weapon_id=find_ent_by_owner(-1, "weapon_awp", id);
	if(weapon_id)cs_set_weapon_ammo(weapon_id, 10);
	cs_set_user_bpammo(id, CSW_AWP, 30);
}
public menu_3_handler(id){
	StripWeapons(id, Secondary);
	give_item(id, "weapon_deagle");
	give_item(id, "ammo_50ae");
	weapon_id=find_ent_by_owner(-1, "weapon_deagle", id);
	if(weapon_id)cs_set_weapon_ammo(weapon_id, 7);
	cs_set_user_bpammo(id, CSW_DEAGLE, 35);
	StripWeapons(id, Primary);
	give_item(id, "weapon_m4a1");
	give_item(id, "ammo_556nato");
	weapon_id=find_ent_by_owner(-1, "weapon_m4a1", id);
	if(weapon_id)cs_set_weapon_ammo(weapon_id, 30);
	cs_set_user_bpammo(id, CSW_M4A1, 90);
	StripWeapons(id, Primary);
	give_item(id, "weapon_awp");
	give_item(id, "ammo_338magnum");
	weapon_id=find_ent_by_owner(-1, "weapon_awp", id);
	if(weapon_id)cs_set_weapon_ammo(weapon_id, 10);
	cs_set_user_bpammo(id, CSW_AWP, 30);
}
public menu_4_handler(id){
	StripWeapons(id, Secondary);
	give_item(id, "weapon_deagle");
	give_item(id, "ammo_50ae");
	weapon_id=find_ent_by_owner(-1, "weapon_deagle", id);
	if(weapon_id)cs_set_weapon_ammo(weapon_id, 7);
	cs_set_user_bpammo(id, CSW_DEAGLE, 35);
	StripWeapons(id, Primary);
	give_item(id, "weapon_mac10");
	give_item(id, "ammo_45acp");
	weapon_id=find_ent_by_owner(-1, "weapon_mac10", id);
	if(weapon_id)cs_set_weapon_ammo(weapon_id, 30);
	cs_set_user_bpammo(id, CSW_MAC10, 100);
	StripWeapons(id, Primary);
	give_item(id, "weapon_aug");
	give_item(id, "ammo_556nato");
	weapon_id=find_ent_by_owner(-1, "weapon_aug", id);
	if(weapon_id)cs_set_weapon_ammo(weapon_id, 30);
	cs_set_user_bpammo(id, CSW_AUG, 90);
}
public menu_5_handler(id){
	StripWeapons(id, Secondary);
	give_item(id, "weapon_deagle");
	give_item(id, "ammo_50ae");
	weapon_id=find_ent_by_owner(-1, "weapon_deagle", id);
	if(weapon_id)cs_set_weapon_ammo(weapon_id, 7);
	cs_set_user_bpammo(id, CSW_DEAGLE, 35);
	StripWeapons(id, Primary);
	give_item(id, "weapon_galil");
	give_item(id, "ammo_556nato");
	weapon_id=find_ent_by_owner(-1, "weapon_galil", id);
	if(weapon_id)cs_set_weapon_ammo(weapon_id, 35);
	cs_set_user_bpammo(id, CSW_GALI, 90);
	StripWeapons(id, Primary);
	give_item(id, "weapon_m249");
	give_item(id, "ammo_556natobox");
	weapon_id=find_ent_by_owner(-1, "weapon_m249", id);
	if(weapon_id)cs_set_weapon_ammo(weapon_id, 100);
	cs_set_user_bpammo(id, CSW_M249, 200);
}
public menu_6_handler(id){
	StripWeapons(id, Secondary);
	give_item(id, "weapon_deagle");
	give_item(id, "ammo_50ae");
	weapon_id=find_ent_by_owner(-1, "weapon_deagle", id);
	if(weapon_id)cs_set_weapon_ammo(weapon_id, 7);
	cs_set_user_bpammo(id, CSW_DEAGLE, 35);
	StripWeapons(id, Primary);
	give_item(id, "weapon_famas");
	give_item(id, "ammo_556nato");
	weapon_id=find_ent_by_owner(-1, "weapon_famas", id);
	if(weapon_id)cs_set_weapon_ammo(weapon_id, 25);
	cs_set_user_bpammo(id, CSW_FAMAS, 90);
	StripWeapons(id, Primary);
	give_item(id, "weapon_scout");
	give_item(id, "ammo_762nato");
	weapon_id=find_ent_by_owner(-1, "weapon_scout", id);
	if(weapon_id)cs_set_weapon_ammo(weapon_id, 10);
	cs_set_user_bpammo(id, CSW_SCOUT, 90);
}
public menu_7_handler(id){
	StripWeapons(id, Secondary);
	give_item(id, "weapon_deagle");
	give_item(id, "ammo_50ae");
	weapon_id=find_ent_by_owner(-1, "weapon_deagle", id);
	if(weapon_id)cs_set_weapon_ammo(weapon_id, 7);
	cs_set_user_bpammo(id, CSW_DEAGLE, 35);
	StripWeapons(id, Primary);
	give_item(id, "weapon_m3");
	give_item(id, "ammo_buckshot");
	weapon_id=find_ent_by_owner(-1, "weapon_m3", id);
	if(weapon_id)cs_set_weapon_ammo(weapon_id, 8);
	cs_set_user_bpammo(id, CSW_M3, 32);
	StripWeapons(id, Primary);
	give_item(id, "weapon_p90");
	give_item(id, "ammo_57mm");
	weapon_id=find_ent_by_owner(-1, "weapon_p90", id);
	if(weapon_id)cs_set_weapon_ammo(weapon_id, 50);
	cs_set_user_bpammo(id, CSW_P90, 100);
}
public event_new_round(){
	++gRound;
}
public GameCommencing(){
	gRound=0;
}
public plugin_cfg(){
	maxPlayers=get_maxplayers();
}
public takeDamage(this, idinflictor, idattacker, Float:damage, damagebits){
	if(((IsPlayer(idattacker) && is_user_connected(idattacker) && g_Vip[idattacker] && (ioid=idattacker)) ||
	(ioid=pev(idinflictor, pev_owner) && IsPlayer(ioid) && is_user_connected(ioid) && g_Vip[ioid]))){
		if(get_user_team(ioid)==1){
			damage*=(100+10)/100;
		}
	}
}
public DeathMsg(){
	new killer=read_data(1);
	new victim=read_data(2);
	
	if(is_user_alive(killer) && g_Vip[killer] && get_user_team(killer) != get_user_team(victim)){
		DeathMsgVip(killer,victim,read_data(3));
	}
}
public DeathMsgVip(kid,vid,hs){
	if(get_user_team(kid)==1){
		cs_set_user_money(kid, cs_get_user_money(kid)+(hs?300:150));
	}
}
public show_vip_menu(id) {
	menu = menu_create("\rMenu Vip'a:", "menu_handler");
	menu_additem(menu, "\wAK47+M4A1", "1", 0);
	menu_additem(menu, "\wAK47+AWP", "2", 0);
	menu_additem(menu, "\wM4A1+AWP", "3", 0);
	menu_additem(menu, "\wUZI+AUG", "4", 0);
	menu_additem(menu, "\wKROWA+GALIL", "5", 0);
	menu_additem(menu, "\wSCOUT+FAMAS", "6", 0);
	menu_additem(menu, "\wP90+M3", "7", 0);

	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);

	menu_display(id, menu, 0);
}
public VipStatus(){
	new id=get_msg_arg_int(1);
	if(is_user_alive(id) && g_Vip[id]){
		set_msg_arg_int(2, ARG_BYTE, get_msg_arg_int(2)|4);
	}
}
public ShowVips(id){
	new g_Name[64],g_Message[192];
	
	new g_Size=ArraySize(g_Array);
	
	for(new i = 0; i < g_Size; i++){
		ArrayGetString(g_Array, i, g_Name, charsmax(g_Name));
		
		add(g_Message, charsmax(g_Message), g_Name);
		
		if(i == g_Size - 1){
			add(g_Message, charsmax(g_Message), ".");
		}
		else{
			add(g_Message, charsmax(g_Message), ", ");
		}
	}
	ColorChat(id,GREEN,"^x03SuperVipy ^x04na ^x03serwerze: ^x04%s", g_Message);
	return PLUGIN_CONTINUE;
}
public client_infochanged(id){
	if(g_Vip[id]){
		new szName[64];
		get_user_info(id,"name",szName,charsmax(szName));
		
		new Name[64];
		get_user_name(id,Name,charsmax(Name));
		
		if(!equal(szName,Name)){
			ArrayPushString(g_Array,szName);
			
			new g_Size=ArraySize(g_Array);
			new g_Name[64];
			for(new i = 0; i < g_Size; i++){
				ArrayGetString(g_Array, i, g_Name, charsmax(g_Name));
				
				if(equal(g_Name,Name)){
					ArrayDeleteItem(g_Array,i);
					break;
				}
			}
		}
	}
}
public plugin_end(){
	ArrayDestroy(g_Array);
}
public ShowMotd(id){
	show_motd(id, "vip.txt", "Informacje o vipie");
}
public VipChat(id){
	if(g_Vip[id]){
		new g_Msg[256],
		g_Text[256];
		
		read_args(g_Msg,charsmax(g_Msg));
		remove_quotes(g_Msg);
		
		if(g_Msg[0] == '*' && g_Msg[1]){
			new g_Name[64];
			get_user_name(id,g_Name,charsmax(g_Name));
			
			formatex(g_Text,charsmax(g_Text),"^x01(%s) ^x03%s : ^x04%s",g_Prefix, g_Name, g_Msg[1]);
			
			for(new i=1;i<33;i++){
				if(is_user_connected(i) && g_Vip[i])
				ColorChat(i, GREEN, "%s", g_Text);
			}
			return PLUGIN_HANDLED_MAIN;
		}
	}
	return PLUGIN_CONTINUE;
}
public plugin_precache(){
	precache_model("models/player/BractwoSvipCT/BractwoSvipCT.mdl");
	precache_model("models/player/BractwoSvipTT/BractwoSvipTT.mdl");
}
public RoundEnd(){
	for(new i = 1; i <= maxPlayers; i++){
		if(is_user_alive(i) && g_Vip[i]){
			cs_set_user_money(i,cs_get_user_money(i) + 300);
		}
	}
}
public amxbans_admin_connect(id){
	client_authorized(id);
}
public menu_handler(id, menu, item)
{
	if (item == MENU_EXIT)
	{
		menu_destroy(menu);
		return PLUGIN_HANDLED;
	}
	new data[8], iName[64];
	new zaccess, callback;
	menu_item_getinfo(menu, item, zaccess, data,7, iName, 64, callback);
	new key = str_to_num(data)

	switch(key)
	{
		case 1: menu_1_handler(id)
		case 2: menu_2_handler(id)
		case 3: menu_3_handler(id)
		case 4: menu_4_handler(id)
		case 5: menu_5_handler(id)
		case 6: menu_6_handler(id)
		case 7: menu_7_handler(id)
	}
	menu_destroy(menu);
	return PLUGIN_HANDLED;
}

  • +
  • -
  • 0

b_350_20_385732_224320_33F115_111111.png


#2 susel

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: 3
Nowy

  • Postów:45
  • Lokalizacja:Pisz
Offline

Napisano 25.08.2014 08:53

help me


  • +
  • -
  • 0

b_350_20_385732_224320_33F115_111111.png





Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych