Nietestowane.
@UP
Poprawka - nie odrzuca ludzi.
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <zombieplague>
#include <fakemeta>
#include <hamsandwich>
#define PLUGIN "[Umiejetnosc] Odrzut radialny"
#define VERSION "1.3"
#define AUTHOR "AMXX.pl"
new g_iMaxPlayers;
new bool:g_bUzyl[33];
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_forward(FM_EmitSound, "EmitSound");
RegisterHam(Ham_Spawn, "player", "Odrodzenie", 1);
}
public plugin_cfg(){
g_iMaxPlayers = get_maxplayers()
}
public Odrodzenie(id)
g_bUzyl[id] = false;
public EmitSound(id, iChannel, szSound[], Float:fVol, Float:fAttn, iFlags, iPitch )
{
if( equal(szSound, "common/wpn_denyselect.wav") && zp_is_survivor_round() )
{
if( is_user_alive(id) && zp_get_user_survivor(id) )
{
if( g_bUzyl[id] )
{
client_print(id, print_center, "Juz uzyles tej umiejetnosci !");
return FMRES_IGNORED;
}
new Float:pusher[3], Float:pushed[3], Float:velocity[3]
pev(id,pev_origin,pusher)
for(new i = 1; i<=g_iMaxPlayers; i++)
{
if( !is_user_alive(i) || i==id || zp_get_user_survivor(i))
continue;
pev(i,pev_origin,pushed);
if( vector_distance(pusher,pushed)>500.0 )
continue;
get_speed_vector(pusher,pushed,1200.0,velocity)
set_pev(i,pev_velocity,velocity)
}
g_bUzyl[id] = true
}
return FMRES_SUPERCEDE;
}
return FMRES_IGNORED;
}
stock get_speed_vector(const Float:origin1[3],const Float:origin2[3],Float:speed, Float:new_velocity[3])
{
new_velocity[0] = origin2[0] - origin1[0]
new_velocity[1] = origin2[1] - origin1[1]
new_velocity[2] = origin2[2] - origin1[2]
new Float:num = floatsqroot(speed*speed / (new_velocity[0]*new_velocity[0] + new_velocity[1]*new_velocity[1] + new_velocity[2]*new_velocity[2]))
new_velocity[0] *= num
new_velocity[1] *= num
new_velocity[2] *= num
}
Użytkownik _McHappy edytował ten post 04.02.2017 19:57