Skocz do zawartości

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
 

Wklejka 104aqscs2oagn dodana przez FejmZPolski, 01.03.2015 14:32
Typ:



asd
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
137.
138.
139.
140.
141.
142.
143.
144.
145.
146.
147.
148.
149.
150.
151.
152.
153.
154.
155.
156.
157.
158.
159.
160.
161.
162.
163.
164.
165.
166.
167.
168.
169.
170.
171.
172.
173.
174.
175.
176.
177.
178.
179.
180.
181.
182.
183.
184.
185.
186.
187.
188.
189.
190.
191.
192.
193.
194.
195.
196.
197.
198.
199.
200.
201.
202.
203.
204.
205.
206.
207.
208.
209.
210.
211.
212.
213.
214.
215.
216.
217.
218.
219.
220.
221.
222.
223.
224.
225.
226.
227.
228.
229.
230.
231.
232.
233.
234.
235.
236.
237.
238.
239.
240.
241.
242.
243.
244.
245.
246.
247.
248.
249.
250.
251.
252.
253.
254.
255.
256.
257.
258.
259.
260.
261.
262.
263.
264.
265.
266.
267.
268.
269.
270.
271.
272.
273.
274.
275.
276.
277.
278.
279.
280.
281.
282.
283.
284.
285.
286.
287.
288.
//Bf2 Rank Mod VIP File
//Contains subroutines for all VIP features.
 
#if defined bf2_vip_included
#endinput
#endif
#define bf2_vip_included
 
new g_MsgSync;
new health_add, health_hs_add, health_max, nKiller, nKiller_hp, nHp_add, nHp_max, mpd, mkb, mhb;
new g_menu_active, g_menu_runda;
new bool:MaC4[33];
#define DAMAGE_RECIEVED
#define Keysrod (1<<0)|(1<<1)|(1<<9) // Keys: 1234567890
new round;
/* #if defined DAMAGE_RECIEVED
	new g_MsgSync2
#endif */
 
stock initVip()
{	
	new mapa[33]
	get_mapname(mapa, 32)
 
	if(!equali(mapa, "aim_", 4) || !equali(mapa, "awp_")) {
		return PLUGIN_HANDLED
	mpd = register_cvar("bf2_vip_money_per_damage","3")
	mkb = register_cvar("bf2_vip_money_kill_bonus","500")
	mhb = register_cvar("bf2_vip_money_hs_bonus","300")
	health_add = register_cvar("bf2_vip_hp", "15")
	health_hs_add = register_cvar("bf2_vip_hp_hs", "30")
	health_max = register_cvar("bf2_vip_max_hp", "200")
	g_menu_active = register_cvar("bf2_vip_menu", "1")
	g_menu_runda = register_cvar("bf2_vip_menu_runda", "3")
	g_MsgSync = CreateHudSyncObj()
 
	/* #if defined DAMAGE_RECIEVED
		g_MsgSync2 = CreateHudSyncObj()
	#endif */
	register_clcmd("say /vip","ShowMotd")
 
	register_event("DeathMsg", "hook_death", "a", "1>0")
	register_logevent("Round_Reset", 2, "1=Game_Commencing")
	register_event("TextMsg", "Round_Reset", "a", "2&Game_will_restart_in")
	register_event("Damage","Damage","b")
	register_event("Damage", "on_damage", "b", "2!0", "3=0", "4!0")
 
	register_clcmd("say /vips","ViPLista");
	register_clcmd("say_team /vips","ViPLista");
	return PLUGIN_CONTINUE
}
 
public ViPLista(id) 
{
	new nazwy_vip[33][32];
	new count, x;
 
	for(new i = 1 ; i <= gMaxPlayers ; i++)
	{
		if(is_user_connected(i))
		{
			if(get_user_flags(i) & VIP)
			{
				get_user_name(i, nazwy_vip[count++], 31);	
			}
		}
	}
 
	if(count > 0) 
	{
		for(x = 0 ; x < count ; x++) 
		{
			ColorChat(id, GREEN, "VIP'y ONLINE: %s%s", nazwy_vip[x], x < (count-1) ? ", ":"");
		}
	}
	else
	{
		ColorChat(id, GREEN, "Brak Vip'ow Online");
	}
 
	return PLUGIN_CONTINUE
}
 
public Round_Reset()
{
	round = 0;
}
 
public hook_death()
{
	// Killer id
	nKiller = read_data(1)
 
	if ( (read_data(3) == 1) && (read_data(5) == 0) )
	{
		nHp_add = get_pcvar_num (health_hs_add)
	}
	else
		nHp_add = get_pcvar_num (health_add)
	nHp_max = get_pcvar_num (health_max)
	// Updating Killer HP
	if(!(get_user_flags(nKiller) & VIP))
		return;
 
	nKiller_hp = get_user_health(nKiller)
	nKiller_hp += nHp_add
	// Maximum HP check
	if (nKiller_hp > nHp_max) nKiller_hp = nHp_max
	set_user_health(nKiller, nKiller_hp)
	// Hud message "Healed +15/+30 hp"
	set_hudmessage(0, 255, 0, -1.0, 0.15, 0, 1.0, 1.0, 0.1, 0.1, -1)
	show_hudmessage(nKiller, "Healed +%d hp", nHp_add)
	// Screen fading
	message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, nKiller)
	write_short(1<<10)
	write_short(1<<10)
	write_short(0x0000)
	write_byte(0)
	write_byte(0)
	write_byte(200)
	write_byte(75)
	message_end()
 
}
 
