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 1do955rhej dodana przez Gość, 15.10.2012 08:02
Typ:



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.
289.
290.
291.
292.
293.
294.
295.
296.
297.
298.
299.
300.
301.
302.
303.
304.
305.
306.
307.
308.
309.
310.
311.
312.
313.
314.
315.
316.
317.
318.
319.
320.
//Bf2 Rank Mod events File
//Contains all the client command functions
 
#if defined bf2_events_included
  #endinput
#endif
#define bf2_events_included
 
//Normal register event functions..
public FM_CmdStart1(id, uc_handle)
{
	new button = get_uc(uc_handle, UC_Buttons);
	new oldbutton = get_user_oldbutton(id);
	new flags = get_entity_flags(id);
	new poziomagent = g_PlayerBadges[id][BADGE_AGENT];
 
	if((button & IN_JUMP) && !(flags & FL_ONGROUND) && !(oldbutton & IN_JUMP) && gPlayerJump[id] > 0 && poziomagent > LEVEL_UCZEN)
	{
		gPlayerJump[id]--;
		new Float:velocity[3];
		entity_get_vector(id,EV_VEC_velocity,velocity);
		velocity[2] = random_float(265.0,285.0);
		entity_set_vector(id,EV_VEC_velocity,velocity);
 
		}
		else if(flags & FL_ONGROUND)
		{	
		gPlayerJump[id] = 0;
 
		if(g_PlayerBadges[id][BADGE_AGENT]>LEVEL_UCZEN)
		{
			gPlayerJump[id]=1;
		}
	}
 
	if( ( ( button & IN_ATTACK2 ) && !( oldbutton & IN_ATTACK2 ) ) &&  poziomagent > LEVEL_EXPERT)
	{
		new weapon = get_user_weapon(id)
 
		if(weapon == CSW_AWP || weapon == CSW_SCOUT)
			return FMRES_IGNORED;
 
		if(weapon == CSW_DEAGLE && cs_get_user_zoom(id) != CS_SET_FIRST_ZOOM)
			cs_set_user_zoom(id,CS_SET_FIRST_ZOOM,1);
 
		else if(cs_get_user_zoom(id) == CS_SET_FIRST_ZOOM)
			cs_set_user_zoom(id,CS_SET_NO_ZOOM,1);
	}
	return FMRES_IGNORED;
}
 
public EmitSound1(id, iChannel, szSound[], Float:fVol, Float:fAttn, iFlags, iPitch )
{
	if(equal(szSound, "common/wpn_denyselect.wav"))
	{	if(!gPlayerMedkitUsed[id])
			Apteczka(id);
		return FMRES_SUPERCEDE;
	}
	return FMRES_IGNORED;
}
 
public Event_HLTV()
{
	freezetime = true;
}
 
public Event_CurWeapon(id)
{
	if ( !is_user_alive(id) || !get_pcvar_num(gPcvarBF2Active) )
		return;
 
	if ( !get_pcvar_num(gPcvarBadgePowers) )
		return;
 
	new weapon_id = read_data(2);
 
	g_invis[id] = false;
	g_grav[id] = false;
 
	if ( g_lastwpn[id] != weapon_id )
	{
		set_speed(id);
		set_invis(id);
		set_grav(id);
	}
 
	g_lastwpn[id] = weapon_id;
}
 
public Event_SetFOV(id)
{
	// Sniper rifle scoping can reset user speed lets fix that
 
	if ( !get_pcvar_num(gPcvarBF2Active) || !is_user_alive(id) ) return;
 
	new fov = read_data(1);
 
	if ( gCurrentFOV[id] != fov ) {
		gCurrentFOV[id] = fov;
 
		switch(g_lastwpn[id]) {
			// Only need to check speed for sniper rifles
			case  CSW_SCOUT, CSW_SG550, CSW_AWP, CSW_G3SG1: {
				set_speed(id);
			}
		}
	}
}
 
public Event_DeathMsg()
{
	// csx's client_death does not catch death by world
	// if killer is not a player lets check badges for the victim
	if ( 0 < read_data(1) <= gMaxPlayers ) return;
 
	check_badges(read_data(2));
 
	#if defined VIP_BF2
	if(read_data(1)<=gMaxPlayers && read_data(1) && read_data(1)!=read_data(2)) cs_set_user_money(read_data(1),cs_get_user_money(read_data(1)) + get_pcvar_num(mkb) - 300)
	#endif
}
 
public setTeam(id)
{
	g_friend[id] = read_data(2);
}
 
public on_HideStatus(id)
{
	// If miscstats PlayerName option is on do not show this info
	if ( get_xvar_num(gPlayerName) ) return;
 
	ClearSyncHud(id, gHudSyncAimInfo);
}
 
public flags_check()
{
	new temp[8];
	get_pcvar_string(gPcvarHudOptions, temp, 7);
 
	return read_flags(temp);
}
 
