←  Pytania

AMXX.pl: Support AMX Mod X i SourceMod

»

Paralizator

  • +
  • -
_.-*`PaniQ*-._ - zdjęcie _.-*`PaniQ*-._ 20.01.2020

Witam, zwracam się z prośbą czy moglibyście przerobić ten plugin zeby był dostępny tylko na VIPA? na flagę n

 

https://amxx.pl/topi...alizator-by-me/

Odpowiedz

  • +
  • -
Balian3D - zdjęcie Balian3D 20.01.2020

Na początku funkcji dodaj warunek

if(!(get_user_flags(id) & tu wpisz nazwę flagi))
       return PLUGIN_HANDLED;
Odpowiedz

  • +
  • -
_.-*`PaniQ*-._ - zdjęcie _.-*`PaniQ*-._ 20.01.2020

Tutaj?

public plugin_init()

 

Odpowiedz

  • +
  • -
Balian3D - zdjęcie Balian3D 20.01.2020

Pierwsza funkcja zarejestrowana, w tym przypadku to:

public fwTakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)

Wygląda to tak:

public fwTakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
	new username[31];
	get_user_name(this, username, 31);
	if(is_user_alive(idattacker) && get_user_team(idattacker) == 2)
	{
public fwTakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
	if(!(get_user_flags(id) & tu wpisz nazwę flagi))
        return PLUGIN_HANDLED;))
    
	return PLUGIN_HANDLED;
	new username[31];
	get_user_name(this, username, 31);
	if(is_user_alive(idattacker) && get_user_team(idattacker) == 2)
	{
Odpowiedz

  • +
  • -
_.-*`PaniQ*-._ - zdjęcie _.-*`PaniQ*-._ 21.01.2020

Nie chce się skompilować jak tak wkleiłem.

public fwTakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
	if(!(get_user_flags(id) & ADMIN_LEVEL_B))
        return PLUGIN_HANDLED;))
    
	return PLUGIN_HANDLED;
	new username[31];
	get_user_name(this, username, 31);
	if(is_user_alive(idattacker) && get_user_team(idattacker) == 2)
	{
		new wid = get_user_weapon(idattacker);	// Id broni
		if(wid == CSW_KNIFE && !CheckParaliz(this) && is_user_alive(this) && get_user_team(this) == 1)
		{
			set_hudmessage(0, 0, 255, 0.0, 0.35, 0, 10.1, 10.1, 0.1, 0.1, 2);
			show_hudmessage(idattacker, "[Sparalizowales: %s]^n[Masz 10 sekund na przeszukanie go]", username);	
			g_iCzas[this] = 10;
			set_task(1.0, "Freeze", this, _, _, "a", 10);
			set_user_maxspeed(this, 0.1);
			set_user_rendering(this, kRenderFxGlowShell, 0, 0, 255, kRenderGlow, 60)
			SetParaliz(this);
			pValue == 1;
			return HAM_SUPERCEDE
		}
	}
	return HAM_IGNORED;
}

 

Odpowiedz

  • +
  • -
Balian3D - zdjęcie Balian3D 21.01.2020

Mój błąd zabrakło index'u oraz jest 2x "return PLUGIN_HANDLED;"

 

Poprawione i działa

public fwTakeDamage(id, this, idinflictor, idattacker, Float:damage, damagebits)
{
	if(!(get_user_flags(id) & ADMIN_LEVEL_B))
		return PLUGIN_HANDLED;

	new username[31];
	get_user_name(this, username, 31);
	if(is_user_alive(idattacker) && get_user_team(idattacker) == 2)
	{
		new wid = get_user_weapon(idattacker);	// Id broni
		if(wid == CSW_KNIFE && !CheckParaliz(this) && is_user_alive(this) && get_user_team(this) == 1)
		{
			set_hudmessage(0, 0, 255, 0.0, 0.35, 0, 10.1, 10.1, 0.1, 0.1, 2);
			show_hudmessage(idattacker, "[Sparalizowales: %s]^n[Masz 10 sekund na przeszukanie go]", username);	
			g_iCzas[this] = 10;
			set_task(1.0, "Freeze", this, _, _, "a", 10);
			set_user_maxspeed(this, 0.1);
			set_user_rendering(this, kRenderFxGlowShell, 0, 0, 255, kRenderGlow, 60)
			SetParaliz(this);
			pValue == 1;
			return HAM_SUPERCEDE
		}
	}
	return HAM_IGNORED;
}
Odpowiedz