1.
Kod php:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Nowy Plugin"
#define VERSION "1.0"
#define AUTHOR "Sn!ff3r"
new Float:gametime
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("CurWeapon","CurWeapon","be", "1=1", "2=4")
register_logevent("Round_Start", 2, "1=Round_Start")
}
public CurWeapon(id)
{
if(get_gametime() - gametime < 10.0)
{
engclient_cmd(id, "weapon_knife")
client_print(id, print_center, "HE dopiero po 10 sekundach")
}
}
public Round_Start()
{
gametime = get_gametime()
}
2.
Kod php:
/* AMX Mod X
* Descriptive 'Fire in the hole!'
*
* (c) Copyright 2006 by VEN
*
* This file is provided as is (no warranties)
*
* DESCRIPTION
* Plugin provides additional colored text for "Fire in the hole!" radio chat message.
* The color and the text is different for each grenade type and can be altered.
* This will help teammates to get the throwed grenade type and act accordingly.
* Search for "EDITABLE" mark in the plugin's source code to configure text and color.
*
* CREDITS
* Damaged Soul - colored chat text method
* p3tsin - team color override method
*/
#include <amxmodx>
#define PLUGIN_NAME "Descriptive 'Fire in the hole!'"
#define PLUGIN_VERSION "0.1"
#define PLUGIN_AUTHOR "VEN"
enum grenade {
GRENADE_HE,
GRENADE_FLASH,
GRENADE_SMOKE
}
new const g_grenade_weaponid[_:grenade] = {
CSW_HEGRENADE,
CSW_FLASHBANG,
CSW_SMOKEGRENADE
}
#define RADIOTEXT_MSGARG_NUMBER 5
enum radiotext_msgarg {
RADIOTEXT_MSGARG_PRINTDEST = 1,
RADIOTEXT_MSGARG_CALLERID,
RADIOTEXT_MSGARG_TEXTTYPE,
RADIOTEXT_MSGARG_CALLERNAME,
RADIOTEXT_MSGARG_RADIOTYPE,
}
new const g_required_radiotype[] = "#Fire_in_the_hole"
public plugin_init() {
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
register_message(get_user_msgid("TextMsg"), "message_text")
}
public message_text(msgid, dest, id) {
if (get_msg_args() != RADIOTEXT_MSGARG_NUMBER || get_msg_argtype(RADIOTEXT_MSGARG_RADIOTYPE) != ARG_STRING)
return PLUGIN_CONTINUE
static arg[32]
get_msg_arg_string(RADIOTEXT_MSGARG_RADIOTYPE, arg, sizeof arg - 1)
if (!equal(arg, g_required_radiotype))
return PLUGIN_CONTINUE
get_msg_arg_string(RADIOTEXT_MSGARG_CALLERID, arg, sizeof arg - 1)
new caller = str_to_num(arg)
if (!is_user_alive(caller))
return PLUGIN_CONTINUE
new clip, ammo, weapon
weapon = get_user_weapon(caller, clip, ammo)
for (new i; i < sizeof g_grenade_weaponid; ++i) {
if (g_grenade_weaponid[i] == weapon) {
get_msg_arg_string(RADIOTEXT_MSGARG_CALLERNAME, arg, sizeof arg - 1)
client_print(0, print_chat, "%s (RADIO): Fire in the hole!", arg)
return PLUGIN_HANDLED
}
}
return PLUGIN_CONTINUE
}