Страница 1 от 1
VIP Plugin.
Публикувано на: 11 Фев 2019, 04:42
от addryann
Someone can help me with an plugin , with flag "H" to be for VIP. 1. Deagle & Ak47 + He Grenade &FlashBang + Vest & Helmet . 2 :
Deagle & M4a1+ He Grenade &FlashBang + Vest & Helmet . 3 . Deagle & AWP + VEST & HELM & He Grenade & FlashBang. This menu should appear for flag H , and as well to be on tabscore "V.I.P" instead of "Dead/Bomb" ,and if it's possible,flag "h". 100$ per kill and, 200$ per headshot , to be more special..
VIP Plugin.
Публикувано на: 11 Фев 2019, 15:11
от OciXCrom
Not tested.
Код за потвърждение: Избери целия код
#include <amxmodx>
#include <cstrike>
#include <fun>
#include <hamsandwich>
const VIP_FLAG = ADMIN_CFG
const ARMOR_AMOUNT = 100
const MONEY_PER_KILL = 100
const MONEY_PER_HS = 200
const MONEY_MAX = 16000
new g_iMenu
public plugin_init()
{
register_plugin("VIP Menu & Extras", "1.0", "OciXCrom")
RegisterHam(Ham_Spawn, "player", "OnPlayerSpawn", 1)
register_message(get_user_msgid("ScoreAttrib"), "OnScoreAttrib")
register_event("DeathMsg", "OnPlayerKilled", "a")
CreateMenu()
}
CreateMenu()
{
g_iMenu = menu_create("VIP Menu", "VIPMenu_Handler")
menu_additem(g_iMenu, "AK47 + Deagle + HE + Flash + Vesthelm")
menu_additem(g_iMenu, "M4A1 + Deagle + HE + Flash + Vesthelm")
menu_additem(g_iMenu, "AWP + Deagle + HE + Flash + Vesthelm")
}
public OnScoreAttrib(iMsgId, iDest, iReceiver)
{
if(has_access(get_msg_arg_int(1)))
set_msg_arg_int(2, ARG_BYTE, (1<<2))
}
public OnPlayerSpawn(id)
{
if(!is_user_alive(id) || !has_access(id))
return
menu_display(id, g_iMenu)
}
public VIPMenu_Handler(id, iMenu, iItem)
{
if(iItem == MENU_EXIT || !is_user_alive(id))
{
menu_cancel(id)
return
}
new iC4 = cs_get_user_plant(id)
strip_user_weapons(id)
give_item(id, "weapon_knife")
give_item(id, "weapon_deagle")
give_item(id, "weapon_hegrenade")
give_item(id, "weapon_flashbang")
cs_set_user_bpammo(id, CSW_DEAGLE, 35)
cs_set_user_armor(id, ARMOR_AMOUNT, CS_ARMOR_VESTHELM)
if(iC4)
{
give_item(id, "weapon_c4")
cs_set_user_plant(id)
}
switch(iItem)
{
case 0:
{
give_item(id, "weapon_ak47")
cs_set_user_bpammo(id, CSW_AK47, 90)
}
case 1:
{
give_item(id, "weapon_m4a1")
cs_set_user_bpammo(id, CSW_M4A1, 90)
}
case 2:
{
give_item(id, "weapon_awp")
cs_set_user_bpammo(id, CSW_AWP, 90)
}
}
}
public OnPlayerKilled()
{
new iAttacker = read_data(1), iVictim = read_data(2)
if(!is_user_connected(iAttacker) || iAttacker == iVictim || !has_access(iAttacker))
return
cs_set_user_money(iAttacker, clamp((cs_get_user_money(iAttacker) + (read_data(3) ? MONEY_PER_HS : MONEY_PER_KILL)), .max = MONEY_MAX))
}
bool:has_access(id)
return bool:(get_user_flags(id) & VIP_FLAG)
VIP Plugin.
Публикувано на: 11 Фев 2019, 16:25
от addryann
i don't have that VIP on tabscore..i have to test if i receive the money for kills. 100$ per kill, 200$ per hs
VIP Plugin.
Публикувано на: 11 Фев 2019, 16:49
от OciXCrom
VIP in scoreboard works only for Counter-Terrorists. Don't worry, both things are there.
VIP Plugin.
Публикувано на: 11 Фев 2019, 18:22
от addryann
Could you set up the menu after three rounds of play? Thank you very much.
PS: if i put for someone flag "H" they can't write anymore on "Y" ? why ?
VIP Plugin.
Публикувано на: 11 Фев 2019, 19:50
от OciXCrom
Once every three rounds or every round after the third one?
The writing thing has nothing to do with this plugin.
VIP Plugin.
Публикувано на: 12 Фев 2019, 00:02
от addryann
The 3rd round of the game, for who got vip, to activate the menu.
VIP Plugin.
Публикувано на: 12 Фев 2019, 14:03
от OciXCrom
Код за потвърждение: Избери целия код
#include <amxmodx>
#include <cstrike>
#include <fun>
#include <hamsandwich>
const VIP_FLAG = ADMIN_CFG
const ARMOR_AMOUNT = 100
const MONEY_PER_KILL = 100
const MONEY_PER_HS = 200
const MONEY_MAX = 16000
const ACTIVE_ROUND = 3
new g_iMenu, g_iRound
public plugin_init()
{
register_plugin("VIP Menu & Extras", "1.1", "OciXCrom")
RegisterHam(Ham_Spawn, "player", "OnPlayerSpawn", 1)
register_message(get_user_msgid("ScoreAttrib"), "OnScoreAttrib")
register_event("DeathMsg", "OnPlayerKilled", "a")
register_logevent("OnRoundStart", 2, "0=World triggered", "1=Round_Start")
register_logevent("OnFirstRound", 2, "0=World triggered", "1&Restart_Round_")
register_logevent("OnFirstRound", 2, "0=World triggered", "1=Game_Commencing")
CreateMenu()
}
public OnFirstRound()
g_iRound = 0
public OnRoundStart()
g_iRound++
CreateMenu()
{
g_iMenu = menu_create("VIP Menu", "VIPMenu_Handler")
menu_additem(g_iMenu, "AK47 + Deagle + HE + Flash + Vesthelm")
menu_additem(g_iMenu, "M4A1 + Deagle + HE + Flash + Vesthelm")
menu_additem(g_iMenu, "AWP + Deagle + HE + Flash + Vesthelm")
}
public OnScoreAttrib(iMsgId, iDest, iReceiver)
{
if(has_access(get_msg_arg_int(1)))
set_msg_arg_int(2, ARG_BYTE, (1<<2))
}
public OnPlayerSpawn(id)
{
if(!is_user_alive(id) || !has_access(id) || g_iRound != ACTIVE_ROUND)
return
menu_display(id, g_iMenu)
}
public VIPMenu_Handler(id, iMenu, iItem)
{
if(iItem == MENU_EXIT || !is_user_alive(id) || g_iRound != ACTIVE_ROUND)
{
menu_cancel(id)
return
}
new iC4 = cs_get_user_plant(id)
strip_user_weapons(id)
give_item(id, "weapon_knife")
give_item(id, "weapon_deagle")
give_item(id, "weapon_hegrenade")
give_item(id, "weapon_flashbang")
cs_set_user_bpammo(id, CSW_DEAGLE, 35)
cs_set_user_armor(id, ARMOR_AMOUNT, CS_ARMOR_VESTHELM)
if(iC4)
{
give_item(id, "weapon_c4")
cs_set_user_plant(id)
}
switch(iItem)
{
case 0:
{
give_item(id, "weapon_ak47")
cs_set_user_bpammo(id, CSW_AK47, 90)
}
case 1:
{
give_item(id, "weapon_m4a1")
cs_set_user_bpammo(id, CSW_M4A1, 90)
}
case 2:
{
give_item(id, "weapon_awp")
cs_set_user_bpammo(id, CSW_AWP, 90)
}
}
}
public OnPlayerKilled()
{
new iAttacker = read_data(1), iVictim = read_data(2)
if(!is_user_connected(iAttacker) || iAttacker == iVictim || !has_access(iAttacker))
return
cs_set_user_money(iAttacker, clamp((cs_get_user_money(iAttacker) + (read_data(3) ? MONEY_PER_HS : MONEY_PER_KILL)), .max = MONEY_MAX))
}
bool:has_access(id)
return bool:(get_user_flags(id) & VIP_FLAG)