I need a plugin that adds and removes frag from players
commandos: amx_givefrag, amx_removefrag
I need a plugin that adds frag and removes frag
-
OciXCrom
Извън линия - Администратор
- Мнения: 7206
- Регистриран на: 06 Окт 2016, 19:20
- Местоположение: /resetscore
- Се отблагодари: 117 пъти
- Получена благодарност: 1295 пъти
- Обратна връзка:
I need a plugin that adds frag and removes frag
What's the point of it though? Those frags won't be registered in /rank.
-
Orangegame14
Извън линия - Потребител
- Мнения: 87
- Регистриран на: 02 Апр 2020, 22:48
- Се отблагодари: 6 пъти
- Получена благодарност: 24 пъти
I need a plugin that adds frag and removes frag
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]
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
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:
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!
-
- Подобни теми
- Отговори
- Преглеждания
- Последно мнение
-
- 2 Отговори
- 644 Преглеждания
-
Последно мнение от john007
-
- 0 Отговори
- 1303 Преглеждания
-
Последно мнение от Niklstr
-
- 2 Отговори
- 281 Преглеждания
-
Последно мнение от Huehue
-
- 0 Отговори
- 1324 Преглеждания
-
Последно мнение от Ricardo01
-
- 5 Отговори
- 2204 Преглеждания
-
Последно мнение от impossible
-
- 2 Отговори
- 738 Преглеждания
-
Последно мнение от tom1k
-
- 4 Отговори
- 1895 Преглеждания
-
Последно мнение от impossible
Кой е на линия
Потребители разглеждащи този форум: 0 регистрирани и 16 госта