Przerabianie klasy na premium
sharkowy
27.01.2011
@matixr, Pobierz załącznik i wrzuć do compiler/include.
Ludzie samodzielności trochę... poradnik jasno opisany a wy nawet tego nie umiecie, to Forum ma pomagać, a nie dawać gotowce.
@Creesh
Użytkownik RPK. Shark edytował ten post 27.01.2011 15:07
Ludzie samodzielności trochę... poradnik jasno opisany a wy nawet tego nie umiecie, to Forum ma pomagać, a nie dawać gotowce.
@Creesh
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <codmod>
#include <hamsandwich>
#define DMG_BULLET (1<<1)
new bool:ma_klase[33];
new const nazwa[] = "Komandos";
new const opis[] = "Natychmiastowe zabicie z noza(PPM)";
new const bronie = 1<<CSW_DEAGLE;
new const zdrowie = 40;
new const kondycja = 60;
new const inteligencja = 5;
new const wytrzymalosc = 0;
public plugin_init()
{
register_plugin(nazwa, "1.0", "QTM_Peyote");
cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
}
public cod_class_enabled(id)
{
if(!(get_user_flags(id) & ADMIN_LEVEL_H))
{
client_print(id, print_chat, "[Komandos] Nie masz uprawnien, aby uzywac tej klasy.")
return COD_STOP;
}
ma_klase[id] = true;
return COD_CONTINUE;
}
public cod_class_disabled(id)
ma_klase[id] = false;
public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
if(!is_user_connected(idattacker))
return HAM_IGNORED;
if(!ma_klase[idattacker])
return HAM_IGNORED;
if(get_user_weapon(idattacker) == CSW_KNIFE && damagebits & DMG_BULLET && damage > 20.0)
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);
return HAM_IGNORED;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1045\\ f0\\ fs16 \n\\ par }
*/
Użytkownik RPK. Shark edytował ten post 27.01.2011 15:07
matixr
27.01.2011
@RPK. Shark
Teraz już się pogubiłem
"i wrzuć do compiler/include."
Trzeba mieć jakiś program czy co ?
proszę o pomoc + poleci
Teraz już się pogubiłem
"i wrzuć do compiler/include."
Trzeba mieć jakiś program czy co ?
proszę o pomoc + poleci
matixr
27.01.2011
@RPK. Shark
Jak kompiluje przez to wyskakuje taki error :
/tmp/textFrGlC4.sma(53) : fatal error 100: cannot read from file: "ColorChat"
Compilation aborted.
1 Error.
Jak kompiluje przez to wyskakuje taki error :
/tmp/textFrGlC4.sma(53) : fatal error 100: cannot read from file: "ColorChat"
Compilation aborted.
1 Error.
Creesh
27.01.2011
@RPK. Shark
Zmieniłem to w pliku codclass_komnados.sma i nadal nie działa.Nie mam żadny flag.
Zmieniłem to w pliku codclass_komnados.sma i nadal nie działa.Nie mam żadny flag.
V!p3r
27.01.2011
@matixr, musisz do folderu include w kompilerze dodać ColorChat.inc i #include <ColorChat>
Użytkownik V!p3r edytował ten post 27.01.2011 18:43
Użytkownik V!p3r edytował ten post 27.01.2011 18:43
matixr
28.01.2011
@V!p3r
Już czaje, poczytałem ten poradnik i skumałem,
ale i tak dzięki.
Ps. V!p3r czy ty grasz na cod Zoone ?
Już czaje, poczytałem ten poradnik i skumałem,
ale i tak dzięki.
Ps. V!p3r czy ty grasz na cod Zoone ?
kasztanek9994
08.02.2011
Spoiler
Proszę o pomoc

