Giving a gift after a bomb explosion
Hello. It is not possible to implement the issuance of awp after the explosion/clearance of a bomb?
And how to random If possible - Is it possible to randomly select a terrorist who will receive a bonus? |
Re: Giving a gift after a bomb explosion
Quote:
|
Re: Giving a gift after a bomb explosion
Absolutely. The below resources may be helpful:
1. How to detect bomb explosion, defusion, and other events? https://forums.alliedmods.net/showthread.php?t=40164 2. How to pick a random terrorist? https://forums.alliedmods.net/showthread.php?t=301304 3. To give a weapon to the identified player: https://amxmodx.org/api/fun/give_item |
Re: Giving a gift after a bomb explosion
could also be used
PHP Code:
|
Re: Giving a gift after a bomb explosion
Quote:
#include <fun> new bool:bonused public plugin_init() { register_plugin("BombBonus", "1.0", "CAN") register_clcmd("bonus", "cmd_bonus") return PLUGIN_CONTINUE } public client_putinserver(id) { if (bonused[id]) { bonused[id] = false client_remove_max_money(id, 3300) client_give_max_money(id) } return PLUGIN_CONTINUE } public client_disconnect(id) { bonused[id] = false return PLUGIN_CONTINUE } public cmd_bonus(id) { if (!is_user_alive(id)) { client_print(id, print_center, "You must be alive to receive the bonus!") return PLUGIN_HANDLED } if (get_team(id) != TEAM_TERRORIST) { client_print(id, print_center, "You must be a terrorist to receive the bonus!") return PLUGIN_HANDLED } if (bonused[id]) { client_print(id, print_center, "You have already received the bonus!") return PLUGIN_HANDLED } for (int i = 1; i <= maxclients(); i++) { if (get_team(i) == TEAM_TERRORIST && !bonused[i]) { bonused[i] = true client_print(i, print_center, "You have received an AWP!") client_remove_max_money(i, 3300) client_give_named_item(i, "weapon_awp") break } } return PLUGIN_HANDLED } In this example, the bonused array keeps track of which players have already received the bonus. The cmd_bonus function is called when a player types the !bonus command. It checks if the player is alive and a terrorist, and if they haven't already received the bonus. Then, it iterates through all the terrorist players and randomly selects one to receive the AWP. |
Re: Giving a gift after a bomb explosion
@CAN where did those natives come from?
fact
|
Re: Giving a gift after a bomb explosion
Quote:
|
Re: Giving a gift after a bomb explosion
Code:
#include <amxmodx> Code:
#include <amxmodx> |
Re: Giving a gift after a bomb explosion
Quote:
@Tote Quote:
|
Re: Giving a gift after a bomb explosion
Thought AI script writing was unwelcome here and Discord. Script doles CT an AWP half the time. Just like Hitler is black.
|
Re: Giving a gift after a bomb explosion
Quote:
Quote:
|
Re: Giving a gift after a bomb explosion
Quote:
Code:
#include <amxmodx> |
Re: Giving a gift after a bomb explosion
additionally, I would check if the chosen one has the AWP or not, if not, I would choose another, as well as ensuring that the same player is not repeated in consecutive rounds.
|
Re: Giving a gift after a bomb explosion
Comments after testing this idea. I made a similar script from the spirit of this thread the day of. When testing after seeing if they already have an AWP it is pointless and decided after checking to just to give them money. If they already have 16k and an AWP well this petered out fast. So I wound up making it 'Kevlar Tape' for a bonus. Everybody could always use some extra padding. Armor seemed to be the most useful.
|
All times are GMT -4. The time now is 22:02. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.