Telegrafista
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <codmod>
new const nazwa[] = "Telegrafista";
new const opis[] = "widzi wrogów na radarze";
new const bronie = (1<<CSW_HEGRENADE)|(1<<CSW_AUG)|(1<<CSW_SMOKEGRENADE);
new const zdrowie = 10;
new const kondycja = 0;
new const inteligencja = 10;
new const wytrzymalosc = 0;
new g_msgHostageAdd, g_msgHostageDel;
new bool:ma_klase[33];
public plugin_init() {
register_plugin(nazwa, "1.0", "QTM_Peyote");
g_msgHostageAdd = get_user_msgid("HostagePos");
g_msgHostageDel = get_user_msgid("HostageK");
cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
set_task (2.0,"radar_scan",_,_,_,"b");
}
public cod_class_enabled(id)
ma_klase[id] = true;
public cod_class_disabled(id)
ma_klase[id] = false;
public radar_scan(id)
{
new PlayerCoords[3];
for (new id=1; id<=32; id++)
{
if((!is_user_alive(id))||(!ma_klase[id])) continue;
for (new i=1;i<=32;i++)
{
if(!is_user_alive(i) || get_user_team(i) == get_user_team(id)) continue;
get_user_origin(i, PlayerCoords)
message_begin(MSG_ONE_UNRELIABLE, g_msgHostageAdd, {0,0,0}, id)
write_byte(id)
write_byte(i)
write_coord(PlayerCoords[0])
write_coord(PlayerCoords[1])
write_coord(PlayerCoords[2])
message_end()
message_begin(MSG_ONE_UNRELIABLE, g_msgHostageDel, {0,0,0}, id)
write_byte(i)
message_end()
}
}
}
Strzelec wyborowy
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <codmod>
#include <engine>
#include <fun>
#include <colorchat>
new bool:ma_klase[33];
new bool:uzywa[33];
new pozostale_spadochrony[33];
new para_ent[33];
new const nazwa[] = "Strzelec wyborowy";
new const opis[] = "Ma 5 spadochronow";
new const bronie = (1<<CSW_M4A1)|(1<<CSW_AK47);
new const zdrowie = 10;
new const kondycja = 5;
new const inteligencja = 10;
new const wytrzymalosc = 5;
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");
}
public plugin_precache()
precache_model("models/parachute.mdl");
public cod_class_enabled(id)
{
ColorChat(id, GREEN, "Klasa stworzona przez ---------");
ma_klase[id] = true;
return COD_CONTINUE;
}
public cod_class_disabled(id)
ma_klase[id] = false;
public cod_class_skill_used(id)
{
if(pozostale_spadochrony[id] > 0)
{
if(para_ent[id])
uzywa[id] = false;
else
{
uzywa[id] = true;
pozostale_spadochrony[id]--;
}
}
else
ColorChat(id, RED, "Wykorzystales juz wszystkie 5 spadochronow");
}
public client_PreThink(id)
{
//parachute.mdl animation information
//0 - deploy - 84 frames
//1 - idle - 39 frames
//2 - detach - 29 frames
if (!is_user_alive(id) || !ma_klase[id]) return
new Float:fallspeed = -100.0
new Float:frame
new flags = get_entity_flags(id)
if (para_ent[id] > 0 && (flags & FL_ONGROUND)) {
uzywa[id] = false;
if (get_user_gravity(id) == 0.1) set_user_gravity(id, 1.0)
if (entity_get_int(para_ent[id],EV_INT_sequence) != 2) {
entity_set_int(para_ent[id], EV_INT_sequence, 2)
entity_set_int(para_ent[id], EV_INT_gaitsequence, 1)
entity_set_float(para_ent[id], EV_FL_frame, 0.0)
entity_set_float(para_ent[id], EV_FL_fuser1, 0.0)
entity_set_float(para_ent[id], EV_FL_animtime, 0.0)
entity_set_float(para_ent[id], EV_FL_framerate, 0.0)
return
}
frame = entity_get_float(para_ent[id],EV_FL_fuser1) + 2.0
entity_set_float(para_ent[id],EV_FL_fuser1,frame)
entity_set_float(para_ent[id],EV_FL_frame,frame)
if (frame > 254.0) {
remove_entity(para_ent[id])
para_ent[id] = 0
}
}
if (uzywa[id]) {
new Float:velocity[3]
entity_get_vector(id, EV_VEC_velocity, velocity)
if (velocity[2] < 0.0) {
if(para_ent[id] <= 0) {
para_ent[id] = create_entity("info_target")
if(para_ent[id] > 0) {
entity_set_string(para_ent[id],EV_SZ_classname,"parachute")
entity_set_edict(para_ent[id], EV_ENT_aiment, id)
entity_set_edict(para_ent[id], EV_ENT_owner, id)
entity_set_int(para_ent[id], EV_INT_movetype, MOVETYPE_FOLLOW)
entity_set_model(para_ent[id], "models/parachute.mdl")
entity_set_int(para_ent[id], EV_INT_sequence, 0)
entity_set_int(para_ent[id], EV_INT_gaitsequence, 1)
entity_set_float(para_ent[id], EV_FL_frame, 0.0)
entity_set_float(para_ent[id], EV_FL_fuser1, 0.0)
}
}
if (para_ent[id] > 0) {
entity_set_int(id, EV_INT_sequence, 3)
entity_set_int(id, EV_INT_gaitsequence, 1)
entity_set_float(id, EV_FL_frame, 1.0)
entity_set_float(id, EV_FL_framerate, 1.0)
set_user_gravity(id, 0.1)
velocity[2] = (velocity[2] + 40.0 < fallspeed) ? velocity[2] + 40.0 : fallspeed
entity_set_vector(id, EV_VEC_velocity, velocity)
if (entity_get_int(para_ent[id],EV_INT_sequence) == 0) {
frame = entity_get_float(para_ent[id],EV_FL_fuser1) + 1.0
entity_set_float(para_ent[id],EV_FL_fuser1,frame)
entity_set_float(para_ent[id],EV_FL_frame,frame)
if (frame > 100.0) {
pozostale_spadochrony[id]--;
entity_set_float(para_ent[id], EV_FL_animtime, 0.0)
entity_set_float(para_ent[id], EV_FL_framerate, 0.4)
entity_set_int(para_ent[id], EV_INT_sequence, 1)
entity_set_int(para_ent[id], EV_INT_gaitsequence, 1)
entity_set_float(para_ent[id], EV_FL_frame, 0.0)
entity_set_float(para_ent[id], EV_FL_fuser1, 0.0)
}
}
}
}
else if (para_ent[id] > 0) {
remove_entity(para_ent[id])
set_user_gravity(id, 1.0)
para_ent[id] = 0
}
}
else if (para_ent[id] > 0 ) {
remove_entity(para_ent[id])
set_user_gravity(id, 1.0)
para_ent[id] = 0
}
}
public ResetHUD(id)
{
uzywa[id] = false;
pozostale_spadochrony[id] = 5;
}
General(Zmien sobie flage ja ustawiłem na ADMIN_LEVEL_H)
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <codmod>
#include <colorchat>
#include <engine>
#include <hamsandwich>
#include <cstrike>
#include <fun>
#define DMG_BULLET (1<<1)
new bool:ma_klase[33];
new const nazwa[] = "General";
new const opis[] = "Klasa premium, 1/2 z he, wybucha po smierci zadajac 90(+intelgencja) obrazen";
new const bronie = 1<<CSW_M4A1 | 1<<CSW_HEGRENADE | 1<<CSW_FLASHBANG | 1<<CSW_SMOKEGRENADE | 1<<CSW_DEAGLE;
new const zdrowie = 20;
new const kondycja = 20;
new const inteligencja = 0;
new const wytrzymalosc = 0;
new sprite_blast, sprite_white;
public plugin_init()
{
register_plugin(nazwa, "1.0", "QTM_Peyote");
cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
register_event("DeathMsg", "Death", "ade");
RegisterHam(Ham_TakeDamage, "player", "fwTakeDamage_JedenZ");
}
public plugin_precache()
{
sprite_white = precache_model("sprites/white.spr") ;
sprite_blast = precache_model("sprites/dexplo.spr");
}
public cod_class_enabled(id)
{
give_item(id, "weapon_hegrenade");
if(!(get_user_flags(id) & ADMIN_LEVEL_H))
{
ColorChat(id, RED, "[General] Nie masz uprawnien, aby korzystac z tej klasy.");
return COD_STOP;
}
ColorChat(id, GREEN, "Klasa stworzona przez --------");
ma_klase[id] = true;
return COD_CONTINUE;
}
public cod_class_disabled(id)
ma_klase[id] = false;
public Death()
{
new id = read_data(2);
if(ma_klase[id])
Eksploduj(id);
}
public Eksploduj(id)
{
new Float:fOrigin[3], iOrigin[3];
entity_get_vector( id, EV_VEC_origin, fOrigin);
iOrigin[0] = floatround(fOrigin[0]);
iOrigin[1] = floatround(fOrigin[1]);
iOrigin[2] = floatround(fOrigin[2]);
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();
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] + 300 );
write_coord( iOrigin[2] + 300 );
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( 8 ); // speed
message_end();
new entlist[33];
new numfound = find_sphere_class(id, "player", 300.0 , entlist, 32);
for (new i=0; i < numfound; i++)
{
new pid = entlist[i];
if (!is_user_alive(pid) || get_user_team(id) == get_user_team(pid))
continue;
cod_inflict_damage(id, pid, 90.0, 0.7);
}
return PLUGIN_CONTINUE;
}
public fwTakeDamage_JedenZ(this, idInf, idAtt, Float:fDmg, dmgBits){
if(!is_user_alive(idAtt) || !ma_klase[idAtt] || !(dmgBits & (1<<1) ) || random_num(1, 2) != 1 )
return HAM_IGNORED;
cs_set_user_armor(this, 0, CS_ARMOR_NONE);
SetHamParamFloat(4, float(get_user_health(this) + 1));
return HAM_HANDLED;
}
Użytkownik Stefan ^^ edytował ten post 25.08.2012 12:01