Участник
Пользователь
- Сообщения
- 278
- Реакции
- 137
#include <amxmodx>
#include <reapi>
#pragma semicolon 1
new bool:sv_parachute;
public plugin_init() {
register_plugin("ReParachute", "1.0", "PurposeLess");
RegisterHookChain(RG_PM_AirMove, "PM_AirMove", .post=false);
bind_pcvar_num(create_cvar("sv_parachute", "1", _, "Enable Parachute", true, 0.0, true, 1.0), sv_parachute);
}
public PM_AirMove(const id)
{
if(!sv_parachute)
return HC_CONTINUE;
static button; button = get_entvar(id, var_button);
if(!(button & IN_USE))
return HC_CONTINUE;
static Float:velocity[3];
get_entvar(id, var_velocity, velocity);
if(velocity[2] < 0.0)
{
velocity[2] = (velocity[2] + 40.0 < -100.0) ? velocity[2] + 40.0 : -100.0;
set_entvar(id, var_sequence, ACT_WALK);
set_entvar(id, var_gaitsequence, ACT_IDLE);
set_pmove(pm_velocity, velocity);
set_movevar(mv_gravity, 80.0);
}
return HC_CONTINUE;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1055\\ f0\\ fs16 \n\\ par }
*/
RG_CBasePlayer_Killed
и RG_CBasePlayer_Spawn
в pre?--remove_entity(entity);
++set_entvar(entity, var_flags, FL_KILLME);
--entity_get_*
--entity_set_*
++get_entvar
++set_entvar
--create_entity
++rg_create_entity
да не нужен он там.PreThink
.
#include <amxmodx>
#include <reapi>
#pragma semicolon 1
new bool:sv_parachute;
public plugin_init() {
register_plugin("ReParachute", "1.1", "PurposeLess");
RegisterHookChain(RG_PM_AirMove, "PM_AirMove", .post=false);
bind_pcvar_num(create_cvar("sv_parachute", "1", _, "Enable Parachute", true, 0.0, true, 1.0), sv_parachute);
}
public PM_AirMove(const id)
{
if(!sv_parachute)
{
return HC_CONTINUE;
}
if(!(get_entvar(id, var_button) & IN_USE))
{
return HC_CONTINUE;
}
new Float:velocity[3];
get_entvar(id, var_velocity, velocity);
if(velocity[2] < 0.0)
{
velocity[2] = (velocity[2] + 40.0 < -100.0) ? velocity[2] + 40.0 : -100.0;
set_entvar(id, var_sequence, ACT_WALK);
set_entvar(id, var_gaitsequence, ACT_IDLE);
set_pmove(pm_velocity, velocity);
}
return HC_CONTINUE;
}
without airmove, just move.How can I do without PreThink?
#include <amxmodx>
#include <reapi>
#pragma semicolon 1
new bool:sv_parachute;
public plugin_init() {
register_plugin("ReParachute", "1.1", "PurposeLess");
RegisterHookChain(RG_PM_AirMove, "PM_AirMove", .post=false);
bind_pcvar_num(create_cvar("sv_parachute", "1", _, "Enable Parachute", true, 0.0, true, 1.0), sv_parachute);
}
public PM_AirMove(const id)
{
if(!sv_parachute)
{
return HC_CONTINUE;
}
if(!(get_entvar(id, var_button) & IN_USE))
{
return HC_CONTINUE;
}
new Float:velocity[3];
get_entvar(id, var_velocity, velocity);
if(velocity[2] < 0.0)
{
velocity[2] = (velocity[2] + 40.0 < -100.0) ? velocity[2] + 40.0 : -100.0;
set_entvar(id, var_sequence, ACT_WALK);
set_entvar(id, var_gaitsequence, ACT_IDLE);
set_pmove(pm_velocity, velocity);
}
return HC_CONTINUE;
}
#if defined REPARACHUTE_MODEL
-new para_ent[MAX_CLIENTS + 1], parachute_model_index;
+new para_ent[MAX_PLAYERS + 1], parachute_model_index;
-if(get_pmove(pm_waterlevel) == 0 && get_pmove(pm_onground) == -1)
+if(get_pmove(pm_waterlevel) == 0)