|
BANNED
|

10-10-2011
, 10:57
Re: HideNSeek Market
|
#42
|
HNS Market v2 by tv!X^^
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <colorchat>
#include <fakemeta>
#include <engine>
#define VERSION "2.0"
new g_szPluginOn, g_szMenu, g_szMenu2
new scout, deagle, awp, famas, ak47, fiveseven
new aflashbang, health, gravity
new pScout, pDeagle, pAwp, pFamas, pAk47, pFiveseven
new pHegrenade, pFlashbang, pFrostnade, pHealth, pGravity, pStealth, pSpeed, pGodmode
new const PLUGIN[] = "Hide'N'Seek Shop";
new const AUTHOR[] = "tv!X^^ ";
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
// Say & Say Team command's
register_clcmd("say /hnsshop", "show_hnsmenu")
register_clcmd("say /shop", "show_hnsmenu")
register_clcmd("say_team /hnsshop", "show_hnsmenu")
register_clcmd("say_team /shop", "show_hnsmenu:")
// Plugin ON / OFF ...
g_szPluginOn = register_cvar("hns_buy_menu", "1" )
// Weapon price cvar's
pScout = register_cvar( "hns_scout_price", "7500" )
pAwp = register_cvar( "hns_awp_price", "15000")
pAk47 = register_cvar( "hns_ak47_price", "9999" )
pFamas = register_cvar( "hns_famas_price", "4200" )
pFiveseven = register_cvar( "hns_fseven_price", "5000" )
pDeagle = register_cvar( "hns_deagle_price", "8600" )
pHegrenade = register_cvar( "hns_hegrenade_price", "2500" )
pFlashbang = register_cvar( "hns_flashbang_price", "1500" )
pFrostnade = register_cvar( "hns_frostnade_price", "2000" )
pHealth = register_cvar( "hns_health_price", "4500" )
pGravity = register_cvar( "hns_gravity_price", "9500" )
pStealth = register_cvar( "hns_stealth_price", "9900" )
pSpeed = register_cvar( "hns_speed_price", "8500" )
pGodmode = register_cvar( "hns_godmode_price", "15000")
// Weapon ammo cvar's
scout = register_cvar( "hns_scout_ammo", "2" )
awp = register_cvar( "hns_awp_ammo", "1" )
deagle = register_cvar( "hns_deagle_ammo", "2" )
famas = register_cvar( "hns_famas_ammo", "3" )
ak47 = register_cvar( "hns_ak47_ammo", "2" )
fiveseven = register_cvar( "hns_fseven_ammo", "3" )
health = register_cvar( "hns_health_give", "150" )
aflashbang = register_cvar( "hns_flashbang_give", "1" )
gravity = register_cvar( "hns_gravity_give", "350" )
// Menu ...
g_szMenu = register_menuid("Hide'n'Seek Shop");
register_menucmd(g_szMenu, 1023, "hnsshop")
g_szMenu2 = register_menuid( "Weapon Menu" )
register_menucmd(g_szMenu2, 1023, "hnsshop2" )
// Weapon event ...
register_event("CurWeapon", "Event_CurWeapon", "be","1=1")
}
public client_putinserver(id) {
set_task(10.0, "shop_message", id )
set_task(12.0, "shop_author", id )
}
public shop_message(id) {
ColorChat(id, NORMAL, "^x03[ SHOP ]^x01 Server using^x03 Hide'N'Seek Shop^x01 v2. Type^x03 /shop^x01 or^x03 /hnsshop^x01 for menu." )
}
public show_hnsmenu( id ) {
if(get_pcvar_num(g_szPluginOn) == 1) {
new szBuffer[512], iLen;
iLen = formatex(szBuffer, sizeof szBuffer - 1, "\rHide'N'Seek\w Shop\y v2^n^n");
iLen += formatex(szBuffer[iLen], (sizeof szBuffer - 1) - iLen, "\r1. \wHegrenade - (\r %d\w $ )^n", get_pcvar_num(pHegrenade) )
iLen += formatex(szBuffer[iLen], (sizeof szBuffer - 1) - iLen, "\r2. \wFlashbang - (\r %d\w $ )^n", get_pcvar_num(pFlashbang) )
iLen += formatex(szBuffer[iLen], (sizeof szBuffer - 1) - iLen, "\r3. \wFrostnade - (\r %d\w $ )^n", get_pcvar_num(pFrostnade) )
iLen += formatex(szBuffer[iLen], (sizeof szBuffer - 1) - iLen, "\r4. \wHealth - (\r %d\w $ )(\r %d\w HP )^n", get_pcvar_num(pHealth), get_pcvar_num(health) )
iLen += formatex(szBuffer[iLen], (sizeof szBuffer - 1) - iLen, "\r5. \wGravity - (\r %d\w $ )(\r %d\w sec )^n", get_pcvar_num(pGravity), get_pcvar_num(gravity) )
iLen += formatex(szBuffer[iLen], (sizeof szBuffer - 1) - iLen, "\r6. \wStealth - (\r %d\w $ )(\r 7\w sec )^n", get_pcvar_num(pStealth) )
iLen += formatex(szBuffer[iLen], (sizeof szBuffer - 1) - iLen, "\r7. \wSpeed - (\r %d\w $ )(\r 10\w sec)^n", get_pcvar_num(pSpeed) )
iLen += formatex(szBuffer[iLen], (sizeof szBuffer - 1) - iLen, "\r8. \wGodmode - (\r %d\w $ )(\r 5\w sec)^n^n", get_pcvar_num(pGodmode) )
iLen += formatex(szBuffer[iLen], (sizeof szBuffer - 1) - iLen, "\r9. \rWeapon Menu^n^n" )
iLen += formatex(szBuffer[iLen], (sizeof szBuffer - 1) - iLen, "\r0. \yExit");
new iKeys = ( 1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5 | 1<<6 | 1<<7 | 1<< 8 | 1<<9 );
show_menu(id, iKeys, szBuffer, -1, "Hide'n'Seek Shop");
} else
ColorChat(id, BLUE, "^x04[Hide'n'Seek Shop]^x01 Shop has been disabled.");
return PLUGIN_HANDLED;
}
// Shop actions
public hnsshop( id, key ) {
switch( key ) {
case 0:
{
new money = cs_get_user_money(id)
if( money >= get_pcvar_num(pHegrenade) )
{
new setmoney = money - get_pcvar_num(pHegrenade)
cs_set_user_money(id, clamp(setmoney, 0, 16000))
give_item(id, "weapon_hegrenade" )
ColorChat(id, TEAM_COLOR, "^x03[ SHOP ]^x01 You bought a^x03 HE Grenade^x01 for^x03 %d^x01 $", get_pcvar_num(pHegrenade) )
}
else
{
ColorChat(id, TEAM_COLOR, "^x04[ SHOP ]^x01 You have insufficient funds! Money:^x03 %d^x01 $", cs_get_user_money(id))
}
}
case 1:
{
new money = cs_get_user_money(id)
if( money >= get_pcvar_num(pFlashbang) )
{
new setmoney = money - get_pcvar_num(pFlashbang)
cs_set_user_money(id, clamp(setmoney, 0, 16000))
give_item(id, "weapon_flashbang" )
ColorChat(id, TEAM_COLOR, "^x03[ SHOP ]^x01 You bought a^x03 Flashbang^x01 for^x03 %d^x01 $", get_pcvar_num(pFlashbang) )
if( get_pcvar_num( aflashbang ) == 2 )
{
give_item(id, "weapon_flashbang" )
give_item(id, "weapon_flashbang" )
ColorChat(id, TEAM_COLOR, "^x03[ SHOP ]^x01 You bought a^x03 Flashbang^x04( 2 )^x01 for^x03 %d^x01 $", get_pcvar_num(pFlashbang) )
}
}
else
{
ColorChat(id, TEAM_COLOR, "^x04[ SHOP ]^x01 You have insufficient funds! Money:^x03 %d^x01 $", cs_get_user_money(id))
}
}
case 2:
{
new money = cs_get_user_money(id)
if( money >= get_pcvar_num(pFrostnade) )
{
new setmoney = money - get_pcvar_num(pFrostnade)
cs_set_user_money(id, clamp(setmoney, 0, 16000))
give_item(id, "weapon_smokegrenade" )
ColorChat(id, TEAM_COLOR, "^x03[ SHOP ]^x01 You bought a^x03 FrostNade^x01 for^x03 %d^x01 $", get_pcvar_num(pFrostnade) )
}
else
{
ColorChat(id, TEAM_COLOR, "^x04[ SHOP ]^x01 You have insufficient funds! Money:^x03 %d^x01 $", cs_get_user_money(id))
}
}
case 3:
{
new money = cs_get_user_money(id)
if( money >= get_pcvar_num(pHealth) )
{
new setmoney = money - get_pcvar_num(pHealth)
cs_set_user_money(id, clamp(setmoney, 0, 16000))
set_user_health(id, get_pcvar_num(health))
ColorChat(id, TEAM_COLOR, "^x03[ SHOP ]^x01 You bought a^x03 Health Pack^x01 with^x04 %d^x01 HP for^x03 %d^x01 $", get_pcvar_num(health), get_pcvar_num(pHealth) )
}
else
{
ColorChat(id, TEAM_COLOR, "^x04[ SHOP ]^x01 You have insufficient funds! Money:^x03 %d^x01 $", cs_get_user_money(id))
}
}
case 4:
{
new money = cs_get_user_money(id)
if( money >= get_pcvar_num(pGravity) )
{
new setmoney = money - get_pcvar_num(pGravity)
cs_set_user_money(id, clamp(setmoney, 0, 16000))
set_user_gravity(id, get_pcvar_num(gravity) )
ColorChat(id, TEAM_COLOR, "^x03[ SHOP ]^x01 You bought a^x03 Gravity^x04 %d^x03 10^x01 seconds for^x03 %d^x01 $ ", get_pcvar_num(gravity), get_pcvar_num(pGravity) )
set_task(10.0, "remove_gravity", id )
}
else
{
ColorChat(id, TEAM_COLOR, "^x04[ SHOP ]^x01 You have insufficient funds! Money:^x03 %d^x01 $", cs_get_user_money(id))
}
}
case 5:
{
new money = cs_get_user_money(id)
if( money >= get_pcvar_num(pStealth) )
{
new setmoney = money - get_pcvar_num(pStealth)
cs_set_user_money(id, clamp(setmoney, 0, 16000))
set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 15);
ColorChat(id, TEAM_COLOR, "^x03[ SHOP ]^x01 You bought a^x03 Stealth^x01 5^x03 seconds^x01 for^x03 %d^x01 $", get_pcvar_num(pStealth) )
set_task(7.0, "remove_stealth", id )
}
else
{
ColorChat(id, TEAM_COLOR, "^x03[ SHOP ]^x01 You have insufficient funds! Money:^x03 %d^x01 $", cs_get_user_money(id) )
}
}
case 6:
{
new money = cs_get_user_money(id)
if( money >= get_pcvar_num(pSpeed) )
{
new setmoney = money - get_pcvar_num(pSpeed)
cs_set_user_money(id, clamp(setmoney, 0, 16000))
set_user_maxspeed(id, 320.0)
ColorChat(id, TEAM_COLOR, "^x03[ SHOP ]^x01 You bought a^x03 320^x01 Speed 10 seconds, for^x03 %d^x01 $", get_pcvar_num(pSpeed) )
set_task(10.0, "remove_speed" )
}
else
{
ColorChat(id, TEAM_COLOR, "^x04[ SHOP ]^x01 You have insufficient funds! Money:^x03 %d^x01 $", cs_get_user_money(id))
}
}
case 7:
{
new money = cs_get_user_money(id)
if( money >= get_pcvar_num(pGodmode) )
{
new setmoney = money - get_pcvar_num(pGodmode)
cs_set_user_money(id, clamp(setmoney, 0, 16000))
set_user_godmode(id, 1 )
ColorChat(id, TEAM_COLOR, "^x03[ SHOP ]^x01 You bought a^x03 God Mode^x01 5 seconds, for^x03 %d^x01 $", get_pcvar_num(pGodmode) )
set_task(5.0, "remove_godmode" )
}
else
{
ColorChat(id, TEAM_COLOR, "^x04[ SHOP ]^x01 You have insufficient funds! Money:^x03 %d^x01 $", cs_get_user_money(id))
}
}
case 8:
{
show_hnsmenu2(id)
}
}
}
public show_hnsmenu2( id ) {
if(get_pcvar_num(g_szPluginOn) == 1) {
new szBuffer[512], iLen;
iLen += formatex(szBuffer[iLen], (sizeof szBuffer - 1) - iLen, "\r1. \wScout - [\r %d\w $ ] [\r %d\w bullets ]^n", get_pcvar_num(pScout), get_pcvar_num(scout) )
iLen += formatex(szBuffer[iLen], (sizeof szBuffer - 1) - iLen, "\r2. \wDeagle - [\r %d\w $ ] [\r %d\w bullets ]^n", get_pcvar_num(pDeagle), get_pcvar_num(deagle) )
iLen += formatex(szBuffer[iLen], (sizeof szBuffer - 1) - iLen, "\r3. \wFiveSeven - [\r %d\w $ ] [\r %d\w bullets ]^n", get_pcvar_num(pFiveseven), get_pcvar_num(fiveseven) )
iLen += formatex(szBuffer[iLen], (sizeof szBuffer - 1) - iLen, "\r4. \wAk47 - [\r %d\w $ ] [\r %d\w bullets ]^n", get_pcvar_num(pAk47), get_pcvar_num(ak47) )
iLen += formatex(szBuffer[iLen], (sizeof szBuffer - 1) - iLen, "\r5. \wFamas - [\r %d\w $ ] [\r %d\w bullets ]^n", get_pcvar_num(pFamas), get_pcvar_num(famas) )
iLen += formatex(szBuffer[iLen], (sizeof szBuffer - 1) - iLen, "\r6. \wAwp - [\r %d\w $ ] [\r %d\w bullets ]^n^n", get_pcvar_num(pAwp), get_pcvar_num(awp) )
iLen += formatex(szBuffer[iLen], (sizeof szBuffer - 1) - iLen, "\r0. \yExit");
new iKeys = ( 1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5 | 1<<6 | 1<<7 | 1<< 8 | 1<<9 );
show_menu(id, iKeys, szBuffer, -1, "Weapon Menu");
} else
ColorChat(id, BLUE, "^x04[Hide'n'Seek Shop]^x01 Shop has been disabled.");
return PLUGIN_HANDLED;
}
public hnsshop2( id, key ) {
switch( key ) {
case 0:
{
new money = cs_get_user_money(id)
if( money >= get_pcvar_num(pScout) )
{
new setmoney = money - get_pcvar_num(pScout)
cs_set_user_money(id, clamp(setmoney, 0, 16000))
give_item(id, "weapon_scout")
new weapon_id = find_ent_by_owner(-1, "weapon_scout", id)
cs_set_weapon_ammo(weapon_id, get_pcvar_num(scout) )
ColorChat(id, TEAM_COLOR, "^x03[ SHOP ]^x01 You bought a^x03 Scout.^x01 with^x03 %d^x01 bullets for^x03 %d^x01 $", get_pcvar_num(scout), get_pcvar_num(pScout) )
}
else
{
ColorChat(id, TEAM_COLOR, "^x04[ SHOP ]^x01 You have insufficient funds! Money:^x03 %d^x01 $", cs_get_user_money(id))
}
}
case 1:
{
new money = cs_get_user_money(id)
if( money >= get_pcvar_num(pDeagle) )
{
new setmoney = money - get_pcvar_num(pDeagle)
cs_set_user_money(id, clamp(setmoney, 0, 16000))
give_item(id, "weapon_deagle")
new weapon_id = find_ent_by_owner(-1, "weapon_deagle", id)
cs_set_weapon_ammo(weapon_id, get_pcvar_num(deagle) )
ColorChat(id, TEAM_COLOR, "^x03[ SHOP ]^x01 You bought a^x03 Deagle^x01 with^x03 %d^x01 bullets for^x03 %d^x01 $", get_pcvar_num(deagle), get_pcvar_num(pDeagle) )
}
else
{
ColorChat(id, TEAM_COLOR, "^x04[ SHOP ]^x01 You have insufficient funds! Money:^x03 %d^x01 $", cs_get_user_money(id))
}
}
case 2:
{
new money = cs_get_user_money(id)
if( money >= get_pcvar_num(pFiveseven) )
{
new setmoney = money - get_pcvar_num(pFiveseven)
cs_set_user_money(id, clamp(setmoney, 0, 16000))
give_item(id, "weapon_fiveseven")
new weapon_id = find_ent_by_owner(-1, "weapon_fiveseven", id)
cs_set_weapon_ammo(weapon_id, get_pcvar_num(fiveseven) )
ColorChat(id, TEAM_COLOR, "^x03[ SHOP ]^x01 You bought a^x03 Five-Seven^x01 with^x03 %d^x01 bullets for^x03 %d^x01 $", get_pcvar_num(fiveseven), get_pcvar_num(pFiveseven) )
}
else
{
ColorChat(id, TEAM_COLOR, "^x04[ SHOP ]^x01 You have insufficient funds! Money:^x03 %d^x01 $", cs_get_user_money(id))
}
}
case 3:
{
new money = cs_get_user_money(id)
if( money >= get_pcvar_num(pAk47) )
{
new setmoney = money - get_pcvar_num(pAk47)
cs_set_user_money(id, clamp(setmoney, 0, 16000))
give_item(id, "weapon_ak47")
new weapon_id = find_ent_by_owner(-1, "weapon_ak47", id)
cs_set_weapon_ammo(weapon_id, get_pcvar_num(ak47) )
ColorChat(id, TEAM_COLOR, "^x03[ SHOP ]^x01 You bought a^x03 AK-47^x01 with^x03 %d^x01 bullets for^x03 %d^x01 $", get_pcvar_num(ak47), get_pcvar_num(pAk47) )
}
else
{
ColorChat(id, TEAM_COLOR, "^x04[ SHOP ]^x01 You have insufficient funds! Money:^x03 %d^x01 $", cs_get_user_money(id))
}
}
case 4:
{
new money = cs_get_user_money(id)
if( money >= get_pcvar_num(pFamas) )
{
new setmoney = money - get_pcvar_num(pFamas)
cs_set_user_money(id, clamp(setmoney, 0, 16000))
give_item(id, "weapon_famas")
new weapon_id = find_ent_by_owner(-1, "weapon_famas", id)
cs_set_weapon_ammo(weapon_id, get_pcvar_num(famas) )
ColorChat(id, TEAM_COLOR, "^x03[ SHOP ]^x01 You bought a^x03 Famas^x01 with^x03 %d^x01 bullets for^x03 %d^x01 $", get_pcvar_num(famas), get_pcvar_num(pFamas) )
}
else
{
ColorChat(id, TEAM_COLOR, "^x04[ SHOP ]^x01 You have insufficient funds! Money:^x03 %d^x01 $", cs_get_user_money(id))
}
}
case 5:
{
new money = cs_get_user_money(id)
if( money >= get_pcvar_num(pAwp) )
{
new szName[32]
get_user_name(id, szName, 31 )
new setmoney = money - get_pcvar_num(pAwp)
cs_set_user_money(id, clamp(setmoney, 0, 16000))
give_item(id, "weapon_awp")
new weapon_id = find_ent_by_owner(-1, "weapon_awp", id)
cs_set_weapon_ammo(weapon_id, get_pcvar_num(awp) )
ColorChat(id, TEAM_COLOR, "^x03[ SHOP ]^x01 You bought a^x03 AWP^x01 with^x03 %d^x01 bullets for^x03 %d^x01 $", get_pcvar_num(awp), get_pcvar_num(pAwp) )
ColorChat(0, TEAM_COLOR, "^x03[ SHOP ]^x04 %s^x01 purchased^x04 AWP^x01 with (^x04 %d^x01 ) bullets!", szName, get_pcvar_num(awp) )
}
else
{
ColorChat(id, TEAM_COLOR, "^x04[ SHOP ]^x01 You have insufficient funds! Money:^x03 %d^x01 $", cs_get_user_money(id))
}
}
case 6:
{
return PLUGIN_HANDLED
}
}
return PLUGIN_HANDLED
}
public remove_gravity(id) {
set_user_gravity(id, 1.0 )
ColorChat(id, TEAM_COLOR, "^x03[%d]^x01 Your^x03 Gravity^x01 is normal:^x04 800" )
}
public remove_godmode(id) {
set_user_godmode(id, 0 )
ColorChat(id, TEAM_COLOR, "^x03[%d]^x01 Your^x03 God Mode^x01 is^x03 0." )
}
public remove_stealth(id) {
set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 255);
ColorChat(id, TEAM_COLOR, "^x03[%d]^x01 You are^x03 visible !" )
}
public remove_speed(id){
set_user_maxspeed(id, 250.0 )
ColorChat(id, TEAM_COLOR, "^x03[%d]^x01 Your^x03 Speed^x01 is^x03normal." )
}
With godmode, Stealth, Gravity and other...
|
|