#include <colorchat>
new bool:ma_klase[33];
new bool:uzywa[33];
new pozostale_spadochrony[33];
new para_ent[33];
new const nazwa[] = "Komandos Pierwszej Lini (Premium)";
new const opis[] = "Famas , degle , he i spadochron";
new const bronie = (1<<CSW_HEGRENADE)|(1<<CSW_FAMAS)|(1<<CSW_DEAGLE);
new const zdrowie = 50;
new const kondycja = 65;
new const inteligencja = 0;
new const wytrzymalosc = 30;
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 pluginymody.webd.pl");
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 spadochrony");
}
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] = 55;
}
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.
|
Guest Message by DevFuse
5 odpowiedzi w tym temacie
#1
Napisano 21.04.2012 10:18
Witam proszę o dodanie aby ta klasa byla na admin level H i miala 2 skoki
#2
Napisano 21.04.2012 11:18
Sprawdź:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <codmod>
#include <hamsandwich>
#include <fun>
#include <engine>
#include <fakemeta>
#include <colorchat>
new bool:ma_klase[33];
new bool:uzywa[33];
new pozostale_spadochrony[33];
new bool:moze_skoczyc[33];
new para_ent[33];
new const nazwa[] = "Komandos Pierwszej Lini (Premium)";
new const opis[] = "Famas , degle , he i spadochron";
new const bronie = (1<<CSW_HEGRENADE)|(1<<CSW_FAMAS)|(1<<CSW_DEAGLE);
new const zdrowie = 50;
new const kondycja = 65;
new const inteligencja = 0;
new const wytrzymalosc = 30;
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");
register_forward(FM_CmdStart, "CmdStart");
}
public plugin_precache()
precache_model("models/parachute.mdl");
public cod_class_enabled(id)
{
if(!(get_user_flags(id) & ADMIN_LEVEL_H))
{
client_print(id, print_chat, "[] Nie masz uprawnien, aby uzywac tej klasy.")
return COD_STOP;
}
ColorChat(id, GREEN, "Klasa stworzona przez pluginymody.webd.pl");
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 spadochrony");
}
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] = 55;
}
public CmdStart(id, uc_handle)
{
if(!ma_klase[id])
return FMRES_IGNORED;
new button = get_uc(uc_handle, UC_Buttons);
new oldbutton = pev(id, pev_oldbuttons);
new flags = pev(id, pev_flags);
if((button & IN_JUMP) && !(flags & FL_ONGROUND) && !(oldbutton & IN_JUMP) && moze_skoczyc[id])
{
moze_skoczyc[id] = false;
new Float:velocity[3];
pev(id, pev_velocity, velocity);
velocity[2] = random_float(265.0,285.0);
set_pev(id, pev_velocity, velocity);
}
else if(flags & FL_ONGROUND)
moze_skoczyc[id] = true;
return FMRES_IGNORED;
}
#3
Napisano 21.04.2012 11:41
blad przy kompilacji
SourcePawn Compiler 1.4.2-dev Copyright (c) 1997-2006, ITB CompuPhase, (C)2004-2008 AlliedModders, LLC komand.sp(1) : fatal error 120: cannot read from file: "amxmodx" Compilation aborted. 1 Error.
#4
Napisano 21.04.2012 14:51
Wydaje mi się że niemasz lub masz błędny plik w Kompilatorze w folderze include o nazwie amxmod
#5
Napisano 21.04.2012 16:50
Welcome to the AMX Mod X 1.8.1-300 Compiler. Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team Header size: 1416 bytes Code size: 8748 bytes Data size: 2152 bytes Stack/heap size: 16384 bytes; max. usage is unknown, due to recursion Total requirements: 28700 bytes Done.
U mnie nie ma żadnych błędów
Masz w sma:
codclass_komandospl.sma 5,33 KB 37 Ilość pobrań
codclass_komandospl.amxx
#6
Napisano 21.04.2012 20:05
Mówię że ma błędny lub nie ma pliku amxmod w folderze include
Również z jednym lub większą ilością słów kluczowych: cod nowy
Paczka perkow.perki Napisany przez NAVIK, 24.03.2025 |
|
|
|||
CoD Nowy
Plugin na małe mapy.Napisany przez NAVIK, 16.02.2025 |
|
|
|||
CoD Nowy
Dodatkowe, osobne trzy linie opisu klasNapisany przez Rafii, 27.01.2025 |
|
|
|||
CoD Nowy
problem z kompilacjaNapisany przez Anonimowy09, 21.01.2025 |
|
|
|||
CoD Nowy
problem z HUDNapisany przez Anonimowy09, 10.01.2025 |
|
|
Użytkownicy przeglądający ten temat: 1
0 użytkowników, 1 gości, 0 anonimowych


Dodatki SourceMod












