Junior Member
|
04-01-2012
, 08:18
Re: I help me! Parachute?
|
#8
|
Quote:
Originally Posted by Y060N
PHP Code:
#include <amxmodx> #include <fakemeta> #include <hamsandwich> #include <zp50_core>
new const paramodel[] = "models/spadochron.mdl"
new bool:has_parachute[33], para_ent[33];
public plugin_init() { register_plugin("[ZP] Sub-Plugin: Parachute", "1.2", "Random1, 93()|29!/<")
register_forward(FM_PlayerPreThink, "fw_PreThink") RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn_Post", 1) RegisterHam(Ham_Killed, "player", "fw_PlayerKilled") }
public plugin_precache() { engfunc(EngFunc_PrecacheModel, paramodel) }
public client_connect(id) parachute_reset(id, 1)
public client_disconnect(id) parachute_reset(id)
parachute_reset(id, keep = 0) { if(para_ent[id] > 0 && pev_valid(para_ent[id])) { engfunc(EngFunc_RemoveEntity, para_ent[id]); para_ent[id] = 0 } if (!keep) has_parachute[id] = false else has_parachute[id] = true }
public fw_PlayerKilled(victim) parachute_reset(victim)
public fw_PlayerSpawn_Post(id) { if (!is_user_alive(id)) return; parachute_reset(id, 1) return; }
public fw_PreThink(id) { //Parachute model animation information //0 - deploy - 84 frames //1 - idle - 39 frames //2 - detach - 29 frames if (!is_user_alive(id) || !has_parachute[id] || zp_core_is_zombie(id)) return; new Float:fallingspeed = 75.0 * -1.0; new Float:frame; new button = pev(id, pev_button); new oldbutton = pev(id, pev_oldbuttons); new flags = pev(id, pev_flags); if (para_ent[id] > 0 && (flags & FL_ONGROUND)) { parachute_reset(id, 1) return; } if (button & IN_USE) { new Float:velocity[3]; pev(id, pev_velocity, velocity); if (velocity[2] < 0.0) { if(para_ent[id] <= 0) { para_ent[id] = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target")); if(para_ent[id] > 0) { set_pev(para_ent[id],pev_classname,"parachute"); set_pev(para_ent[id], pev_aiment, id) set_pev(para_ent[id], pev_owner, id); set_pev(para_ent[id], pev_movetype, MOVETYPE_FOLLOW); if (!zp_core_is_zombie(id)) engfunc(EngFunc_SetModel, para_ent[id], paramodel); set_pev(para_ent[id], pev_sequence, 0); set_pev(para_ent[id], pev_gaitsequence, 1); set_pev(para_ent[id], pev_frame, 0.0); set_pev(para_ent[id], pev_fuser1, 0.0); } } if (para_ent[id] > 0) { set_pev(id, pev_sequence, 3) set_pev(id, pev_gaitsequence, 1) set_pev(id, pev_frame, 1.0) set_pev(id, pev_framerate, 1.0)
velocity[2] = (velocity[2] + 40.0 < fallingspeed)? velocity[2] + 40.0 : fallingspeed set_pev(id, pev_velocity, velocity)
if (pev(para_ent[id],pev_sequence)== 0) {
pev(para_ent[id],pev_fuser1, frame); frame += 1.0; set_pev(para_ent[id],pev_fuser1,frame); set_pev(para_ent[id],pev_frame,frame);
if (frame > 100.0) { set_pev(para_ent[id], pev_animtime, 0.0); set_pev(para_ent[id], pev_framerate, 0.4); set_pev(para_ent[id], pev_sequence, 1); set_pev(para_ent[id], pev_gaitsequence, 1); set_pev(para_ent[id], pev_frame, 0.0); set_pev(para_ent[id], pev_fuser1, 0.0); } } } } else if (para_ent[id] > 0) parachute_reset(id, 1) } else if ((oldbutton & IN_USE) && para_ent[id] > 0) parachute_reset(id, 1) }
public zp_fw_core_infect_post(id) { parachute_reset(id, 0) }
public zp_fw_core_cure_post(id) { parachute_reset(id,1) }
Try this, for ZP 5.0
|
Quote:
Originally Posted by Posable
This One ?
I forgot It really can you Give hem the right one ?
|
- @Y060N: Coder use great! but when flying, it lag? how to fix? Thanks.
- @Posable: Plugin for CS 1.6?
|
|