[HELP] nemesis control

Tutoriale scripting, cod si portiuni de cod.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
arvEL.-
Membru, skill 0
Membru, skill 0
Posts: 8
Joined: 04 Aug 2015, 04:15
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

08 Nov 2015, 20:02

i need help in zp4.3
i want when i make pinshockfree in nemesis. or assassin
when you shoot o nemesis he stop i mean knockback activated when pinshockfree activated. not stop complatly he walk slowly i think this from sma beacaus i need.difrent control nemesis
i set the knockback = 0
and also not work :/

i need nemesis control, like server NewLifeZM
or zmOutstanding

i find this,

Code: Select all

static cell AMX_NATIVE_CALL twixQsJumps( AMX * pAmx, cell * pParameters )
{
edict_t * pPlayer = MF_GetPlayerEdict( pParameters[ 1 ] );

float fCoolDown, fCurrentTime;

CPlayers[ pParameters[ 1 ] ].monster ? fCoolDown = 1.0 : fCoolDown = 13.0;

fCurrentTime = gpGlobals -> time;

if( fCurrentTime - CPlayers[ pParameters[ 1 ] ].lastleap < fCoolDown  || !( pPlayer -> v.button & IN_JUMP ) || !( pPlayer -> v.flags  & FL_ONGROUND ) || GetSpeed( pPlayer ) < 80 )
return 1;

MAKE_VECTORS( pPlayer -> v.v_angle );

Vector fVelocity;

if( CPlayers[ pParameters[ 1 ] ].monster )
{
fVelocity = gpGlobals -> v_forward * 500, fVelocity[ 2 ] = 300;
}

else
{
fVelocity = gpGlobals -> v_forward * 360, fVelocity[ 2 ] = 250;
}

pPlayer -> v.velocity = fVelocity;

CPlayers[ pParameters[ 1 ] ].lastleap = fCurrentTime;

return 1;
}  
can anyone tell me how to use it ?
and see this

Code: Select all

#include <amxmodx>
#include <fakemeta>
#include <zombie_plague_advance>
#include <hamsandwich>
//#include <protection>

new bool:g_hasLongJump[33]
new Float:g_last_LongJump_time[33]
new g_LongJump_force, g_LongJump_height, g_LongJump_cooldown

static const PLUGIN_NAME[] = "[ZP] Long Jump"
static const PLUGIN_AUTHOR[] = "The_Thing"
static const PLUGIN_VERSION[] = "1.5"

public plugin_init() 
{
	//protection()

	register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
	
	g_LongJump_force = register_cvar("zp_longjump_force", "550")
	g_LongJump_height = register_cvar("zp_longjump_height", "300")
	g_LongJump_cooldown = register_cvar("zp_longjump_cooldown", "5.0")

	register_forward(FM_PlayerPreThink, "fw_PlayerPreThink")
	register_event("DeathMsg", "death", "a")
	register_event("HLTV", "event_round_start", "a", "1=0", "2=0")

}

public client_disconnect(id)
{
	g_hasLongJump[id] = false
}

public death()
{
	g_hasLongJump[read_data(2)] = false
}

public zp_user_infected_post(id)
{
	g_hasLongJump[id] = true
}

public zp_user_humanized_post(id)
{
	g_hasLongJump[id] = false
}

public event_round_start()
{
	for (new i = 1; i <= 32; i++)
		g_hasLongJump[i] = false
}  
	
public fw_PlayerPreThink(id)
{
	if (!is_user_alive(id))
		return FMRES_IGNORED

	if (zp_get_user_nemesis(id))
		return FMRES_IGNORED

	if (zp_get_user_assassin(id))
		return FMRES_IGNORED
	
	if (allow_LongJump(id))
	{
		static Float:velocity[3]
		velocity_by_aim(id, get_pcvar_num(g_LongJump_force), velocity)
		
		velocity[2] = get_pcvar_float(g_LongJump_height)
		
		set_pev(id, pev_velocity, velocity)
		
		g_last_LongJump_time[id] = get_gametime()
	}
	
	return FMRES_IGNORED
}

allow_LongJump(id)
{
	if (!g_hasLongJump[id])
		return false
	
	if (!(pev(id, pev_flags) & FL_ONGROUND) || fm_get_speed(id) < 80)
		return false
	
	static buttons
	buttons = pev(id, pev_button)
	
	if (!is_user_bot(id) && (!(buttons & IN_JUMP) || !(buttons & IN_DUCK)))
		return false
	
	if (get_gametime() - g_last_LongJump_time[id] < get_pcvar_float(g_LongJump_cooldown))
		return false
	
	return true
}

stock fm_get_speed(entity)
{
	static Float:velocity[3]
	pev(entity, pev_velocity, velocity)
	
	return floatround(vector_length(velocity));
}
can anyone tell me what do this plugin LongJumpFix
RoyalServer 2
arvEL.-
Membru, skill 0
Membru, skill 0
Posts: 8
Joined: 04 Aug 2015, 04:15
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

11 Nov 2015, 10:15

up.......
Post Reply

Return to “Scripting”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 14 guests