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. | #include <amxmodx>
#include <amxmisc>
#include <colorchat>
#include <cstrike>
#include <engine>
#include <fakemeta>
#include <fun>
#include <codmod>
#define PLUGIN "Bonusowe Paczki"
#define VERSION "1.0"
#define AUTHOR "radim edytowal ricO"
new const modelitem[] = "models/cod_paczka.mdl";
new const prefix[] = "^04[BONUS]^01"
public plugin_init()
{
register_plugin(PLUGIN, AUTHOR, VERSION)
register_forward(FM_Touch, "fwd_touch")
register_event("DeathMsg", "DeathMsg", "a")
register_logevent("PoczatekRundy", 2, "1=Round_Start");
}
public plugin_precache()
{
precache_model(modelitem);
}
public PoczatekRundy()
kill_all_entity("paczka")
public DeathMsg()
{
new kid = read_data(1)
new vid = read_data(2)
if( kid == vid )
return PLUGIN_CONTINUE;
if(is_user_connected(kid) || is_user_connected(vid))
create_itm(vid, 0)
return PLUGIN_CONTINUE;
}
public UzyjPaczki(id)
{
if( !is_user_connected(id) || !is_user_alive(id) )
return PLUGIN_HANDLED;
switch(random_num(1, 5))
{
case 1:
{
new hp = get_user_health(id);
new losowehp = random_num(-5, -20);
set_user_health(id, hp+losowehp)
ColorChat(id, GREY, "^x04%s ^x01Znalazles trucizne. Tracisz ^x03%i^x01 HP!", prefix, losowehp)
}
case 2:
{
new hp = get_user_health(id);
new losowehp = random_num(5, 40);
set_user_health(id, hp+losowehp)
ColorChat(id, GREY, "^x04%s ^x01Znalazles apteczke. Dostales ^x03%i^x01 HP!", prefix, losowehp)
}
case 3:
{
new kasa = cs_get_user_money(id);
new losowakasa = random_num(20, 5000);
cs_set_user_money(id, kasa+losowakasa)
ColorChat(id, GREY, "^x04%s ^x01Znalazles sakiewke ze zlotem. Dostales ^x03%i^x01 kasy!", prefix, losowakasa)
}
case 4:
{
ColorChat(id, GREY, "^x04%s ^x01Posiadasz juz perk!", prefix)
if(cod_get_user_perk(id))
return PLUGIN_HANDLED
cod_set_user_perk(id, -1, -1, 1);
}
case 5:
{
new losowyexp = random_num(30, 250);
cod_set_user_xp(id, cod_get_user_xp(id) + losowyexp);
ColorChat(id, GREY, "^x04%s ^x01Znalazles ^x03%i^x01 Expa!", prefix, losowyexp)
}
}
return PLUGIN_HANDLED;
}
public create_itm(id, id_item){
new Float:origins[3]
pev(id,pev_origin,origins);
new entit=create_entity("info_target")
origins[0]+=50.0
origins[2]-=32.0
set_pev(entit,pev_origin,origins)
entity_set_model(entit,modelitem)
set_pev(entit,pev_classname,"paczka");
dllfunc(DLLFunc_Spawn, entit);
set_pev(entit,pev_solid,SOLID_BBOX);
set_pev(entit,pev_movetype,MOVETYPE_FLY);
engfunc(EngFunc_SetSize,entit,{-1.1, -1.1, -1.1},{1.1, 1.1, 1.1});
engfunc(EngFunc_DropToFloor,entit);
set_pev(entit, pev_iuser1, id_item)
}
public fwd_touch(ent,id)
{
if(!is_user_alive(id)) return FMRES_IGNORED;
if(!pev_valid(ent)) return FMRES_IGNORED;
static classname[32];
pev(ent,pev_classname,classname,31);
if(!equali(classname,"paczka")) return FMRES_IGNORED;
if(pev(id,pev_button))
{
{
UzyjPaczki(id)
engfunc(EngFunc_RemoveEntity,ent);
}
}
return FMRES_IGNORED;
}
public kill_all_entity(classname[]) {
new iEnt = find_ent_by_class(-1, classname)
while(iEnt > 0) {
remove_entity(iEnt)
iEnt = find_ent_by_class(iEnt, classname)
}
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1045\\ f0\\ fs16 \n\\ par }
*/
|