public menu_vip(id)
{
	new menu = menu_create("rV.I.P - Menu Broni:", "menu_vip_wybor")
 
	menu_additem(menu, "wM4A1r+wDeagler+wGranaty", "0", 0)
	menu_additem(menu, "wAK47r+wDeagler+wGranaty", "1", 0)
 
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
	menu_display(id, menu, 0)
}
 
public menu_vip_wybor(id, menu, item)
{
	if (item == MENU_EXIT)
	{
		menu_destroy(menu);
 
		return PLUGIN_HANDLED;
	}
	new data[6], iName[64];
	new acces, callback;
	menu_item_getinfo(menu, item, acces, data,5, iName, 63, callback);
 
	new key = str_to_num(data);
	new CsTeams:userTeam = cs_get_user_team(id);
 
	switch(key)
	{
		case 0:
		{
			if (user_has_weapon(id, CSW_C4) && userTeam == CS_TEAM_T)
			{
				MaC4[id] = true;
			}
			else
			{
				MaC4[id] = false;
			}
 
			strip_user_weapons(id);
			give_item(id,"weapon_m4a1")
			give_item(id,"ammo_556nato")
			give_item(id,"ammo_556nato")
			give_item(id,"ammo_556nato")
			give_item(id,"weapon_deagle")
			give_item(id,"ammo_50ae")
			give_item(id,"ammo_50ae")
			give_item(id,"ammo_50ae")
			give_item(id,"ammo_50ae")
			give_item(id,"ammo_50ae")
			give_item(id,"ammo_50ae")
			give_item(id,"ammo_50ae")
			give_item(id,"weapon_knife")
			give_item(id, "weapon_hegrenade");
			give_item(id, "weapon_flashbang");
			give_item(id, "weapon_flashbang");
			give_item(id, "weapon_smokegrenade");
			give_item(id, "item_assaultsuit");
			if (userTeam == CS_TEAM_CT)
			{
				give_item(id, "item_thighpack");
			}
 
			if(MaC4[id])
			{
				give_item(id, "weapon_c4");
				cs_set_user_plant(id, 1, 1);
			}
			menu_destroy(menu);
			return PLUGIN_HANDLED;	
		}		
		case 1:
		{
			if (user_has_weapon(id, CSW_C4) && userTeam == CS_TEAM_T)
			{
				MaC4[id] = true;
			}
			else
			{
				MaC4[id] = false;
			}
 
			strip_user_weapons (id)
			give_item(id,"weapon_ak47")
			give_item(id,"ammo_762nato")
			give_item(id,"ammo_762nato")
			give_item(id,"ammo_762nato")
			give_item(id,"weapon_deagle")
			give_item(id,"ammo_50ae")
			give_item(id,"ammo_50ae")
			give_item(id,"ammo_50ae")
			give_item(id,"ammo_50ae")
			give_item(id,"ammo_50ae")
			give_item(id,"ammo_50ae")
			give_item(id,"ammo_50ae")
			give_item(id,"weapon_knife")
			give_item(id, "weapon_hegrenade");
			give_item(id, "weapon_flashbang");
			give_item(id, "weapon_flashbang");
			give_item(id, "weapon_smokegrenade");
			give_item(id, "item_assaultsuit");
			if (userTeam == CS_TEAM_CT)
			{
				give_item(id, "item_thighpack");
			}
 
			if(MaC4[id])
			{
				give_item(id, "weapon_c4");
				cs_set_user_plant(id, 1, 1);
			}
			menu_destroy(menu);
			return PLUGIN_HANDLED;
		}
	}
	menu_destroy(menu);
	return PLUGIN_HANDLED;
}
 
public on_damage(id)
{
	new attacker = get_user_attacker(id)
 
	#if defined DAMAGE_RECIEVED
	// id should be connected if this message is sent, but lets check anyway
	if ( is_user_connected(id) && is_user_connected(attacker) )
	{
		if (get_user_flags(attacker) & VIP)
		{
			new damage = read_data(2)
 
			//set_hudmessage(255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1)
			//ShowSyncHudMsg(id, g_MsgSync2, "%i^n", damage)
			#else
			if ( is_user_connected(attacker) && if (get_user_flags(attacker) & VIP) )
			{
				new damage = read_data(2)
				#endif
				set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1)
				ShowSyncHudMsg(attacker, g_MsgSync, "%i^n", damage)
			}
		}
	}
 
public Damage(id)
{
	new weapon, hitpoint, attacker = get_user_attacker(id,weapon,hitpoint)
	if(attacker<=gMaxPlayers && is_user_alive(attacker) && attacker!=id)
	{
		if (get_user_flags(attacker) & VIP) 
		{
			new money = read_data(2) * get_pcvar_num(mpd)
			if(hitpoint==1) money += get_pcvar_num(mhb)
			cs_set_user_money(attacker,cs_get_user_money(attacker) + money)
		}
	}
}
 
public ShowMotd(id)
{
	show_motd(id, "vip.txt")
}
 

Dodanych wklejek: 4031
Powered By (Pav32) Pastebin © 2011