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 1vq0353o5qof8 dodana przez HaDeS From HELL, 15.05.2014 12:16
Typ:



reborn
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.
/* Plugin generated by AMXX-Studio */
 
#include <amxmodx>
#include <amxmisc>
#include <codmod>
#include <ColorChat>
#include <fun>
#include <nvault>
#include <hamsandwich>
 
#define PLUGIN "Reborn System"
#define VERSION "1.0"
#define AUTHOR "Na 5tyk"
 
#define DMG_BULLET (1<<1)
 
#define LVL 100 //Od jakiego LVLa mozna robic reborny
#define MAX 50 //Ile max rebornow
#define SPADA 1 //Na jaki poziom się spada
 
new reborn[33];
new nick[33][64];
 
new vault;
 
 
public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
 
	register_clcmd("say /reborn", "Menu");
	register_clcmd("say_team /reborn", "Menu");
 
	register_event("ResetHUD", "ResetHUD", "abe");
	register_event("DeathMsg", "DeathMsg", "a");
 
	RegisterHam(Ham_Spawn, "player", "Odrodzenie", 1);
	RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
 
	vault = nvault_open("Reborn");
}
 
public plugin_natives()
{
	register_native("cod_reborn", "PobierzReborna", 1);
}	
 
public client_connect(id)
{
	get_user_name(id, nick[id], 63);
 
	Wczytaj(id);
}
 
public client_disconnect(id)
{
	Zapisz(id);
}
 
public Zapisz(id)
{
	new vaultkey[64], vaultdata[256]; 
	format(vaultkey, 63, "%s-PLAYER", nick[id]); 
	format(vaultdata, 255, "%i", reborn[id]);
 
	nvault_set(vault, vaultkey, vaultdata); 
 
	return 0;
}
 
public Wczytaj(id)
{	
	new vaultkey[64], vaultdata[256]; 
	format(vaultkey, 63, "%s-PLAYER", nick[id]); 
	format(vaultdata, 255, "%i", reborn[id]);
 
	nvault_get(vault, vaultkey, vaultdata, 255); 
 
	replace_all(vaultdata, 255, "#", " "); 
 
	new reb[32];
 
 
	parse(vaultdata, reb, 31);
 
 
	reborn[id] = str_to_num(reb);
 
	return 0;
}
 
public Menu(id)
{
	new brak = LVL - cod_get_user_level(id)
	new b[100];
	if(brak < LVL)
		format(b, charsmax(b), "Do reborna brakuje Ci r%i wLevel", brak);
	else
		format(b, charsmax(b), "Mozesz zrobic Reborna!");
 
	new menu = menu_create("Reborn Menu", "handle");
 
	menu_additem(menu, "Zrob reborna");
	menu_additem(menu, "Opis");
	menu_addtext(menu, b);
	menu_display(id, menu);
}
 
public handle(id, menu, key)
{
	switch(key)
	{
		case 0:
		{
			if(cod_get_user_level(id) > LVL && reborn[id] < MAX)
			{
				new potrzeba;
				potrzeba = cod_get_level_xp(SPADA-1);
				cod_set_user_xp(id, potrzeba);
				reborn[id]++;
			}
			else
			{
				ColorChat(id, RED, "^x04[COD:MW] ^x01Masz za maly pozoim lub masz juz maxymalny poziom rebornow!");
			}
		}
		case 1:
		{
			ColorChat(id, RED, "^x04[COD:MW] ^x01Po zrobieniu reborna masz wiecej HP, wieksze obrazenia oraz szybciej leci ci EXP!");
		}
	}
}
 
 
public Odrodzenie(id)
{
	if(!is_user_alive(id) || !is_user_connected(id))
		return PLUGIN_CONTINUE;
 
	if(cod_get_user_level(id) > LVL)
		ColorChat(id, RED, "^x04[COD:MW] ^x01Posiadasz wystarczajacy poziom aby zrobic reborna! Wpisz ^x04/reborn");
 
	new ile = reborn[id]*20;
 
	if(reborn[id] > 0)
		set_user_health(id, get_user_health(id) + ile);
}
 
public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
	new Float:ile = reborn[idattacker]*2.0
	if(!is_user_connected(idattacker))
		return HAM_IGNORED;
 
	if(get_user_team(this) != get_user_team(idattacker) && damagebits & DMG_BULLET)
		cod_inflict_damage(idattacker, this, ile, 0.0, idinflictor, damagebits);
 
	return HAM_IGNORED;
}
 
public DeathMsg(){
	new killer=read_data(1);
	new victim=read_data(2);
 
	if(is_user_alive(killer) && get_user_team(killer) != get_user_team(victim)){
		DeathMsgVip(killer,victim,read_data(3));
	}
}
public DeathMsgVip(kid,vid,hs)
{
	new ilexp = reborn[kid]*10000
	cod_set_user_xp(kid, cod_get_user_xp(kid)+ilexp);
}
 
public motd(id)
{
	show_motd(id, "reborn.txt");
}
 
public PobierzReborna(id)
	return reborn[id];
 
/* 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: 4031
Powered By (Pav32) Pastebin © 2011