Win money with Knife

В този раздел можете да подавате всякакви заявки за намиране, изработка или преработка на плъгини/модове.
Аватар
lantimilan
Извън линия
Foreigner
Foreigner
Мнения: 424
Регистриран на: 29 Ное 2017, 22:49
Се отблагодари: 31 пъти
Получена благодарност: 3 пъти

Win money with Knife

Мнение от lantimilan » 02 Дек 2017, 21:35

Hello i find this plugin in one forum but i cant understand hud message appers 0.1 mili second lost fast can you try to size more 4-5 second to show this message and when you kill with knife plugin not tell name just show some code wrong 18765665652 , who can fix this ?

Код за потвърждение: Избери целия код

#include <amxmodx>
#include <cstrike>
#include <colorchat>

#define PLUGIN "Win Money with Knife"
#define VERSION "1.0"
#define AUTHOR "chrisss"

new g_money

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_event("DeathMsg", "DeathMsg", "a")
	g_money = register_cvar ("g_money", "2500");
}
public DeathMsg()
{
	new zabojca = read_data(1);
	new ofiara = read_data(2);
	new weapon[32];
	read_data(4,weapon,31);

	if(zabojca == ofiara || zabojca == 0)
	return;

	if(containi(weapon, "knife") == -1)
	return;

	if(!is_user_connected(zabojca) || !is_user_alive(zabojca))
	return;

	new name_zabojca[32], name_ofiara[32];
	get_user_name(zabojca, name_zabojca, 31);
	get_user_name(ofiara, name_ofiara, 31);
	
	set_hudmessage(255, 0, 0, -1.0, 0.3, 1, 5.0, 6.0)
	show_hudmessage(0, "%s me thike %s", name_zabojca, name_ofiara)
	
	ColorChat(0, GREEN, "Bravo, ti je me i miri sepse %d per vrasjen me thike.",g_money);

	cs_set_user_money(zabojca, cs_get_user_money(zabojca)+get_pcvar_num(g_money), 1);
}

Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7206
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1295 пъти
Обратна връзка:

Win money with Knife

Мнение от OciXCrom » 02 Дек 2017, 21:42

Код за потвърждение: Избери целия код

#include <amxmodx>
#include <cstrike>
#include <colorchat>

#define PLUGIN "Win Money with Knife"
#define VERSION "1.0"
#define AUTHOR "chrisss"

new g_money

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR);
	register_event("DeathMsg", "DeathMsg", "a");
	g_money = register_cvar ("g_money", "2500");
}
public DeathMsg()
{
	new zabojca = read_data(1);
	new ofiara = read_data(2);
	
	if(zabojca == ofiara || !is_user_alive(zabojca) || !is_user_connected(ofiara))
	    return;
	    
	new weapon[32];
	read_data(4,weapon,charsmax(weapon));	

	if(!equal(weapon, "knife"))
	    return;

	new name_zabojca[32], name_ofiara[32], money = get_pcvar_num(g_money);
	get_user_name(zabojca, name_zabojca, charsmax(name_zabojca));
	get_user_name(ofiara, name_ofiara, charsmax(name_ofiara));
	
	set_hudmessage(255, 0, 0, -1.0, 0.3, .holdtime = 5.0);
	show_hudmessage(0, "%s me thike %s", name_zabojca, name_ofiara);
	
	ColorChat(0, GREEN, "Bravo, ti je me i miri sepse %d per vrasjen me thike.",money);
	cs_set_user_money(zabojca, cs_get_user_money(zabojca)+money, 1);
}

Аватар
lantimilan
Извън линия
Foreigner
Foreigner
Мнения: 424
Регистриран на: 29 Ное 2017, 22:49
Се отблагодари: 31 пъти
Получена благодарност: 3 пъти

Win money with Knife

Мнение от lantimilan » 03 Дек 2017, 09:29

Hey bro again something its wrong HUD Message show for 0.1 milisecond lost very fast and money not show fine because when you kill you win 2500 in server show 300 can you see whats wrong or to creat one same plugin
Look photo : https://i.imgur.com/A0a5SLl.png

Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7206
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1295 пъти
Обратна връзка:

Win money with Knife

Мнение от OciXCrom » 03 Дек 2017, 15:15

You have too many HUD messages on the screen at the same time. There can't be more than 4 at once so that's why it disappears. Also, I'm pretty sure the HUD is reset on death so doing this is a bad idea. Maybe switch to a chat message instead?

I fixed the money:

Код за потвърждение: Избери целия код

#include <amxmodx>
#include <cstrike>
#include <colorchat>

#define PLUGIN "Win Money with Knife"
#define VERSION "1.0"
#define AUTHOR "chrisss"

new g_money

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR);
	register_event("DeathMsg", "DeathMsg", "a");
	g_money = register_cvar ("g_money", "2500");
}
public DeathMsg()
{
	new zabojca = read_data(1);
	new ofiara = read_data(2);
	
	if(zabojca == ofiara || !is_user_alive(zabojca) || !is_user_connected(ofiara))
	    return;
	    
	new weapon[32];
	read_data(4,weapon,charsmax(weapon));

	if(!equal(weapon, "knife"))
	    return;

	new name_zabojca[32], name_ofiara[32], money = get_pcvar_num(g_money);
	get_user_name(zabojca, name_zabojca, charsmax(name_zabojca));
	get_user_name(ofiara, name_ofiara, charsmax(name_ofiara));
	
	set_hudmessage(255, 0, 0, -1.0, 0.3, .holdtime = 5.0);
	show_hudmessage(0, "%s me thike %s", name_zabojca, name_ofiara);
	
	ColorChat(0, GREEN, "Bravo, ti je me i miri sepse %d per vrasjen me thike.", money);
	cs_set_user_money(zabojca, cs_get_user_money(zabojca) + money, 1);
}

Аватар
lantimilan
Извън линия
Foreigner
Foreigner
Мнения: 424
Регистриран на: 29 Ное 2017, 22:49
Се отблагодари: 31 пъти
Получена благодарност: 3 пъти

Win money with Knife

Мнение от lantimilan » 04 Дек 2017, 09:59

Again show same in photo 300$ he not add 2500

Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7206
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1295 пъти
Обратна връзка:

Win money with Knife

Мнение от OciXCrom » 04 Дек 2017, 14:30

If you receive 300$ because of some other plugin or the game itself, the other money won't show because you get them at the same time. You still get them though. Try the code in the last comment again - I edited it.

Аватар
lantimilan
Извън линия
Foreigner
Foreigner
Мнения: 424
Регистриран на: 29 Ное 2017, 22:49
Се отблагодари: 31 пъти
Получена благодарност: 3 пъти

Win money with Knife

Мнение от lantimilan » 18 Мар 2018, 09:14

Fixed close topic ;)

Заключено
  • Подобни теми
    Отговори
    Преглеждания
     Последно мнение

Обратно към “Заявки за плъгини”

Кой е на линия

Потребители разглеждащи този форум: Bing [Bot] и 25 госта