←  Prośby o modyfikacje silników/klas/perków

AMXX.pl: Support AMX Mod X i SourceMod

»

Zmiana w komandosie 1/1 z noża

  • +
  • -
MasloG's Photo MasloG 13.08.2012

Witam

Mam pytanie jak zmienić szansę na natychmiastowe zabicie z noża w klasie "Komandos" ?
Quote

  • +
  • -
иєxт's Photo иєxт 13.08.2012

Łap tutaj poprawnego

jak zrobić 1/1 z kosy?


#include <hamsandwich>

#define DMG_BULLET (1<<1)

w plugin int

RegisterHam(Ham_TakeDamage, "player", "TakeDamage");

na końcu .

public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
if(!is_user_connected(idattacker))
return HAM_IGNORED;

if(!ma_klase[idattacker])
return HAM_IGNORED;

if(get_user_weapon(idattacker) == CSW_KNIFE && damagebits & DMG_BULLET && damage > 20.0)
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);

return HAM_IGNORED;
}

Attached Files

Quote

  • +
  • -
MasloG's Photo MasloG 13.08.2012

Właśnie chce zrobić aby nie było 1/1 z kosy tylko 1/3
Quote

  • +
  • -
fgsfds's Photo fgsfds 13.08.2012

Zrób sobie małe generowanie liczb losowych:
if(random_num(0, 2) == 0) {
// masz 33% szans na wykonanie tego kodu
}

Edited by Maxorq, 13.08.2012 18:18.
Quote

  • +
  • -
MasloG's Photo MasloG 13.08.2012

Mógłbyś mi to zrobić ? nie za bardzo wiem jak to zrobić więc napisałem prośbę aby mi to ktoś zrobił



/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <codmod>
#include <hamsandwich>
#include <engine>
#include <colorchat>

#define DMG_BULLET (1<<1)


new bool:ma_klase[33];

new const nazwa[] = "Komandos";
new const opis[] = "Natychmiastowe zabicie z noza(PPM)";
new const bronie = 1<<CSW_DEAGLE;
new const zdrowie = 40;
new const kondycja = 60;
new const inteligencja = 5;
new const wytrzymalosc = 0;

public plugin_init()
{
register_plugin(nazwa, "1.0", "QTM_Peyote");

cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);

RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
}

public cod_class_enabled(id)

new identyfikator[33];
get_user_name(id, identyfikator, 32);

{
ColorChat(id, GREEN, "Milej gry na PlayCS.pl!", nazwa);
if(!equal(identyfikator, "") && !equal(identyfikator, ""))
{
client_print(id, print_chat, "[%s] Nie masz uprawnien, aby uzywac tej klasy. Aby kupic pisz GG: 5826174 :)", nazwa)
return COD_STOP;
}
ma_klase[id] = true;
return COD_CONTINUE;
}

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


public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
if(!is_user_connected(idattacker))
return HAM_IGNORED;

if(!ma_klase[idattacker])
return HAM_IGNORED;

if(get_user_weapon(idattacker) == CSW_KNIFE && damagebits & DMG_BULLET && damage > 20.0)
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);

return HAM_IGNORED;
}

Quote

  • +
  • -
fgsfds's Photo fgsfds 13.08.2012

Nie znam się na tym "Call of Duty" modzie, ale sądzę, że dodanie tego dookoła linijki "cod_inflict_damage" powinno działać.

public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits) {
if(!is_user_connected(idattacker))
return HAM_IGNORED;
if(!ma_klase[idattacker])
return HAM_IGNORED;
if(get_user_weapon(idattacker) == CSW_KNIFE && damagebits & DMG_BULLET && damage > 20.0)
if(random_num(0,2) == 0)
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);
return HAM_IGNORED;
}


Można byłoby te dwa "if'y" połączyć, ale za leniwy jestem :P
Edited by Maxorq, 13.08.2012 18:31.
Quote

  • +
  • -
MasloG's Photo MasloG 13.08.2012

Nie działa proszę o zrobienie tego 1/3 z noża

Pilne !
Quote

  • +
  • -
fgsfds's Photo fgsfds 13.08.2012

