#include <amxmodx>
#include <hamsandwich>
#include <engine>
//#define PARACHUTE_FLAG ADMIN_ALL // ADMIN_ALL для доступа всем игрокам
new g_iAlive[33];
//new bool:g_bAccess[33];
public plugin_init()
{
register_plugin("Parachute", "1.1", "maeStro | neygomon");
RegisterHam(Ham_Spawn, "player", "fwdHamPlayerSpawn", true);
RegisterHam(Ham_Killed, "player", "fwdHamPlayerKilled", true);
}
public client_putinserver(pClient)
{
g_iAlive[pClient] = 0;
//g_bAccess[pClient] = (get_user_flags(pClient) & PARACHUTE_FLAG) ? true : false;
}
public fwdHamPlayerSpawn(pClient)
g_iAlive[pClient] = is_user_alive(pClient);
public fwdHamPlayerKilled(pVictim)
g_iAlive[pVictim] = 0;
public client_PreThink(id)
{
if(!g_iAlive[id] /*|| !g_bAccess[id]*/ || ~get_user_button(id) & IN_USE || get_entity_flags(id) & FL_ONGROUND) return;
static Float:velocity[3]; entity_get_vector(id, EV_VEC_velocity, velocity);
if(velocity[2] < 0)
{
velocity[2] = (velocity[2] + 40.0 < -100) ? velocity[2] + 40.0 : -100.0;
entity_set_vector(id, EV_VEC_velocity, velocity);
}
}