Проверенный
Пользователь
- Сообщения
- 1,031
- Реакции
- 827
- Помог
- 10 раз(а)
#include <amxmodx>
#include <fakemeta>
#include <reapi>
new const MAX_CLIP[] = { -1, 13, -1, 10, -1, 7, -1, 30, 30, -1, 30, 20, 25, 30, 35, 25, 12, 20, 10, 30, 100, 8, 30, 30, 20, -1, 7, 30, 30, -1, 50 }ж
public plugin_init() {
register_forward(FM_UpdateClientData, "UpdateClientData_Post", true);
}
public UpdateClientData_Post(const id, const sendweapons, const cd) {
if (!is_user_connected(id)) {
return;
}
static item;
item = get_member(id, m_pActiveItem);
if (is_nullent(item)) {
return;
}
static WeaponIdType:wid;
wid = WeaponIdType:get_member(item, m_iId);
if (wid <= WEAPON_NONE || wid > WEAPON_P90 || MAX_CLIP[_:wid] == -1) {
return;
}
static maxClip;
maxClip = rg_get_iteminfo(item, ItemInfo_iMaxClip);
if (MAX_CLIP[_:wid] == maxClip || get_member(item, m_Weapon_iClip) != maxClip) {
return;
}
static Float:vector[3];
switch (wid) {
case WEAPON_P228: { // ammo_357sig
get_cd(cd, CD_vUser3, vector);
vector[2] = 0.0;
set_cd(cd, CD_vUser3, vector);
}
case WEAPON_SCOUT, WEAPON_G3SG1, WEAPON_AK47: { // ammo_762nato
get_cd(cd, CD_vUser2, vector);
vector[0] = 0.0;
set_cd(cd, CD_vUser2, vector);
}
case WEAPON_XM1014, WEAPON_M3: { // ammo_buckshot
set_cd(cd, CD_AmmoShells, 0);
get_cd(cd, CD_vUser4, vector);
vector[1] = 0.0;
set_cd(cd, CD_vUser4, vector);
}
case WEAPON_MAC10, WEAPON_UMP45, WEAPON_USP: { // ammo_45acp
get_cd(cd, CD_vUser2, vector);
vector[1] = 0.0;
set_cd(cd, CD_vUser2, vector);
}
case WEAPON_AUG, WEAPON_SG550, WEAPON_GALIL, WEAPON_FAMAS, WEAPON_M4A1, WEAPON_SG552: { // ammo_556nato
set_cd(cd, CD_AmmoCells, 0);
}
case WEAPON_ELITE, WEAPON_GLOCK18, WEAPON_MP5N, WEAPON_TMP: { // ammo_9mm
set_cd(cd, CD_AmmoNails, 0);
}
case WEAPON_FIVESEVEN, WEAPON_P90: { // ammo_57mm
get_cd(cd, CD_vUser3, vector);
vector[1] = 0.0;
set_cd(cd, CD_vUser3, vector);
}
case WEAPON_AWP: { // ammo_338mag
get_cd(cd, CD_vUser3, vector);
vector[0] = 0.0;
set_cd(cd, CD_vUser3, vector);
}
case WEAPON_M249: { // ammo_556natobox
set_cd(cd, CD_AmmoRockets, 0);
}
case WEAPON_DEAGLE : { // ammo_50ae
get_cd(cd, CD_vUser2, vector);
vector[2] = 0.0;
set_cd(cd, CD_vUser2, vector);
}
}
}
#include <amxmodx>
#include <fakemeta>
#include <reapi>
new const MAX_CLIP[] = { -1, 13, -1, 10, -1, 7, -1, 30, 30, -1, 30, 20, 25, 30, 35, 25, 12, 20, 10, 30, 100, 8, 30, 30, 20, -1, 7, 30, 30, -1, 50 }
public plugin_init() {
register_forward(FM_UpdateClientData, "UpdateClientData_Post", true);
}
public UpdateClientData_Post(const id, const sendweapons, const cd) {
if (!is_user_connected(id)) {
return;
}
static item;
item = get_member(id, m_pActiveItem);
if (is_nullent(item)) {
return;
}
static WeaponIdType:wid;
wid = WeaponIdType:get_member(item, m_iId);
if (wid <= WEAPON_NONE || wid > WEAPON_P90 || MAX_CLIP[_:wid] == -1) {
return;
}
if (get_member(item, m_Weapon_iClip) <= MAX_CLIP[_:wid]) {
return;
}
static Float:vector[3];
switch (wid) {
case WEAPON_P228: { // ammo_357sig
get_cd(cd, CD_vUser3, vector);
vector[2] = 0.0;
set_cd(cd, CD_vUser3, vector);
}
case WEAPON_SCOUT, WEAPON_G3SG1, WEAPON_AK47: { // ammo_762nato
get_cd(cd, CD_vUser2, vector);
vector[0] = 0.0;
set_cd(cd, CD_vUser2, vector);
}
case WEAPON_XM1014, WEAPON_M3: { // ammo_buckshot
set_cd(cd, CD_AmmoShells, 0);
get_cd(cd, CD_vUser4, vector);
vector[1] = 0.0;
set_cd(cd, CD_vUser4, vector);
}
case WEAPON_MAC10, WEAPON_UMP45, WEAPON_USP: { // ammo_45acp
get_cd(cd, CD_vUser2, vector);
vector[1] = 0.0;
set_cd(cd, CD_vUser2, vector);
}
case WEAPON_AUG, WEAPON_SG550, WEAPON_GALIL, WEAPON_FAMAS, WEAPON_M4A1, WEAPON_SG552: { // ammo_556nato
set_cd(cd, CD_AmmoCells, 0);
}
case WEAPON_ELITE, WEAPON_GLOCK18, WEAPON_MP5N, WEAPON_TMP: { // ammo_9mm
set_cd(cd, CD_AmmoNails, 0);
}
case WEAPON_FIVESEVEN, WEAPON_P90: { // ammo_57mm
get_cd(cd, CD_vUser3, vector);
vector[1] = 0.0;
set_cd(cd, CD_vUser3, vector);
}
case WEAPON_AWP: { // ammo_338mag
get_cd(cd, CD_vUser3, vector);
vector[0] = 0.0;
set_cd(cd, CD_vUser3, vector);
}
case WEAPON_M249: { // ammo_556natobox
set_cd(cd, CD_AmmoRockets, 0);
}
case WEAPON_DEAGLE : { // ammo_50ae
get_cd(cd, CD_vUser2, vector);
vector[2] = 0.0;
set_cd(cd, CD_vUser2, vector);
}
}
}
#include <amxmodx>
#include <hamsandwich>
#include <reapi>
#include <cstrike>
#include <colorchat>
#define WEAPON_CMD "give_m4a1" // Команда по которой будет выдано оружие
#define CMD_PLATINUM "platinum_vip" // команда по которой откроется меню
#define WEAPON_ID WEAPON_M4A1 // ID оружия
#define WEAPON_NAME "weapon_m4a1" // Название оружия
#define ACCESS_FLAG ADMIN_LEVEL_H // Флаг которому доступно оружие. Закоментировать чтобы было доступно всем
#define WEAPON_DAMAGE 2.0 // Множитель урона. Закоментировать если не нужно
#define WEAPON_CLIP 35 // Количество патронов в обойме. Закоментировать если количество по умолчанию
#define WEAPON_AMMO 120 // Количество патронов в запасе
#define WEAPON_SPEED 300.0 // Скорость бега. Закоментировать если количество по умолчанию
#define WEAPON_GRAVITY 0.8 // Гравитация (1.0 == sv_gravity). Закоментировать если количество по умолчанию.
#define MODEL_V "models/m4a1golden/v_m4a1.mdl" // Модель оружия. Закоментировать если не нужно
#define MODEL_P "models/m4a1golden/p_m4a1.mdl" // Модель оружия. Закоментировать если не нужно
#define MODEL_W "models/m4a1golden/w_m4a1.mdl" // Модель оружия. Закоментировать если не нужно
#define WEAPON_CAN_TOUCH_ONLY_OWNER // Поднять сможет только владелец. Закоментировать если не нужно
#define RoundNumMoney 4 // раз в сколько раундов можно брать деньги
#define RoundNumFoot 3 // раз в сколько раундов можно брать бесшумный шаг
#define WeaponRoundNum 4 // раз в скок раундов можно взять бесплатную m4a1
#define WEAPON_CMDK "give_AK47" // Команда по которой будет выдано оружие
#define WEAPON_IDK WEAPON_AK47 // ID оружия
#define WEAPON_NAMEK "weapon_ak47" // Название оружия
#define WEAPON_DAMAGEK 2.0 // Множитель урона. Закоментировать если не нужно
#define WEAPON_CLIPK 35 // Количество патронов в обойме. Закоментировать если количество по умолчанию
#define WEAPON_AMMOK 120 // Количество патронов в запасе
#define WEAPON_SPEEDK 300.0 // Скорость бега. Закоментировать если количество по умолчанию
#define WEAPON_GRAVITYK 0.8 // Гравитация (1.0 == sv_gravity). Закоментировать если количество по умолчанию.
#define KMODEL_V "models/ak47neon/v_ak47.mdl" // Модель оружия. Закоментировать если не нужно
#define KMODEL_P "models/ak47neon/p_ak47.mdl" // Модель оружия. Закоментировать если не нужно
#define KMODEL_W "models/ak47neon/w_ak47.mdl" // Модель оружия. Закоментировать если не нужно
#define WEAPON_CAN_TOUCH_ONLY_OWNERK // Поднять сможет только владелец. Закоментировать если не нужно
new MoneyRound[33], FootRound[33], WeaponRound[33];
#define WEAPON_UID 1
#define IsCustomWeapon(%1) bool:(get_entvar(%1, var_impulse) == WEAPON_UID)
#if defined WEAPON_DAMAGE
new Float:g_PlayerDamage[MAX_PLAYERS + 1];
#endif
#if defined MODEL_V || defined MODEL_P || defined MODEL_W || defined KMODEL_V || defined KMODEL_P || defined KMODEL_W
public plugin_precache() {
#if defined MODEL_V
precache_model(MODEL_V);
#endif
#if defined MODEL_P
precache_model(MODEL_P);
#endif
#if defined MODEL_W
precache_model(MODEL_W);
#endif
#if defined KMODEL_V
precache_model(KMODEL_V);
#endif
#if defined KMODEL_P
precache_model(KMODEL_P);
#endif
#if defined KMODEL_W
precache_model(KMODEL_W);
#endif
}
#endif
#if defined WEAPON_DAMAGEK
new Float:g_PlayerDamageK[MAX_PLAYERS + 1];
#endif
public plugin_init() {
register_clcmd(WEAPON_CMD, "CmdGive");
register_clcmd(WEAPON_CMDK, "CmdGivek");
register_clcmd(CMD_PLATINUM, "Platinummenu");
register_event("TextMsg", "Event_RoundRestart", "a", "2&#Game_C", "2&#Game_w");
register_event("HLTV", "Event_RoundStart", "a", "1=0", "2=0");
#if defined MODEL_V || defined MODEL_P || defined WEAPON_DAMAGE || defined WEAPON_GRAVITY
RegisterHam(Ham_Item_Deploy, WEAPON_NAME, "HookItemDeploy", 1);
#endif
#if defined WEAPON_DAMAGE || defined WEAPON_GRAVITY
RegisterHam(Ham_Item_Holster, WEAPON_NAME, "HookHolster", 1);
#endif
#if defined MODEL_W
RegisterHookChain(RG_CWeaponBox_SetModel, "HookSetModel", 0);
#endif
#if defined WEAPON_DAMAGE
RegisterHookChain(RG_CBasePlayer_TakeDamage, "HookTakeDamage", 0);
#endif
#if defined WEAPON_CLIP
RegisterHam(Ham_Weapon_Reload, WEAPON_NAME, "HookReloaded", 0);
#endif
#if defined WEAPON_SPEED
RegisterHookChain(RG_CBasePlayer_ResetMaxSpeed, "HookResetMaxSpeed", 1);
#endif
#if defined WEAPON_CAN_TOUCH_ONLY_OWNER
RegisterHam(Ham_Touch, "weaponbox", "HookWeaponBoxTouch", 0);
#endif
#if defined KMODEL_V || defined KMODEL_P || defined WEAPON_DAMAGEK || defined WEAPON_GRAVITYK
RegisterHam(Ham_Item_Deploy, WEAPON_NAMEK, "HookItemDeployK", 1);
#endif
#if defined WEAPON_DAMAGEK || defined WEAPON_GRAVITYK
RegisterHam(Ham_Item_Holster, WEAPON_NAMEK, "HookHolsterK", 1);
#endif
#if defined KMODEL_W
RegisterHookChain(RG_CWeaponBox_SetModel, "HookSetModelK", 0);
#endif
#if defined WEAPON_DAMAGEK
RegisterHookChain(RG_CBasePlayer_TakeDamage, "HookTakeDamageK", 0);
#endif
#if defined WEAPON_CLIPK
RegisterHam(Ham_Weapon_Reload, WEAPON_NAMEK, "HookReloadedK", 0);
#endif
#if defined WEAPON_SPEEDK
RegisterHookChain(RG_CBasePlayer_ResetMaxSpeed, "HookResetMaxSpeedK", 1);
#endif
#if defined WEAPON_CAN_TOUCH_ONLY_OWNERK
RegisterHam(Ham_Touch, "weaponbox", "HookWeaponBoxTouchK", 0);
#endif
}
public Event_RoundRestart(){
arrayset(MoneyRound, 0, sizeof(MoneyRound));
}
public Event_RoundStart(){
for(new i = 1; 32 >= i; i++)
{
MoneyRound[i]++;
}
}
public CmdGive(id) {
#if defined ACCESS_FLAG
if (~get_user_flags(id) & ACCESS_FLAG) {
return PLUGIN_HANDLED;
}
#endif
new weapon = rg_give_custom_item(id, WEAPON_NAME, GT_REPLACE, WEAPON_UID);
if (is_nullent(weapon)) {
return PLUGIN_HANDLED;
}
#if defined WEAPON_CLIP
rg_set_iteminfo(weapon, ItemInfo_iMaxClip, WEAPON_CLIP);
rg_set_user_ammo(id, WEAPON_ID, WEAPON_CLIP);
#endif
#if defined WEAPON_AMMO
rg_set_user_bpammo(id, WEAPON_ID, WEAPON_AMMO);
#endif
return PLUGIN_HANDLED;
}
#if defined MODEL_V || defined MODEL_P || defined WEAPON_DAMAGE || defined WEAPON_GRAVITY
public HookItemDeploy(weapon) {
new id = get_member(weapon, m_pPlayer);
if (!is_user_connected(id) || !IsCustomWeapon(weapon)) {
return HAM_IGNORED;
}
#if defined MODEL_V
set_entvar(id, var_viewmodel, MODEL_V);
#endif
#if defined MODEL_V
set_entvar(id, var_weaponmodel, MODEL_P);
#endif
#if defined WEAPON_DAMAGE
g_PlayerDamage[id] = WEAPON_DAMAGE;
#endif
#if defined WEAPON_GRAVITY
set_entvar(id, var_gravity, WEAPON_GRAVITY);
#endif
return HAM_IGNORED;
}
#endif
#if defined WEAPON_DAMAGE || defined WEAPON_GRAVITY
public HookHolster(weapon) {
new id = get_member(weapon, m_pPlayer);
if (!is_user_connected(id)) {
return HAM_IGNORED;
}
#if defined WEAPON_DAMAGE
g_PlayerDamage[id] = 0.0;
#endif
#if defined WEAPON_GRAVITY
set_entvar(id, var_gravity, 1.0);
#endif
return HAM_IGNORED;
}
#endif
#if defined MODEL_W
public HookSetModel(const weaponbox, const model[]) {
new weapon = getWeaponBoxWeapon(weaponbox);
if (weaponbox != NULLENT && IsCustomWeapon(weapon)) {
SetHookChainArg(2, ATYPE_STRING, MODEL_W);
}
return HC_CONTINUE;
}
#endif
#if defined WEAPON_DAMAGE
public HookTakeDamage(const id, inflictor, attacker, Float:damage, type) {
if (
!is_user_connected(id) ||
id == attacker ||
attacker != inflictor ||
(type & (DMG_BULLET | DMG_NEVERGIB)) == 0
) {
return HC_CONTINUE;
}
if (g_PlayerDamage[attacker] > 0.0) {
SetHookChainArg(4, ATYPE_FLOAT, damage * g_PlayerDamage[attacker]);
}
return HC_CONTINUE;
}
#endif
#if defined WEAPON_CLIP
public HookReloaded(weapon) {
new id = get_member(weapon, m_pPlayer);
if (!is_user_connected(id) || !IsCustomWeapon(weapon)) {
return HAM_IGNORED;
}
if (get_member(weapon, m_Weapon_iClip) < WEAPON_CLIP) {
return HAM_IGNORED;
}
#if WEAPON_ID == WEAPON_M4A1
new animation = get_member(weapon, m_Weapon_iWeaponState) & WPNSTATE_M4A1_SILENCED ? 0 : 7;
#elseif WEAPON_ID == WEAPON_USP
new animation = get_member(weapon, m_Weapon_iWeaponState) & WPNSTATE_USP_SILENCED ? 0 : 8;
#else
new animation = 0
#endif
set_entvar(id, var_weaponanim, animation);
message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, .player = id);
write_byte(animation);
write_byte(get_entvar(id, var_body));
message_end();
return HAM_SUPERCEDE;
}
#endif
#if defined WEAPON_SPEED
public HookResetMaxSpeed(const id){
new speed = floatround(Float:get_entvar(id, var_maxspeed));
if (speed == 900 || speed == 1) { // Observer mode or Freeze period
return HC_CONTINUE;
}
new weapon = get_member(id, m_pActiveItem);
if(
weapon == NULLENT ||
WeaponIdType:get_member(weapon, m_iId ) != WEAPON_ID ||
!IsCustomWeapon(weapon)
) {
return HC_CONTINUE;
}
set_entvar(id, var_maxspeed, WEAPON_SPEED);
return HC_CONTINUE;
}
#endif
#if defined WEAPON_CAN_TOUCH_ONLY_OWNER
public HookWeaponBoxTouch(const weaponbox, const id) {
new weapon = getWeaponBoxWeapon(weaponbox);
if(
weapon == NULLENT ||
WeaponIdType:get_member(weapon, m_iId ) != WEAPON_ID ||
!IsCustomWeapon(weapon)
) {
return HAM_IGNORED;
}
return get_entvar(weaponbox, var_owner) == id ? HAM_IGNORED : HAM_SUPERCEDE;
}
#endif
stock getWeaponBoxWeapon(const weaponbox) {
for (new i = 0, weapon; i < MAX_ITEM_TYPES; i++) {
weapon = get_member(weaponbox, m_WeaponBox_rgpPlayerItems, i);
if (!is_nullent(weapon)) {
return weapon;
}
}
return NULLENT;
}
public CmdGivek(id) {
#if defined ACCESS_FLAG
if (~get_user_flags(id) & ACCESS_FLAG) {
return PLUGIN_HANDLED;
}
#endif
new weapon = rg_give_custom_item(id, WEAPON_NAMEK, GT_REPLACE, WEAPON_UID);
if (is_nullent(weapon)) {
return PLUGIN_HANDLED;
}
#if defined WEAPON_CLIPK
rg_set_iteminfo(weapon, ItemInfo_iMaxClip, WEAPON_CLIPK);
rg_set_user_ammo(id, WEAPON_IDK, WEAPON_CLIPK);
#endif
#if defined WEAPON_AMMOK
rg_set_user_bpammo(id, WEAPON_IDK, WEAPON_AMMOK);
#endif
return PLUGIN_HANDLED;
}
#if defined KMODEL_V || defined KMODEL_P || defined WEAPON_DAMAGEK || defined WEAPON_GRAVITYK
public HookItemDeployK(weapon) {
new id = get_member(weapon, m_pPlayer);
if (!is_user_connected(id) || !IsCustomWeapon(weapon)) {
return HAM_IGNORED;
}
#if defined KMODEL_V
set_entvar(id, var_viewmodel, KMODEL_V);
#endif
#if defined KMODEL_V
set_entvar(id, var_weaponmodel, KMODEL_P);
#endif
#if defined WEAPON_DAMAGEK
g_PlayerDamageK[id] = WEAPON_DAMAGEK;
#endif
#if defined WEAPON_GRAVITYK
set_entvar(id, var_gravity, WEAPON_GRAVITYK);
#endif
return HAM_IGNORED;
}
#endif
#if defined WEAPON_DAMAGEK || defined WEAPON_GRAVITYK
public HookHolsterK(weapon) {
new id = get_member(weapon, m_pPlayer);
if (!is_user_connected(id)) {
return HAM_IGNORED;
}
#if defined WEAPON_DAMAGEK
g_PlayerDamageK[id] = 0.0;
#endif
#if defined WEAPON_GRAVITYK
set_entvar(id, var_gravity, 1.0);
#endif
return HAM_IGNORED;
}
#endif
#if defined KMODEL_W
public HookSetModelK(const weaponbox, const model[]) {
new weapon = getWeaponBoxWeaponk(weaponbox);
if (weaponbox != NULLENT && IsCustomWeapon(weapon)) {
SetHookChainArg(2, ATYPE_STRING, KMODEL_W);
}
return HC_CONTINUE;
}
#endif
#if defined WEAPON_DAMAGEK
public HookTakeDamageK(const id, inflictor, attacker, Float:damage, type) {
if (
!is_user_connected(id) ||
id == attacker ||
attacker != inflictor ||
(type & (DMG_BULLET | DMG_NEVERGIB)) == 0
) {
return HC_CONTINUE;
}
if (g_PlayerDamageK[attacker] > 0.0) {
SetHookChainArg(4, ATYPE_FLOAT, damage * g_PlayerDamageK[attacker]);
}
return HC_CONTINUE;
}
#endif
#if defined WEAPON_CLIPK
public HookReloadedK(weapon) {
new id = get_member(weapon, m_pPlayer);
if (!is_user_connected(id) || !IsCustomWeapon(weapon)) {
return HAM_IGNORED;
}
if (get_member(weapon, m_Weapon_iClip) < WEAPON_CLIPK) {
return HAM_IGNORED;
}
#if WEAPON_IDK == WEAPON_M4A1
new animation = get_member(weapon, m_Weapon_iWeaponState) & WPNSTATE_M4A1_SILENCED ? 0 : 7;
#elseif WEAPON_IDK == WEAPON_USP
new animation = get_member(weapon, m_Weapon_iWeaponState) & WPNSTATE_USP_SILENCED ? 0 : 8;
#else
new animation = 0
#endif
set_entvar(id, var_weaponanim, animation);
message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, .player = id);
write_byte(animation);
write_byte(get_entvar(id, var_body));
message_end();
return HAM_SUPERCEDE;
}
#endif
#if defined WEAPON_SPEEDK
public HookResetMaxSpeedK(const id){
new speed = floatround(Float:get_entvar(id, var_maxspeed));
if (speed == 900 || speed == 1) { // Observer mode or Freeze period
return HC_CONTINUE;
}
new weapon = get_member(id, m_pActiveItem);
if(
weapon == NULLENT ||
WeaponIdType:get_member(weapon, m_iId ) != WEAPON_IDK ||
!IsCustomWeapon(weapon)
) {
return HC_CONTINUE;
}
set_entvar(id, var_maxspeed, WEAPON_SPEEDK);
return HC_CONTINUE;
}
#endif
#if defined WEAPON_CAN_TOUCH_ONLY_OWNER
public HookWeaponBoxTouchK(const weaponbox, const id) {
new weapon = getWeaponBoxWeaponk(weaponbox);
if(
weapon == NULLENT ||
WeaponIdType:get_member(weapon, m_iId ) != WEAPON_IDK ||
!IsCustomWeapon(weapon)
) {
return HAM_IGNORED;
}
return get_entvar(weaponbox, var_owner) == id ? HAM_IGNORED : HAM_SUPERCEDE;
}
#endif
stock getWeaponBoxWeaponk(const weaponbox) {
for (new i = 0, weapon; i < MAX_ITEM_TYPES; i++) {
weapon = get_member(weaponbox, m_WeaponBox_rgpPlayerItems, i);
if (!is_nullent(weapon)) {
return weapon;
}
}
return NULLENT;
}
public Platinummenu(id) {
new i_Menu = menu_create("\yPlatinum ViP \wМеню", "menu_handler");
if(get_user_flags(id) & ADMIN_MENU)
{
if(MoneyRound[id] <= RoundNumMoney)
menu_additem(i_Menu, "\dВзять 2000\r$ (раз в 4 раунда)", "1", 0);
else
menu_additem(i_Menu, "\wВзять 2000\r$ \y(\rраз в 4 раунда\y)", "1", 0);
}
else
menu_additem(i_Menu, "\dВзять 2000\r$", "1", 0);
if(get_user_flags(id) & ADMIN_MENU)
{
if(FootRound[id] <= RoundNumFoot)
menu_additem(i_Menu, "\dВзять бесшумные шаги \r(раз в 3 раунда)", "2", 0);
else
menu_additem(i_Menu, "\wВзять бесшумные шаги \y(\w1200\r$\y)", "2", 0);
}
else
{
menu_additem(i_Menu, "\dВзять бесшумные шаги", "2", 0);
}
if(get_user_flags(id) & ADMIN_MENU)
{
if(WeaponRound[id] <= WeaponRoundNum)
menu_additem(i_Menu, "\wВзять бесплатную M4A1 \r(\dраз в 4 раунда\r)", "3", 0);
else
menu_additem(i_Menu, "\wВзять бесплатную \rM4A1", "3", 0);
}
else
{
menu_additem(i_Menu, "\dВзять бесплатную M4A1", "3", 0);
}
if(get_user_flags(id) & ADMIN_MENU)
{
menu_additem(i_Menu, "\wКупить M4A1 Gold (2573\r$\w)", "4", 0);
}
else
{
menu_additem(i_Menu, "\dКупить M4A1 Gold", "4", 0);
}
menu_setprop(i_Menu, MPROP_NEXTNAME, "Далее");
menu_setprop(i_Menu, MPROP_BACKNAME, "Назад");
menu_setprop(i_Menu, MPROP_EXITNAME, "Выход");
menu_display(id, i_Menu, 0);
}
public menu_handler(id, menu, item)
{
if( item < 0 ) return PLUGIN_CONTINUE;
new cmd[3], access, callback, zName[32];
menu_item_getinfo(menu, item, access, cmd,2,_,_, callback);
new Choise = str_to_num(cmd);
switch (Choise)
{
case 1:
{
if(get_user_flags(id) & ADMIN_MENU)
{
if(MoneyRound[id] <= RoundNumMoney)
client_cmd(id ,"platinumvipmoney");
else
{
client_cmd(id ,"platinumvipmoney");
MoneyRound[id] = 0;
}
}
else
client_print_color(id, Red, "Недостаточно прав доступа");
}
case 2:
{
if(get_user_flags(id) & ADMIN_MENU)
{
if(MoneyRound[id] <= RoundNumMoney)
client_cmd(id ,"tixiisagi");
else
{
client_cmd(id ,"tixiisagi");
MoneyRound[id] = 0;
}
}
else
client_print_color(id, Red, "Недостаточно прав доступа");
}
case 3:
{
if(get_user_flags(id) & ADMIN_MENU)
client_cmd(id ,"amx");
else
client_print_color(id, Red, "Недостаточно прав доступа");
}
case 4:
{
if(get_user_flags(id) & ADMIN_MENU)
{
client_cmd(id ,"give_m4a1");
cs_set_user_money(id, cs_get_user_money(id) - 2573);
get_user_name(id, zName, 31);
client_print_color(id, Red, "Игрок %d взял M4A1 Platinum", zName);
}
else
client_print_color(id, Red, "Недостаточно прав доступа");
}
}
return PLUGIN_HANDLED_MAIN;
}
Дописывай то, что уже имеется.Как назначить цену на оружие? #define WEAPON_COST 10000