Skocz do zawartości

Zablokowane Skrzydła jako spadochron (przeźroczystość)


sNaxu

Rekomendowane odpowiedzi

Przerobiona funkcja z pluginu DarkGL :)

Niestety jego była troszkę inna, ponieważ

nie dodawała przezroczystości.

Poradnik napisany pod DiabloMod Core 1.1.0 by DarkGL

( możliwość dodania pod innego moda )

 

Opis:

Dodaje model skrzydeł do postaci, oraz funkcje spadochronu ( pod klawiszem E ).

Skrzydła stają się bardziej przezroczyste wraz z przezroczystością gracza ( klasy).

 

Instrukcja instalacji:

 

1. Otwieramy nasz plik .SMA klasy

 

2. Dopisujemy do include ( nie wiem czy wszystkie potrzeba )



#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <engine>
#include <fakemeta_util>


3. Do zmiennych globalnych dodajemy:



#define ANIOL_VIEW "models/diablomod/aniol.mdl"


new ma_spadochron[33]
new Float:g_flEntityFrame[33]
new para_ent[33];


4. Dodajemy precache:



public plugin_precache(){
precache_model (ANIOL_VIEW)
}


5. Do enabled klasy dajemy:



ma_spadochron[id] = 1;


5.1 Do disabled klasy dajemy:



ma_spadochron[id] = 0;


6. I teraz, na koncu dodajemy MYŚL!:



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_spadochron[id]) return


new Float:fallspeed = -100.0
new Float:frame


new button = get_user_button(id)
new oldbutton = get_user_oldbutton(id)
new flags = get_entity_flags(id)


if (para_ent[id] > 0 && (flags & FL_ONGROUND)) {
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)
g_flEntityFrame[id] = 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 (button & IN_USE){


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], ANIOL_VIEW)
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)
set_pev(para_ent[id], pev_rendermode, pev(id, pev_rendermode));
set_pev(para_ent[id], pev_renderfx, pev(id, pev_renderfx));
new Float:f_renderamt;
pev(id, pev_renderamt, f_renderamt);
set_pev(para_ent[id], pev_renderamt, f_renderamt);




g_flEntityFrame[id] = 0.0


new Float:fVecOrigin[3]
pev(id, pev_origin, fVecOrigin)
}
}


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) {


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 ((oldbutton & IN_USE) && para_ent[id] > 0 )
{
remove_entity(para_ent[id])
fm_set_user_gravity(id, 1.0)
para_ent[id] = 0
}
}


7. Zapisujemy plik .SMA i kompilujemy.

 

 

GOTOWE!

Zdjęcia może dodam, gdy znów postawie swój serwer.

Odnośnik do komentarza
https://csowicze.pl/topic/22624-skrzyd%C5%82a-jako-spadochron-prze%C5%BAroczysto%C5%9B%C4%87/
Udostępnij na innych stronach

Wiadomość wygenerowana automatycznie

 

temat_zamkniety.png
Powód: Dzięki za poradnik, zamykam

 

Jeżeli się z tym nie zgadzasz raportuj ten post a moderator lub administrator rozpatrzy go ponownie.
Z pozdrowieniami.
Administracja CSowicze.pl

Odnośnik do komentarza
https://csowicze.pl/topic/22624-skrzyd%C5%82a-jako-spadochron-prze%C5%BAroczysto%C5%9B%C4%87/#findComment-105117
Udostępnij na innych stronach

  • 6 miesięcy później...

Wiadomość wygenerowana automatycznie

 

temat_zamkniety.png
Powód: zamek

 

Jeżeli się z tym nie zgadzasz raportuj ten post a moderator lub administrator rozpatrzy go ponownie.
Z pozdrowieniami.
Administracja CSowicze.pl

Odnośnik do komentarza
https://csowicze.pl/topic/22624-skrzyd%C5%82a-jako-spadochron-prze%C5%BAroczysto%C5%9B%C4%87/#findComment-170938
Udostępnij na innych stronach

Gość
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...

Powiadomienie o plikach cookie