//called when id looks at someone, this needs to be rewritten into one function
public on_ShowStatus(id)
{
	// If miscstats PlayerName option is on do not show this info
	new statsHudMessage = get_xvar_num(gPlayerName);
 
	new pid = read_data(2);
	new pidrank = g_PlayerRank[pid];
	new flags = flags_check();
	new name[32];
	new color1 = 0, color2 = 0;
	new Float:height;
 
	get_user_name(pid, name, 31);
 
	if ( get_user_team(pid) == 1 )
		color1 = 255;
	else
		color2 = 255;
 
	if (flags & ABOVEHEAD)
		height=0.35;
	else
		height=0.60;
 
	if ( g_friend[id] == 1 )	// friend
	{
		if ( flags && !statsHudMessage )
		{
			new wpnid = get_user_weapon(pid);
			new wpnname[32];
 
			if ( wpnid )
				xmod_get_wpnname(wpnid, wpnname, 31);
 
			set_hudmessage(color1, 50, color2, -1.0, height, 1, 0.01, 3.0, 0.01, 0.01);
 
			if (flags & TEAMRANK)
			{
				if (flags & STATS)
					ShowSyncHudMsg(id, gHudSyncAimInfo, "%s : %s^n%d HP / %d AP / %s", name, gRankName[pidrank], get_user_health(pid), get_user_armor(pid), wpnname);
				else
					ShowSyncHudMsg(id, gHudSyncAimInfo, "%s : %s", name, gRankName[pidrank]);
			}
			else
			{
				if (flags & STATS)
					ShowSyncHudMsg(id, gHudSyncAimInfo, "%s^n%d HP / %d AP / %s", name, get_user_health(pid), get_user_armor(pid), wpnname);
				else
					ShowSyncHudMsg(id, gHudSyncAimInfo, "%s", name);
			}
		}
 
		new time = floatround(get_pcvar_float(gPcvarIconTime)*10);
		if ( time > 0 )
			Create_TE_PLAYERATTACHMENT(id, pid, 55, gSprite[pidrank], time);
	}
	else if ( flags && !statsHudMessage )
	{
		if (!((flags & HIDEINVIS) && (g_invis[pid])))
		{
			set_hudmessage(color1, 50, color2, -1.0, height, 1, 0.01, 3.0, 0.01, 0.01);
 
			if (flags & ENEMYRANK)
				ShowSyncHudMsg(id, gHudSyncAimInfo, "%s : %s", name, gRankName[pidrank]);
			else
				ShowSyncHudMsg(id, gHudSyncAimInfo, "%s", name);
		}
	}
}
 
public Message_Intermission()
{
#if defined SQL
	gIntermission = true;
#endif
	set_task(0.1, "award_check");
}
#if defined STANDARDOWY_HUD
public Message_StatusValue()
{
	if ( !get_pcvar_num(gPcvarBF2Active) || !get_pcvar_num(gPcvarStatusText) ) return; 
 
	//Block the name info, of person you aim at
	set_msg_block(gmsgStatusText, BLOCK_SET);
}
#endif
 
//Register logevent functions
 
public LogEvent_Round_End()
{
	new ent = -1
	while((ent = fm_find_ent_by_class(ent, "apteczka")))
	{
		engfunc(EngFunc_RemoveEntity,ent)
		g_count--
	}
	set_task(0.2, "badge_check_loop");
}
 
public LogEvent_Round_Start()
{
	freezetime = false;
 
	for(new i = 1; i <= gMaxPlayers; i++) {
		set_task(0.1, "set_speed", i);
	}
 
	#if defined MISJE
	for ( new id = 0; id <= gMaxPlayers; id++ )
	{
		if(!is_user_alive(id))
			continue;
 
		if(ma_misje[id])
		{
			if(3 < g_mission[id] <= 7)
			{
				ColorChat(id,TEAM_COLOR,"[BF2]^x03 Nie udalo Ci sie zapolowac na gracza! Tracisz^x04 100^x03 Punktow");
				if(totalkills[id] > 100)
				{
					totalkills[id] -= 100;
				}
				ma_misje[id] = false;
			}
			if(g_mission[id] == 8 && firstblood == 1)
			{
				ColorChat(id,TEAM_COLOR,"[BF2]^x03 Nie udalo Ci sie zabic jako pierwszy! Tracisz^x04 50^x03 Punktow");
				if(totalkills[id] > 50)
				{
					totalkills[id] -= 50;
				}
				ma_misje[id] = false;
			}
		}
		firstblood = 1;
	}
	#endif
 
	#if defined VIP_BF2
	round++;
	new players[32], player, pnum;
	get_players(players, pnum, "a");
	new runda = get_pcvar_num(g_menu_runda);
 
	for(new i = 0; i < pnum; i++)
	{
		player = players[i];
		if(get_user_flags(player) & ADMIN_LEVEL_H)
		{
			if(!get_pcvar_num(g_menu_active))
				return PLUGIN_CONTINUE
 
			if(!is_user_hltv(player) && !is_user_bot(player))
			{
				fm_give_item(player, "weapon_hegrenade");
				fm_give_item(player, "weapon_flashbang");
				fm_give_item(player, "weapon_flashbang");
				fm_give_item(player, "weapon_smokegrenade");
				fm_give_item(player, "item_assaultsuit");
				fm_give_item(player, "item_thighpack");
			}
 
			if(round > runda) 
			{
				menu_vip(player)
			}
		}
	}
	return PLUGIN_HANDLED
	#endif
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{ rtf1 ansi deff0{ fonttbl{ f0 fnil Tahoma;}}n viewkind4 uc1 pard lang1045 f0 fs16 n par }
*/
 

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