I need a plugin that adds frag and removes frag

В този раздел можете да подавате всякакви заявки за намиране, изработка или преработка на плъгини/модове.
Аватар
GGzBoy
Извън линия
Foreigner
Foreigner
Мнения: 63
Регистриран на: 28 Мар 2020, 16:42
Се отблагодари: 16 пъти
Получена благодарност: 1 път

I need a plugin that adds frag and removes frag

Мнение от GGzBoy » 27 Окт 2020, 21:41

I need a plugin that adds and removes frag from players
commandos: amx_givefrag, amx_removefrag

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

I need a plugin that adds frag and removes frag

Мнение от OciXCrom » 27 Окт 2020, 21:50

What's the point of it though? Those frags won't be registered in /rank.

Аватар
GGzBoy
Извън линия
Foreigner
Foreigner
Мнения: 63
Регистриран на: 28 Мар 2020, 16:42
Се отблагодари: 16 пъти
Получена благодарност: 1 път

I need a plugin that adds frag and removes frag

Мнение от GGzBoy » 30 Окт 2020, 21:08

for fun, no need to count for rank

Аватар
Orangegame14
Извън линия
Потребител
Потребител
Мнения: 87
Регистриран на: 02 Апр 2020, 22:48
Се отблагодари: 6 пъти
Получена благодарност: 24 пъти

I need a plugin that adds frag and removes frag

Мнение от Orangegame14 » 31 Окт 2020, 02:03

Well i tried but somehow i could not make it happen instantly. It works but for the frags to be updated the targeted player have to either kill or die. :/ You have to adjust #define ACCESS_FLAG to the desired access level, its on Immunity A now. Worked for AMXX 1.8.2.

Edit: Mb had to edit it a bit. You can change the prefix on line 7 renaming the GiveTakeFrags in the " ".

amx_givefrag, amx_removefrag [Name] [Amount]

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

#include <amxmodx>
#include <amxmisc>
#include <fun>

#define ACCESS_FLAG ADMIN_IMMUNITY

new PREFIX[] = "GiveTakeFrags"

new target[32], amount[32];

public plugin_init()
{
	register_plugin("Give/Take Frags", "1.0", "Ibrahim");
	register_concmd("amx_givefrag", "command_givefrag", ACCESS_FLAG, "[Name] [Amount]");
	register_concmd("amx_removefrag", "command_removefrag", ACCESS_FLAG, "[Name] [Amount]");
}
public command_givefrag(id, level, cid)
{
	if(!cmd_access (id, level, cid, 3))
		return PLUGIN_HANDLED;
	
	read_argv(1, target, charsmax(target))
	read_argv(2, amount, charsmax(amount))
	
	new player = cmd_target(id, target, 8)
	
	if(!player) 
		return PLUGIN_HANDLED;
	
	new admin_name[32], target_name[32]
	get_user_name(id, admin_name, charsmax(admin_name))
	get_user_name(player, target_name, charsmax(target_name))
	
	new givefrags = str_to_num(amount)
	
	set_user_frags(player, get_user_frags(player) + givefrags)
	client_print(0, print_chat, "[%s] ADMIN:%s gave %s %i Frags!", PREFIX, admin_name, target_name, givefrags)
	return PLUGIN_HANDLED
}
public command_removefrag(id, level, cid)
{
	if(!cmd_access (id, level, cid, 3))
		return PLUGIN_HANDLED;
	
	read_argv(1, target, charsmax(target))
	read_argv(2, amount, charsmax(amount))
	
	new player = cmd_target(id, target, 8)
	
	if(!player) 
		return PLUGIN_HANDLED;
	
	new admin_name[32], target_name[32]
	get_user_name(id, admin_name, charsmax(admin_name))
	get_user_name(player, target_name, charsmax(target_name))
	
	new takefrags = str_to_num(amount)
	
	client_print(0, print_chat, "[%s] ADMIN:%s removed from %s %i Frags!", PREFIX, admin_name, target_name, takefrags)
	set_user_frags(player, get_user_frags(player) - takefrags)
	return PLUGIN_HANDLED
}

Аватар
atmax
Извън линия
Потребител
Потребител
Мнения: 492
Регистриран на: 22 Мар 2018, 15:06
Се отблагодари: 37 пъти
Получена благодарност: 43 пъти

I need a plugin that adds frag and removes frag

Мнение от atmax » 31 Окт 2020, 10:10

Ofc..you have to update the ScoreInfo.
I will tell you how it works.

write_byte(id) // the player you're updating score to write_short(get_user_frags(id) + 1) // get player's frags and increase them by 1 write_short(get_user_deaths(id)) // deaths stay the same write_short(0) // ClassID write_short(get_user_team(id)) // team ID message_end()

Here is an example:

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

#include <amxmodx>
#include <fun>

new gMsgID_ScoreInfo

public plugin_init()
{
gMsgID_ScoreInfo = get_user_msgid("ScoreInfo")

register_clcmd("/givemekill", "cmd_give")
}

public cmd_give(id)
{
new kills = get_user_frags(id) + 1

set_user_frags(id, kills)

message_begin(MSG_ALL, gMsgID_ScoreInfo)
write_byte(id)
write_short(kills)
write_short(get_user_deaths(id))
write_short(0)
write_short(get_user_team(id))
message_end()
Rest in peace my friend I always will remember you! 🖤👊

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

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

Кой е на линия

Потребители разглеждащи този форум: 0 регистрирани и 16 госта