←  Problemy

AMXX.pl: Support AMX Mod X i SourceMod

»

CoD Nowy
problem z animacją

  • +
  • -
SP3D! - zdjęcie SP3D! 06.03.2018

Mam problem chciałem ustawić aby po naciśnięciu LPM (ATTACK) na kosie działało: set_pev(id, pev_weaponanim, 2); , ale nwm jak to zrobić

Odpowiedz

  • +
  • -
AwIlL^^ - zdjęcie AwIlL^^ 06.03.2018

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fakemeta>

#define PLUGIN "Animacja noza dla LPM"
#define VERSION "1.0"
#define AUTHOR "AwIlL"

public plugin_init() 
{ 
	register_plugin(PLUGIN, VERSION, AUTHOR);
	
	RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_knife", "Noz_LPM");
}

public Noz_LPM(ent)
{
	static id;
	id = get_pdata_cbase(ent,41,4); //pobiera id gracza (wlasciciel noza)
	if(iOwner == 0)
	{
		return HAM_IGNORED;
	}
	if(!is_user_alive(id))
		return HAM_IGNORED;
		
	setWeaponAnim(id, 2);
}

stock setWeaponAnim(id, anim) 
{
	set_pev(id, pev_weaponanim, anim)
	
	message_begin(MSG_ONE, SVC_WEAPONANIM, {0, 0, 0}, id)
	write_byte(anim)
	write_byte(pev(id, pev_body))
	message_end()
}
Odpowiedz

  • +
  • -
SP3D! - zdjęcie SP3D! 06.03.2018

Przerób pod klase zapomniałem napisac

Odpowiedz

  • +
  • -
AwIlL^^ - zdjęcie AwIlL^^ 06.03.2018

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fakemeta>
#include <codmod>

#define PLUGIN nazwa
#define VERSION "1.0"
#define AUTHOR "AwIlL"

new const nazwa[]   = "";
new const opis[]    = "";
new const bronie    = 0;
new const zdrowie   = 0;
new const kondycja  = 0;
new const inteligencja = 0;
new const wytrzymalosc = 0;

new bool:ma_klase[33];

public plugin_init() 
{ 
	register_plugin(PLUGIN, VERSION, AUTHOR);
	cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
	
	RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_knife", "Noz_LPM");
}

public cod_class_enabled(id)
{
	ma_klase[id] = true;
}

public cod_class_disabled(id)
{
    ma_klase[id] = false;
}

public Noz_LPM(ent)
{
	static id;
	id = get_pdata_cbase(ent,41,4); //pobiera id gracza (wlasciciel noza)
	if(!is_user_alive(id) || !ma_klase[id])
	{
		return HAM_IGNORED;
	}
		
	setWeaponAnim(id, 2);
	return HAM_IGNORED;
}

stock setWeaponAnim(id, anim) 
{
	set_pev(id, pev_weaponanim, anim)
	
	message_begin(MSG_ONE, SVC_WEAPONANIM, {0, 0, 0}, id)
	write_byte(anim)
	write_byte(pev(id, pev_body))
	message_end()
}
Odpowiedz

  • +
  • -
SP3D! - zdjęcie SP3D! 06.03.2018

dzięki ;)

Odpowiedz