Miałeś taki lekki problemik z klamrą, łap Dropbox - codmod_komandos.amxx - Simplify your life

Kod w załączniku, widzę pewien problem, ale pozwolę ci go sam naprawić...

Attached Files

Quote

  • +
  • -
diablo9816's Photo diablo9816 13.08.2012


#include <amxmodx>

#include <amxmisc>

#include <codmod>

#include <hamsandwich>

#include <cstrike>

#include <fakemeta>

#define DMG_BULLET (1<<1)

				

new const nazwa[]  = "komandos ";

new const opis[]	 = "ma 1/3 z kosy.";

new const bronie   = 1<<CSW_DEAGLE;

new const zdrowie   = 0;

new const kondycja  = 35;

new const inteligencja = 0;

new const wytrzymalosc = 0;



new ma_klase[33];

public plugin_init()

{

register_plugin(nazwa, "1.0", "Diablo");

cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);

				RegisterHam(Ham_TakeDamage, "player", "TakeDamage");

}

public cod_class_enabled(id)

{

ma_klase[id] = true;

}

public cod_class_disabled(id)

{

ma_klase[id] = false;

}

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

{

				if(!is_user_connected(idattacker))

								return HAM_IGNORED;

		

				if(!ma_klase[idattacker])

								return HAM_IGNORED;

		

				if(damagebits & DMG_BULLET)

				{

								new weapon = get_user_weapon(idattacker);

						

								if(weapon == CSW_KNIFE && damage > 20.0 && random_num(1,3) == 1)

												cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);

										

				}

		

				return HAM_IGNORED;


Edited by diablo9816, 13.08.2012 19:04.
Quote

  • +
  • -
fgsfds's Photo fgsfds 13.08.2012

@diablo9816, chyba nie dorzuciłeś zmian które on zrobił w kodzie, typu wartości zdrowia, broń, czy chociażby wiadomości o kupnie klasy na chacie...
Quote

  • +
  • -
diablo9816's Photo diablo9816 13.08.2012

Tak tylko żeby ta klasa była premium musi być na jakiejś fladze admin level np a >A nie tylko wiadomośc bo każdy będzie mógł ją wybrać a co do statów to może sam zmienic :D
Quote

  • +
  • -
fgsfds's Photo fgsfds 13.08.2012

Zważając na ten komentarz:

nie za bardzo wiem jak to zrobić więc napisałem prośbę aby mi to ktoś zrobił


nie sądzę, żeby jemu się chciało :P
Quote

  • +
  • -
diablo9816's Photo diablo9816 13.08.2012


#include <amxmodx>

#include <amxmisc>

#include <codmod>

#include <hamsandwich>

#include <cstrike>

	  

new const nazwa[]   = "Komandos";

new const opis[]	= "Ma 1/3 z ppm";

new const bronie	= (1<<CSW_DEAGLE);

new const zdrowie   = 40;

new const kondycja  = 60;

new const inteligencja = 5;

new const wytrzymalosc = 0;

  

new ma_klase[33];

public plugin_init()

{

	register_plugin(nazwa, "1.0", "amxx.pl");

	cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);



	RegisterHam(Ham_TakeDamage, "player", "fwTakeDamage_JedenCios");

}

public cod_class_enabled(id)

{

	if(!(get_user_flags(id) & ADMIN_LEVEL_A))

	{

		client_print(id, print_chat, "[Komandos] Nie masz uprawnien, aby uzywac tej klasy.")

		return COD_STOP;

	}

	ma_klase[id] = true;



	return COD_CONTINUE;

}

public cod_class_disabled(id)

{

	ma_klase[id] = false;

}

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

{

								if(!is_user_connected(idattacker))

																return HAM_IGNORED;

				

								if(!ma_klase[idattacker])

																return HAM_IGNORED;

				

								if(damagebits & DMG_BULLET)

								{

																new weapon = get_user_weapon(idattacker);

												

																if(weapon == CSW_KNIFE && damage > 20.0 && random_num(1,3) == 1)

																								cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);

																				

								}

				

								return HAM_IGNORED;




Edited by diablo9816, 13.08.2012 19:28.
Quote

  • +
  • -
MasloG's Photo MasloG 13.08.2012