Tutaj błędy :
sda.sma(49) : error 017: undefined symbol "ma_klase" sda.sma(49) : warning 215: expression has no effect sda.sma(49) : error 001: expected token: ";", but found "]" sda.sma(49) : error 029: invalid expression, assumed zero sda.sma(49) : fatal error 107: too many error messages on one line Compilation aborted. 4 Errors.
Host
13.02.2011
Shark przerobiłbys mi ją ? Próbowałem ale nie potrafie tak to wszystkie robie a tej nieumiem.
#include <amxmodx> #include <hamsandwich> #include <codmod> #include <engine> native cod_add_wskrzes(id, ile) new sprite_white; new ilosc_apteczek_gracza[33]; new const nazwa[] = "Nekromata (Premium)"; new const opis[] = "Posiada jedna apteczke , moze wskrzeszac innych za to dostaje expa , wskrzeszony posiada 75hp"; new const bronie = 1<<CSW_SG552 | 1<<CSW_AUG new const zdrowie = 20; new const kondycja = 15; new const inteligencja = 0; new const wytrzymalosc = 20; new ma_klase[33]; public plugin_init() { register_plugin("Medyk", "1.0", "QTM_Peyote"); cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc); register_think("medkit","MedkitThink"); register_event("ResetHUD", "ResetHUD", "abe"); RegisterHam(Ham_Spawn, "player", "Spawn", 1); } public plugin_precache() { sprite_white = precache_model("sprites/white.spr"); precache_model("models/w_medkit.mdl"); } public cod_class_enabled(id) { ilosc_apteczek_gracza[id] = 1; cod_add_wskrzes(id, 1) ma_klase[id] = true } public cod_class_disabled(id) { cod_add_wskrzes(id, 0) ma_klase[id] = false } public cod_class_skill_used(id) { if (!ilosc_apteczek_gracza[id]) { client_print(id, print_center, "Masz tylko jedna apteczke na runde!"); return PLUGIN_CONTINUE; } ilosc_apteczek_gracza[id]--; new Float:origin[3]; entity_get_vector(id, EV_VEC_origin, origin); new ent = create_entity("info_target"); entity_set_string(ent, EV_SZ_classname, "medkit"); entity_set_edict(ent, EV_ENT_owner, id); entity_set_int(ent, EV_INT_solid, SOLID_NOT); entity_set_vector(ent, EV_VEC_origin, origin); entity_set_float(ent, EV_FL_ltime, halflife_time() + 7 + 0.1); entity_set_model(ent, "models/w_medkit.mdl"); set_rendering ( ent, kRenderFxGlowShell, 255,0,0, kRenderFxNone, 255 ) ; drop_to_floor(ent); entity_set_float(ent, EV_FL_nextthink, halflife_time() + 0.1); return PLUGIN_CONTINUE; } public MedkitThink(ent) { new id = entity_get_edict(ent, EV_ENT_owner); new dist = 300; new heal = 5+floatround(cod_get_user_intelligence(id)*0.5); if (entity_get_edict(ent, EV_ENT_euser2) == 1) { new Float:forigin[3]; entity_get_vector(ent, EV_VEC_origin, forigin); new entlist[33]; new numfound = find_sphere_class(0,"player", float(dist),entlist, 32,forigin); for (new i=0; i < numfound; i++) { new pid = entlist[i]; if (get_user_team(pid) != get_user_team(id)) continue; new maksymalne_zdrowie = 100+cod_get_user_health(pid); new zdrowie = get_user_health(pid); new Float:nowe_zdrowie = (zdrowie+heal<maksymalne_zdrowie)?zdrowie+heal+0.0:maksymalne_zdrowie+0.0; if (is_user_alive(pid)) entity_set_float(pid, EV_FL_health, nowe_zdrowie); } entity_set_edict(ent, EV_ENT_euser2, 0); entity_set_float(ent, EV_FL_nextthink, halflife_time() + 1.5); return PLUGIN_CONTINUE; } if (entity_get_float(ent, EV_FL_ltime) < halflife_time() || !is_user_alive(id)) { remove_entity(ent); return PLUGIN_CONTINUE; } if (entity_get_float(ent, EV_FL_ltime)-2.0 < halflife_time()) set_rendering ( ent, kRenderFxNone, 255,255,255, kRenderTransAlpha, 100 ); new Float:forigin[3]; entity_get_vector(ent, EV_VEC_origin, forigin); new iOrigin[3]; for(new i=0;i<3;i++) iOrigin[i] = floatround(forigin[i]); message_begin( MSG_BROADCAST, SVC_TEMPENTITY, iOrigin ); write_byte( TE_BEAMCYLINDER ); write_coord( iOrigin[0] ); write_coord( iOrigin[1] ); write_coord( iOrigin[2] ); write_coord( iOrigin[0] ); write_coord( iOrigin[1] + dist ); write_coord( iOrigin[2] + dist ); write_short( sprite_white ); write_byte( 0 ); // startframe write_byte( 0 ); // framerate write_byte( 10 ); // life write_byte( 10 ); // width write_byte( 255 ); // noise write_byte( 255 ); // r, g, b write_byte( 100 );// r, g, b write_byte( 100 ); // r, g, b write_byte( 128 ); // brightness write_byte( 0 ); // speed message_end(); entity_set_edict(ent, EV_ENT_euser2 ,1); entity_set_float(ent, EV_FL_nextthink, halflife_time() + 0.5); return PLUGIN_CONTINUE; } public ResetHUD(id) ilosc_apteczek_gracza[id] = 1; public client_disconnect(id) { new ent = find_ent_by_class(0, "medkit"); while(ent > 0) { if(entity_get_edict(id, EV_ENT_owner) == id) remove_entity(ent); ent = find_ent_by_class(ent, "medkit"); } } public Spawn(id) { if(!is_user_alive(id) || !is_user_connected(id)) return PLUGIN_CONTINUE; if(ma_klase[id]) cod_add_wskrzes(id, 1) return PLUGIN_CONTINUE; }
tomi93
21.02.2011
Host, w załączniku masz .sma.
kasztanek9994, 2-gi załącznik jest dla Ciebie , tam masz kod .sma Twojej klasy.
Użytkownik tomi93 edytował ten post 21.02.2011 19:31
kasztanek9994, 2-gi załącznik jest dla Ciebie , tam masz kod .sma Twojej klasy.
Załączone pliki
Użytkownik tomi93 edytował ten post 21.02.2011 19:31
Kanrin
11.04.2011
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <codmod>
#include <engine>
#include <hamsandwich>
#include <colorchat>
new const nazwa[] = "Ninja";
new const opis[] = "Slaba widocznosc, zmniejszona grawitacja, natychmiastowe zabicie z noza";
new const bronie = 1<<CSW_DEAGLE;
new const zdrowie = 40;
new const kondycja = 30;
new const inteligencja = 0;
new const wytrzymalosc = 0;
new bool:ma_klase[33];
public plugin_init() {
register_plugin(nazwa, "1.0", "QTM_Peyote");
cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
register_event("ResetHUD", "ResetHUD", "abe");
RegisterHam(Ham_TakeDamage, "player","TakeDamage");
}
public cod_class_enabled(id)
{
ColorChat(id, GREEN, "^x04Klasa^x03 %s^x04 By^x01 amxx.pl", nazwa); //Gdy gracz nie ma flagi wyświetli mu komunikat
if(!(get_user_flags(id) & ADMIN_LEVEL_H)) //FLAGA
{
ColorChat(id, GREEN, "^x03[%s]^x04 Jest^x03 klasa premium", nazwa) //Znowu info ze przykładowa klasa jest premium
return COD_STOP;
}
set_rendering(id,kRenderFxGlowShell,1,1,1 ,kRenderTransAlpha, 40);
entity_set_float(id, EV_FL_gravity, 200.0/800.0);
ma_klase[id] = true;
return COD_CONTINUE;
}
public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
if(!is_user_connected(idattacker))
return HAM_IGNORED;
if(!ma_klase[idattacker])
return HAM_IGNORED;
if(get_user_weapon(idattacker) == CSW_KNIFE && damagebits & DMG_BULLET && damage > 20.0)
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);
return HAM_IGNORED;
}
public ResetHUD(id)
{
if(ma_klase[id])
entity_set_float(id, EV_FL_gravity, 200.0/800.0);
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1250\\ deff0\\ deflang1045{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
*/
Proszę o pomoc! Gdy włączam tą klase nie mam na niej zredukowanej Widoczności do 40. A po zmienieniu klasy na inną gravitacja wynosi 200. Nie chcę nic "grzebać" w sma bo znając mnie to zepsuje


Użytkownik Kanrin edytował ten post 11.04.2011 18:14
AMXXP:D
23.05.2011
Mógłby Ktoś zapodać jakiś dokładny poradnik krok po kroku poleci +
Jestem zielony.
Host ,a ty tylko edytowałeś plik.sma i działało?
Czy co robiłeś?
Proszę o pomoc lecą +. Pozdrawiam
Jestem zielony.
Host ,a ty tylko edytowałeś plik.sma i działało?
Czy co robiłeś?
Proszę o pomoc lecą +. Pozdrawiam
adiii
03.06.2011
Eee ja mam błąd podczas kąpilowania taki /tmp/textmd49w9.sma(4) : fatal error 100: cannot read from file: "codmod"
Co jest oto SMA :
Dodano 03 czerwiec 2011 - 14:18:
ok juz ogarnołem sam
to jest proste ale bardzo dobre
Co jest oto SMA :
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <codmod> #include <engine> #include <colorchat> new const nazwa[] = "Zlodziej"; new const opis[] = "Ma zmniejszona widocznosc oraz 1/2 szansy na zabranie perku swojej ofierze"; new const bronie = 1<<CSW_GALIL | 1<<CSW_FLASHBANG | 1<<CSW_HEGRENADE; new const zdrowie = 15; new const kondycja = 30; new const inteligencja = 15; new const wytrzymalosc = 0; new bool:ma_klase[33]; new ofiara[33], perk_ofiary[33], wartosc_perku_ofiary[33]; public plugin_init() { register_plugin(nazwa, "1.0", "QTM_Peyote"); cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc); register_event("DeathMsg", "DeathMsg", "ade"); } public cod_class_enabled(id) { public cod_class_enabled(id) { ColorChat(id, RED, "^x04Klasa^x03 %s^x04 By^x01 ||Klocek|| A.D.I", nazwa); //Gdy gracz nie ma flagi wyświetli mu komunikat if(!(get_user_flags(id) & ADMIN_LEVEL_H)) //FLAGA { ColorChat(id, RED, "^x03[%s]^x04 Jest^x03 klasa premium", nazwa) //Znowu info ze przykładowa klasa jest PREMIUM return COD_STOP; } ma_klase[id] = true; return COD_CONTINUE; } public cod_class_disabled(id) { set_rendering(id,kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 255); ma_klase[id] = false; } public DeathMsg() { new killer = read_data(1); new victim = read_data(2); if(!is_user_connected(killer)) return; if(!ma_klase[killer]) return; if(random(2)) return; if(!(perk_ofiary[killer] = cod_get_user_perk(victim, wartosc_perku_ofiary[killer]))) return; ofiara[killer] = victim; Zapytaj(killer); } public Zapytaj(id) { new tytul[55]; new nazwa_perku[33]; cod_get_perk_name(perk_ofiary[id], nazwa_perku, 32); format(tytul, 54, "Czy chcesz ukrasc perk: %s ?", nazwa_perku); new menu = menu_create(tytul, "Zapytaj_Handle"); menu_additem(menu, "Tak"); menu_setprop(menu, MPROP_EXITNAME, "Nie"); menu_display(id, menu); } public Zapytaj_Handle(id, menu, item) { if(item) return; if(cod_get_user_perk(ofiara[id]) != perk_ofiary[id]) return; new nick_zlodzieja[33]; get_user_name(id, nick_zlodzieja, 32); ColorChat(ofiara[id], RED, "Twoj perk zostal skradziony przez %s.", nick_zlodzieja); cod_set_user_perk(ofiara[id], 0); cod_set_user_perk(id, perk_ofiary[id], wartosc_perku_ofiary[id]); }Kto mi powie co zle robie ?
Dodano 03 czerwiec 2011 - 14:18:
ok juz ogarnołem sam


Pączek?
12.10.2011
Proszę o pomoc przerobiłem klasę Replikant i wszystko bylo ok ale gdy dodalem do niej premium mam takie błędy przy komplikowaniu:
codclass_replicant.sma(49) : error 017: undefined symbol "ma_klase"
codclass_replicant.sma(49) : warning 215: expression has no effect
codclass_replicant.sma(49) : error 001: expected token: ";", but found "]"
codclass_replicant.sma(49) : error 029: invalid expression, assumed zero
codclass_replicant.sma(49) : fatal error 107: too many error messages on one line
plik sma:
pomoże ktoś?
oryginalny tekst:
Użytkownik Pączek? edytował ten post 12.10.2011 18:54
codclass_replicant.sma(49) : error 017: undefined symbol "ma_klase"
codclass_replicant.sma(49) : warning 215: expression has no effect
codclass_replicant.sma(49) : error 001: expected token: ";", but found "]"
codclass_replicant.sma(49) : error 029: invalid expression, assumed zero
codclass_replicant.sma(49) : fatal error 107: too many error messages on one line
plik sma:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <codmod>
#include <engine>
#include <ColorChat>
#include <hamsandwich>
new const nazwa[] = "SuperReplicant (VIP";
new const opis[] = "Moze stawiac swoje repliki, ktore odbijaja obrazenia";
new const bronie = 1<<CSW_M4A1 | 1<<CSW_HEGRENADE | 2<<CSW_FLASHBANG;
new const zdrowie = 20;
new const kondycja = 40;
new const inteligencja = 10;
new const wytrzymalosc = 10;
new pcvar_ilosc_replik, pcvar_hp_replik;
new ilosc_kukiel[33];
new sprite_blast;
public plugin_init()
{
register_plugin(nazwa, "1.0", "QTM_Peyote");
cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
RegisterHam(Ham_TakeDamage, "info_target", "TakeDamage");
RegisterHam(Ham_Spawn, "player", "Spawn", 1);
register_event("HLTV", "NowaRunda", "a", "1=0", "2=0");
pcvar_ilosc_replik = register_cvar("ilosc_replik", "5");
pcvar_hp_replik = register_cvar("hp_replik", "200");
}
public plugin_precache()
sprite_blast = precache_model("sprites/dexplo.spr");
public cod_class_enabled(id)
{
ColorChat(id, RED, "^x04Klasa^x03 %s^x04 By^x01 amxx.pl", nazwa); //Gdy gracz nie ma flagi wyświetli mu komunikat
if(!(get_user_flags(id) & ADMIN_LEVEL_H)) //FLAGA
{
ColorChat(id, RED, "^x03[%s]^x04 Jest^x03 klasa premium", nazwa) //Znowu info ze przykładowa klasa jest PREMIUM
return COD_STOP;
}
ma_klase[id] = true;
return COD_CONTINUE;
}
}
public cod_class_skill_used(id)
{
if(ilosc_kukiel[id] < 1)
{
client_print(id, print_center, "Wykorzystales wszystkie repliki!");
return;
}
new Float:OriginGracza[3], Float:OriginKukly[3], Float:VBA[3];
entity_get_vector(id, EV_VEC_origin, OriginGracza);
VelocityByAim(id, 50, VBA);
VBA[2] = 0.0;
for(new i=0; i < 3; i++)
OriginKukly[i] = OriginGracza[i]+VBA[i];
if(get_distance_f(OriginKukly, OriginGracza) < 40.0)
{
client_print(id, print_center, "Muszisz postawic replike dalej!");
return;
}
new model[55], Float:AngleKukly[3],
SekwencjaKukly = entity_get_int(id, EV_INT_gaitsequence);
SekwencjaKukly = SekwencjaKukly == 3 || SekwencjaKukly == 4? 1: SekwencjaKukly;
entity_get_string(id, EV_SZ_model, model, 54);
entity_get_vector(id, EV_VEC_angles, AngleKukly);
AngleKukly[0] = 0.0;
new ent = create_entity("info_target");
entity_set_string(ent, EV_SZ_classname, "Kukla");
entity_set_model(ent, model);
entity_set_vector(ent, EV_VEC_origin, OriginKukly);
entity_set_vector(ent, EV_VEC_angles, AngleKukly);
entity_set_vector(ent, EV_VEC_v_angle, AngleKukly);
entity_set_int(ent, EV_INT_sequence, SekwencjaKukly);
entity_set_int(ent, EV_INT_solid, SOLID_BBOX);
entity_set_float(ent, EV_FL_health, get_pcvar_float(pcvar_hp_replik));
entity_set_float(ent, EV_FL_takedamage, DAMAGE_YES);
entity_set_size(ent, Float:{-16.0,-16.0, -36.0}, Float:{16.0,16.0, 40.0});
entity_set_int(ent, EV_INT_iuser1, id);
ilosc_kukiel[id]--;
}
public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
if(!is_user_alive(idattacker))
return HAM_IGNORED;
new classname[33];
entity_get_string(this, EV_SZ_classname, classname, 32);
if(!equal(classname, "Kukla"))
return HAM_IGNORED;
new owner = entity_get_int(this, EV_INT_iuser1);
if(get_user_team(owner) == get_user_team(idattacker))
return HAM_SUPERCEDE;
new bool:bez_obrazen = get_user_weapon(idattacker) == CSW_KNIFE && damagebits & DMG_BULLET
if(!bez_obrazen)
cod_inflict_damage(owner, idattacker, damage, 0.3, this, damagebits);
new Float:fOrigin[3], iOrigin[3];
entity_get_vector(this, EV_VEC_origin, fOrigin);
FVecIVec(fOrigin, iOrigin);
if(damage > entity_get_float(this, EV_FL_health))
{
if(!bez_obrazen)
{
new entlist[33];
new numfound = find_sphere_class(this, "player", 190.0, entlist, 32);
for (new i=0; i < numfound; i++)
{
new pid = entlist[i];
if (!is_user_alive(pid) || get_user_team(owner) == get_user_team(pid))
continue;
cod_inflict_damage(owner, pid, 70.0, 0.3, this, (1<<24));
}
}
message_begin(MSG_BROADCAST,SVC_TEMPENTITY, iOrigin);
write_byte(TE_EXPLOSION);
write_coord(iOrigin[0]);
write_coord(iOrigin[1]);
write_coord(iOrigin[2]);
write_short(sprite_blast);
write_byte(32);
write_byte(20);
write_byte(0);
message_end();
}
return HAM_IGNORED;
}
public Spawn(id)
ilosc_kukiel[id] = get_pcvar_num(pcvar_ilosc_replik);
public NowaRunda()
remove_entity_name("Kukla")
pomoże ktoś?
oryginalny tekst:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <codmod>
#include <colorchat>
#include <engine>
#include <hamsandwich>
new const nazwa[] = "Replicant";
new const opis[] = "Moze stawiac swoje repliki, ktore odbijaja obrazenia";
new const bronie = 1<<CSW_MP5NAVY | 1<<CSW_HEGRENADE | 1<<CSW_FLASHBANG;
new const zdrowie = 20;
new const kondycja = 40;
new const inteligencja = 10;
new const wytrzymalosc = 10;
new pcvar_ilosc_replik, pcvar_hp_replik;
new ilosc_kukiel[33];
new sprite_blast;
public plugin_init()
{
register_plugin(nazwa, "1.0", "QTM_Peyote");
cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
RegisterHam(Ham_TakeDamage, "info_target", "TakeDamage");
RegisterHam(Ham_Spawn, "player", "Spawn", 1);
register_event("HLTV", "NowaRunda", "a", "1=0", "2=0");
pcvar_ilosc_replik = register_cvar("ilosc_replik", "3");
pcvar_hp_replik = register_cvar("hp_replik", "200");
}
public plugin_precache()
sprite_blast = precache_model("sprites/dexplo.spr");
public cod_class_enabled(id)
{
ColorChat(id, GREEN, "Klasa %s zostala stworzona przez www.PluginyMody.webd.pl", nazwa);
Spawn(id);
}
public cod_class_skill_used(id)
{
if(ilosc_kukiel[id] < 1)
{
client_print(id, print_center, "Wykorzystales wszystkie repliki!");
return;
}
new Float:OriginGracza[3], Float:OriginKukly[3], Float:VBA[3];
entity_get_vector(id, EV_VEC_origin, OriginGracza);
VelocityByAim(id, 50, VBA);
VBA[2] = 0.0;
for(new i=0; i < 3; i++)
OriginKukly[i] = OriginGracza[i]+VBA[i];
if(get_distance_f(OriginKukly, OriginGracza) < 40.0)
{
client_print(id, print_center, "Muszisz postawic replike dalej!");
return;
}
new model[55], Float:AngleKukly[3],
SekwencjaKukly = entity_get_int(id, EV_INT_gaitsequence);
SekwencjaKukly = SekwencjaKukly == 3 || SekwencjaKukly == 4? 1: SekwencjaKukly;
entity_get_string(id, EV_SZ_model, model, 54);
entity_get_vector(id, EV_VEC_angles, AngleKukly);
AngleKukly[0] = 0.0;
new ent = create_entity("info_target");
entity_set_string(ent, EV_SZ_classname, "Kukla");
entity_set_model(ent, model);
entity_set_vector(ent, EV_VEC_origin, OriginKukly);
entity_set_vector(ent, EV_VEC_angles, AngleKukly);
entity_set_vector(ent, EV_VEC_v_angle, AngleKukly);
entity_set_int(ent, EV_INT_sequence, SekwencjaKukly);
entity_set_int(ent, EV_INT_solid, SOLID_BBOX);
entity_set_float(ent, EV_FL_health, get_pcvar_float(pcvar_hp_replik));
entity_set_float(ent, EV_FL_takedamage, DAMAGE_YES);
entity_set_size(ent, Float:{-16.0,-16.0, -36.0}, Float:{16.0,16.0, 40.0});
entity_set_int(ent, EV_INT_iuser1, id);
ilosc_kukiel[id]--;
}
public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
if(!is_user_alive(idattacker))
return HAM_IGNORED;
new classname[33];
entity_get_string(this, EV_SZ_classname, classname, 32);
if(!equal(classname, "Kukla"))
return HAM_IGNORED;
new owner = entity_get_int(this, EV_INT_iuser1);
if(get_user_team(owner) == get_user_team(idattacker))
return HAM_SUPERCEDE;
new bool:bez_obrazen = get_user_weapon(idattacker) == CSW_KNIFE && damagebits & DMG_BULLET
if(!bez_obrazen)
cod_inflict_damage(owner, idattacker, damage, 0.3, this, damagebits);
new Float:fOrigin[3], iOrigin[3];
entity_get_vector(this, EV_VEC_origin, fOrigin);
FVecIVec(fOrigin, iOrigin);
if(damage > entity_get_float(this, EV_FL_health))
{
if(!bez_obrazen)
{
new entlist[33];
new numfound = find_sphere_class(this, "player", 190.0, entlist, 32);
for (new i=0; i < numfound; i++)
{
new pid = entlist[i];
if (!is_user_alive(pid) || get_user_team(owner) == get_user_team(pid))
continue;
cod_inflict_damage(owner, pid, 70.0, 0.3, this, (1<<24));
}
}
message_begin(MSG_BROADCAST,SVC_TEMPENTITY, iOrigin);
write_byte(TE_EXPLOSION);
write_coord(iOrigin[0]);
write_coord(iOrigin[1]);
write_coord(iOrigin[2]);
write_short(sprite_blast);
write_byte(32);
write_byte(20);
write_byte(0);
message_end();
}
return HAM_IGNORED;
}
public Spawn(id)
ilosc_kukiel[id] = get_pcvar_num(pcvar_ilosc_replik);
public NowaRunda()
remove_entity_name("Kukla")
Użytkownik Pączek? edytował ten post 12.10.2011 18:54