nie wiem co tutaj mam źle że mi nie chce skompilować tej klasy ?

również proszę o sprawdzenie czy jest okej 1/3 z noża

to nie ma być klasa na flagę

Attached Files

Quote

  • +
  • -
diablo9816's Photo diablo9816 13.08.2012

#include <amxmodx>
#include <codmod>
#include <hamsandwich>
#include <engine>
#include <colorchat>

#define DMG_BULLET (1<<1)


new bool:ma_klase[33];

new const nazwa[] = "Komandos";
new const opis[] = "1/3 na zabicie z noza";
new const bronie = 1<<CSW_DEAGLE;
new const zdrowie = 40;
new const kondycja = -10;
new const inteligencja = 5;
new const wytrzymalosc = 0;

public plugin_init()
{
register_plugin(nazwa, "1.0", "QTM_Peyote");

cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);

RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
}

public cod_class_enabled(id)

new identyfikator[33];
get_user_name(id, identyfikator, 32);
}
ColorChat(id, GREEN, "Milej gry na PlayCS !", nazwa);
if(!equal(identyfikator, "") && !equal(identyfikator, ""))
{
client_print(id, print_chat, "[%s] Nie masz uprawnien, aby uzywac tej klasy. Aby kupic pisz GG: 5826174 :)", nazwa)
return COD_STOP;
}
ma_klase[id] = true;
return COD_CONTINUE;
}
public cod_class_disabled(id)
{
ma_klase[id] = false;
}
public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
if(!is_user_connected(idattacker))
return HAM_IGNORED;

if(!ma_klase[idattacker])
return HAM_IGNORED;

if(damagebits & DMG_BULLET)
{
new weapon = get_user_weapon(idattacker);

if(weapon == CSW_KNIFE && damage > 20.0 && random_num(1,3) == 1)
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);

}

return HAM_IGNORED;
}
Quote

  • +
  • -
MasloG's Photo MasloG 13.08.2012

Błędy przy kompilacji:



codclass_komandos.sma(31) : error 003: declaration of a local variable must appear in a compound block
codclass_komandos.sma(34) : error 021: symbol already defined: "ColorChat"
codclass_komandos.sma(35) : error 010: invalid function or declaration
codclass_komandos.sma(38) : error 010: invalid function or declaration
codclass_komandos.sma(41) : error 010: invalid function or declaration
codclass_komandos.sma(67) : warning 203: symbol is never used: "ColorChat"
codclass_komandos.sma(67) : warning 203: symbol is never used: "ColorSelection"
codclass_komandos.sma(67) : warning 203: symbol is never used: "FindPlayer"
codclass_komandos.sma(67) : warning 203: symbol is never used: "ShowColorMessage"
codclass_komandos.sma(67) : warning 203: symbol is never used: "Team_Info"

Quote

  • +
  • -
diablo9816's Photo diablo9816 13.08.2012

Jak chcesz zeby działa musi być napisana tak jako premium chyba ze to nie premium


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

#define DMG_BULLET (1<<1)



new const nazwa[] = "Komandos";
new const opis[] = "Ma 1/3 z ppm";
new const bronie = (1<<CSW_DEAGLE);
new const zdrowie = 40;
new const kondycja = 60;
new const inteligencja = 5;
new const wytrzymalosc = 0;

new ma_klase[33];
public plugin_init()
{
register_plugin(nazwa, "1.0", "amxx.pl");
cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);

RegisterHam(Ham_TakeDamage, "player", "fwTakeDamage_JedenCios");
}
public cod_class_enabled(id)
{
if(!(get_user_flags(id) & ADMIN_LEVEL_A))
{
client_print(id, print_chat, "[Komandos] Nie masz uprawnien, aby uzywac tej klasy.")
return COD_STOP;
}
ma_klase[id] = true;

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

public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
if(!is_user_connected(idattacker))
return HAM_IGNORED;

if(!ma_klase[idattacker])
return HAM_IGNORED;

if(damagebits & DMG_BULLET)
{
new weapon = get_user_weapon(idattacker);

if(weapon == CSW_KNIFE && damage > 20.0 && random_num(1,3) == 1)
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);

}

return HAM_IGNORED;
}
Quote