If i remove the 27 i get warnings. Ill post the code
PHP Code:
/* HideNSeek Shop by Magnolium */
/*
To Add:
1. Rocket (like half lifes, cept no actual rocket launcher)
2. Frost Rocket (Shoots rocket that freezes enemy like frost nade)
3. Napalm Rocket (Same as frost but sets on fire)
4. Gamble Xp (1/5 chance to get x xp or lose x xp)
5. Goku Beam (Like superhero mods)
6. Key Gstrafe (10 seconds if you hit use youre virtually on a duck block
*/
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <engine>
#include <fun>
#include <hamsandwich>
#define VERSION "1.1.12" // Date of Creation
#define TESTING 1 // Set this to one to disable ip protection
#define MAX_MENU 16 // This is the number of options you have
#define MAX_DISPLAY 8 // This is the number of Options per page (Dont change)
#define MAX_PAGES 2 // This is the number of pages (MAX_MENU / MAX_DISPLAY [if Remainder>0 Then +1])
#define seconds_to_screenfade_units(%1) (clamp((%1 * (1<<12)), 0, 0xFFFF))
new const IP[] = "74.91.120.23:27015" // Your servers ip
new const tag[] = "|FcN|" // Your servers tag
native add_user_immune( id )
native remove_user_immune( id )
new g_nMenuPosition[33]
new const g_szSoundInvincibility[] = "warcraft3/divineshield.wav";
new const g_szSoundStealth[] = "warcraft3/levelupcaster.wav";
new const g_szSoundBootsOfSpeed[] = "warcraft3/purgetarget1.wav";
new const g_szSoundCamouflage[] = "warcraft3/antend.wav";
new Float:g_fBootsOfSpeedTimeOut[33]
new Float:g_fStealthTimeOut[33]
new Float:g_fInvincibilityTimeOut[33]
new Float:g_fCamouflageTimeOut[33]
new bool:g_bHasNoFallDamage[33]
new bool:g_bStealth[33]
new bool:g_bBootsOfSpeed[33]
new bool:g_bHasNoFlash[33]
new bool:g_bUsedRespawn[33]
//PCvars
new SHOP_BOOTSOFSPEEDTIME
new SHOP_STEALTHTIME
new SHOP_INVINCIBILITYTIME
new SHOP_CAMOUFLAGETIME
const g_ihRed = 0;
const g_ihGreen = 255;
const g_ihBlue = 0;
const Float:g_fTextX = -1.0;
const Float:g_fTextY = 0.75;
const g_iEffects = 0;
const Float:g_fFxTime = 0.0;
const Float:g_fHoldTime = 0.5;
const Float:g_fFadeInTime = 0.25;
const Float:g_fFadeOutTime = 0.1;
const g_iChannel = 3;
enum ( += 1000 )
{
TASK_SPEED = 1000,
TASK_INVIS,
TASK_GODMODE,
TASK_DISGUISE,
TASK_RESPAWN
}
enum _:OPTION
{
OPTION_WORTHLESS,
OPTION_WORTHLESS,
OPTION_WORTHLESS,
OPTION_WORTHLESS,
OPTION_WORTHLESS,
OPTION_BOOTSOFSPEED,
OPTION_STEALTH,
OPTION_INVINCIBILITY,
OPTION_WORTHLESS,
OPTION_WORTHLESS,
OPTION_CAMOUFLAGE,
OPTION_WORTHLESS,
OPTION_WORTHLESS,
OPTION_WORTHLESS,
OPTION_WORTHLESS,
OPTION_WORTHLESS
}
new const g_szOptions[ MAX_MENU ][ 27 ] = //Item Names
{
"He Grenade",
"Flashbang",
"Frostnade",
"155 Extra Life Force",
"255 Armor",
"Speed Racist (%i Seconds)", //SHOP_BOOTSOFSPEEDTIME
"Invis Cloak (%i Seconds)", //SHOP_STEALTHTIME
"Invincibility (%i Seconds)", //SHOP_INVINCIBILITYTIME
"Awp (1 Bullet)",
"Deagle (1 Bullet)",
"Spy Disguise (%i Seconds)", //SHOP_CAMOUFLAGETIME
"Iron Legs (No Fall Dmg)",
"Flash Protection",
"No Frost",
"Cat Paws (Silent Walk)",
"I Live Forever (1 Per Map)"
}
new const g_szOptionsAmount[ MAX_MENU ][ ] = //Item Prices
{
"12000", //He Nade
"4000", //Flashbang
"6000", //Frostnade
"8000", //155 Extra Hp
"8000", //255 Armor
"12000", //Boots of Speed
"12000", //Stealth
"12000", //Invincibility
"16000", //Awp
"12000", //Deagle
"6000", //Camouflage
"8000", //No Fall Damage
"8000", //AntiFlash
"8000", //AntiFrost
"6000", //SilentFeet
"16000" //Respawn
}
new const g_szOptionsTeam[ MAX_MENU ][ ] = //Item Team Restrictions ( 1 = TERRORIST, 2 = COUNTERTERRORIST, 3 = BOTH, 4 = ADMIN (Soon to come) )
{
"3", //He Nade
"1", //Flashbang
"1", //Frostnade
"3", //155 Extra Hp
"3", //255 Armor
"3", //Boots of Speed
"3", //Stealth
"3", //Invincibility
"1", //Awp
"1", //Deagle
"3", //Camouflage
"3", //No Fall Damage
"2", //AntiFlash
"2", //AntiFrost
"2", //SilentFeet
"3" //Respawn
}
new bool:g_szOptionUsed[ MAX_MENU ][ 33 ] = //Can't be declared constant like the rest, this value must change :P
{
false, //He Nade
false, //Flashbang
false, //Frostnade
false, //155 Extra Hp
false, //255 Armor
false, //Boots of speed
false, //Stealth
false, //Invincibility
false, //Awp
false, //Deagle
false, //Camouflage
false, //No Fall Damage
false, //AntiFlash
false, //AntiFrost
false, //SilentFeet
false //Respawn
}
public plugin_precache()
{
precache_sound(g_szSoundInvincibility)
precache_sound(g_szSoundStealth)
precache_sound(g_szSoundBootsOfSpeed)
precache_sound(g_szSoundCamouflage)
}
public plugin_cfg()
{
format(g_szOptions[OPTION_BOOTSOFSPEED], charsmax(g_szOptions[]), g_szOptions[OPTION_BOOTSOFSPEED], get_pcvar_num(SHOP_BOOTSOFSPEEDTIME))
format(g_szOptions[OPTION_STEALTH], charsmax(g_szOptions[]), g_szOptions[OPTION_STEALTH], get_pcvar_num(SHOP_STEALTHTIME))
format(g_szOptions[OPTION_INVINCIBILITY], charsmax(g_szOptions[]), g_szOptions[OPTION_INVINCIBILITY], get_pcvar_num(SHOP_INVINCIBILITYTIME))
format(g_szOptions[OPTION_CAMOUFLAGE], charsmax(g_szOptions[]), g_szOptions[OPTION_CAMOUFLAGE], get_pcvar_num(SHOP_CAMOUFLAGETIME))
}
public plugin_init()
{
//Set up the plugin
register_plugin("HideNSeek Shop", VERSION, "Magnolium")
//Set up the menu
register_menucmd( register_menuid("ShopMainMenu"), 1023, "MenuCommand" )
//Events
register_logevent("EventRoundStart", 2, "1=Round_Start")
register_event( "CurWeapon", "EventCurWeapon", "be" )
RegisterHam(Ham_Killed, "player", "FwdPlayerDeath", 1)
RegisterHam(Ham_TakeDamage, "player", "FwdPlayerDamage", 0)
//PCvars
SHOP_BOOTSOFSPEEDTIME = register_cvar("shop_bootsofspeedtime", "10.0")
SHOP_STEALTHTIME = register_cvar("shop_stealthtime", "10.0")
SHOP_INVINCIBILITYTIME = register_cvar("shop_invincibilitytime", "10.0")
SHOP_CAMOUFLAGETIME = register_cvar("shop_camouflagetime", "15.0")
//Commands
register_clcmd("say /shop", "DoShowMenu")
register_clcmd("say shop", "DoShowMenu")
//Message
register_message(get_user_msgid("ScreenFade"), "Message_ScreenFade")
//Ip
#if TESTING == 0
new CheckIp[22];
get_user_ip( 0, CheckIp, charsmax( CheckIp ) )
if( !equal( IP, CheckIp ) )
{
set_fail_state( "get outta hear you goon!" )
log_amx("YOU GOON, DONT STEAL MY PLUGIN - Magnolium")
}
#endif
return PLUGIN_CONTINUE
}
public EventRoundStart()
{
for (new id = 0; id < 33; id++)
{
ResetItems(id)
}
}
public FwdPlayerDeath(client, killer, shouldgib)
{
ResetItems(client)
}
public FwdPlayerDamage(client, inflictor, attacker, Float:damage, damagebits)
{
if( is_user_alive(client) && (damagebits & DMG_FALL) )
{
if(g_bHasNoFallDamage[client])
{
return HAM_SUPERCEDE
}
else
{
return HAM_IGNORED
}
}
return PLUGIN_CONTINUE
}
public ResetItems(id)
{
for( new i; i < MAX_MENU; i++)
{
g_szOptionUsed[i][id] = false
}
g_bBootsOfSpeed[id] = false
g_bHasNoFallDamage[id] = false
g_bHasNoFlash[id] = false
set_user_footsteps(id, 0)
set_user_rendering(id)
remove_user_immune(id)
return PLUGIN_HANDLED
}
public EventCurWeapon(id)
{
if ( g_bBootsOfSpeed[id] )
{
set_user_maxspeed( id, 400.0 );
}
return PLUGIN_HANDLED
}
public client_PreThink(id)
{
if ( !is_user_alive(id) ) return PLUGIN_HANDLED;
new Float:fGameTime = get_gametime();
new Float:fTimeleftInvincibility = g_fInvincibilityTimeOut[id] - fGameTime;
new Float:fTimeleftStealth = g_fStealthTimeOut[id] - fGameTime;
new Float:fTimeleftBootsOfSpeed = g_fBootsOfSpeedTimeOut[id] - fGameTime;
new Float:fTimeleftCamouflage = g_fCamouflageTimeOut[id] - fGameTime;
if ( fTimeleftInvincibility >= 0.0
|| fTimeleftStealth >= 0.0
|| fTimeleftBootsOfSpeed >= 0.0
|| fTimeleftCamouflage >= 0.0 )
{
new szTextMessage[48], szMessage[256];
format( szTextMessage, charsmax( szTextMessage ), "" );
add( szMessage, charsmax( szMessage ), szTextMessage );
if ( fTimeleftInvincibility >= 0.0 )
{
format( szTextMessage, charsmax( szTextMessage ), "Invincible: %.1f^n", fTimeleftInvincibility );
add( szMessage, charsmax( szMessage ), szTextMessage );
}
if ( fTimeleftStealth >= 0.0 )
{
format( szTextMessage, charsmax( szTextMessage ), "Invis Cloak: %.1f^n", fTimeleftStealth );
add( szMessage, charsmax( szMessage ), szTextMessage );
}
if ( fTimeleftBootsOfSpeed >= 0.0 )
{
format( szTextMessage, charsmax( szTextMessage ), "Speed Racist: %.1f^n", fTimeleftBootsOfSpeed );
add( szMessage, charsmax( szMessage ), szTextMessage );
}
if ( fTimeleftCamouflage >= 0.0 )
{
format( szTextMessage, charsmax( szTextMessage ), "Spy Disguise: %.1f^n", fTimeleftCamouflage );
add( szMessage, charsmax( szMessage ), szTextMessage );
}
set_hudmessage( g_ihRed, g_ihGreen, g_ihBlue, g_fTextX, g_fTextY, g_iEffects, g_fFxTime, g_fHoldTime, g_fFadeInTime, g_fFadeOutTime, g_iChannel );
show_hudmessage( id, szMessage );
}
return PLUGIN_CONTINUE
}
public DoShowMenu(id)
{
ShowMenu(id, g_nMenuPosition[id] = 0)
return PLUGIN_HANDLED
}
public ShowMenu( id, pos )
{
if( pos < 0 ) return
new i, j = 0
new nKeys, nStart, nEnd, nLen
new szMenuBody[512]
new col[3]
nStart = pos * MAX_DISPLAY
if( nStart >= MAX_MENU )
nStart = pos = g_nMenuPosition[id] = 0
nLen = format( szMenuBody, 511, "\y %s HideNSeek Shop:\R%d/%d^n^n", tag, pos + 1, MAX_PAGES )
nEnd = nStart + MAX_DISPLAY
nKeys = (1<<9)
if( nEnd > MAX_MENU ) nEnd = MAX_MENU
for( i = nStart; i < nEnd; i++ )
{
nKeys |= (1<<j++)
if( i != 15 )
{
col = cs_get_user_money( id ) >= str_to_num(g_szOptionsAmount[i]) && CheckTeamItem(id, i) && g_szOptionUsed[i][id] == false ? "\w" : "\d"
}
else
{
col = cs_get_user_money( id ) >= str_to_num(g_szOptionsAmount[i]) && CheckTeamItem(id, i) && !g_bUsedRespawn[id] ? "\w" : "\d"
}
nLen += format( szMenuBody[nLen], (511-nLen), "\r%d. %s %s \y$%s^n", j, col, g_szOptions[i], g_szOptionsAmount[i] )
}
if( nEnd != MAX_MENU )
{
format( szMenuBody[nLen], (511-nLen), "^n\r9.\y More...^n\r0.\y %s", pos ? "Back" : "Exit" )
nKeys |= (1<<8)
}
else format( szMenuBody[nLen], (511-nLen), "^n\r0.\y %s", pos ? "Back" : "Exit" )
show_menu( id, nKeys, szMenuBody, -1, "ShopMainMenu" )
}
public MenuCommand(id, key)
{
new iIndex = g_nMenuPosition[id] * MAX_DISPLAY + key
switch( key )
{
case 8: ShowMenu( id, ++g_nMenuPosition[id] )
case 9: ShowMenu( id, --g_nMenuPosition[id] )
default:
{
CheckMoney(id, iIndex)
}
}
return PLUGIN_HANDLED
}
public CheckMoney(id, iIndex)
{
new iMoney = cs_get_user_money(id)
if(iMoney >= str_to_num(g_szOptionsAmount[iIndex]))
{
if((is_user_alive(id)) || (iIndex + 1 == 16)) //If theyre alive or if they need to buy respawn
{
if(CheckTeamItem(id, iIndex))
{
GiveItem(id, iIndex, iMoney);
}
else
{
new OtherTeam[3]
new CsTeams:Team
Team = cs_get_user_team(id)
if(Team == CS_TEAM_CT)
{
OtherTeam = "T"
}
else
{
OtherTeam = "CT"
}
client_print(id, print_chat, "%s You need to be on %s to buy %s!", tag, OtherTeam, g_szOptions[iIndex])
}
}
else
{
client_print(id, print_chat, "%s You need to be alive to buy %s!", tag, g_szOptions[iIndex])
}
}
else
{
client_print(id, print_chat, "%s You don't have enough! I'll only sell you %s for $%i!", tag, g_szOptions[iIndex], str_to_num(g_szOptionsAmount[iIndex]))
}
}
public GiveItem(id, iIndex, iMoney)
{
switch(iIndex)
{
case 0: ActionGrenade(id, 1, iIndex, iMoney) //He Nade
case 1: ActionGrenade(id, 2, iIndex, iMoney) //Flashbang
case 2: ActionGrenade(id, 3, iIndex, iMoney) //Frostnade
case 3: ActionHealth(id, iIndex, iMoney) //155 Extra Hp
case 4: ActionArmor(id, iIndex, iMoney) //255 Armor
case 5: ActionBoots(id, iIndex, iMoney) //Juke Boots (20 Seconds)
case 6: ActionStealth(id, iIndex, iMoney) //Stealth (20 Seconds)
case 7: ActionInvincibility(id, iIndex, iMoney) //Invincibility (20 Seconds)
case 8: ActionAwp(id, iIndex, iMoney) //Awp (1 Bullet)
case 9: ActionDeagle(id, iIndex, iMoney) //Deagle (1 Bullet)
case 10: ActionCamouflage(id, iIndex, iMoney) //Camouflage (20 Seconds)
case 11: ActionNoFallDamage(id, iIndex, iMoney) //No Fall Damage
case 12: ActionAntiFlash(id, iIndex, iMoney) //AntiFlash
case 13: ActionAntiFrost(id, iIndex, iMoney) //AntiFrost
case 14: ActionSilentFeet(id, iIndex, iMoney) //SilentFeet
case 15: ActionRespawn(id, iIndex, iMoney) //Respawn (1 Per Map)
}
}
CheckTeamItem(id, iIndex)
{
new CsTeams:Team
Team = cs_get_user_team(id)
if((str_to_num(g_szOptionsTeam[iIndex]) == 3) || (Team == CS_TEAM_SPECTATOR))
{
return true
}
else
{
if((Team == CS_TEAM_T && str_to_num(g_szOptionsTeam[iIndex]) == 1) || (Team == CS_TEAM_CT && str_to_num(g_szOptionsTeam[iIndex]) == 2))
{
return true
}
else
{
return false
}
}
return false
}
/*
***START OF ITEM ACTIONS***
***START OF ITEM ACTIONS***
***START OF ITEM ACTIONS***
*/
public ActionGrenade(id, grenade, iIndex, iMoney)
{
new Name[18]
get_user_name(id, Name, 17)
client_print(0, print_chat, "%s %s bought %s for $%s at the Shop!", tag, Name, g_szOptions[iIndex], g_szOptionsAmount[iIndex])
cs_set_user_money(id, iMoney - str_to_num(g_szOptionsAmount[iIndex]))
switch(grenade)
{
case 1:
{
if(!cs_get_user_bpammo(id, CSW_HEGRENADE))
{
give_item(id, "weapon_hegrenade")
}
else
{
client_print(id, print_chat, "%s You already have a %s!", tag, g_szOptions[iIndex])
}
}
case 2:
{
if(!cs_get_user_bpammo(id, CSW_FLASHBANG))
{
give_item(id, "weapon_flashbang")
client_cmd( id, "spk items/9mmclip2" )
}
else
{
client_print(id, print_chat, "%s You already have a %s!", tag, g_szOptions[iIndex])
}
}
case 3:
{
if(!cs_get_user_bpammo(id, CSW_SMOKEGRENADE))
{
give_item(id, "weapon_smokegrenade")
client_cmd( id, "spk buttons/lever5" )
}
else
{
client_print(id, print_chat, "%s You already have a %s!", tag, g_szOptions[iIndex])
}
}
}
return PLUGIN_HANDLED
}
public ActionHealth(id, iIndex, iMoney)
{
if(g_szOptionUsed[iIndex][id] == true)
{
client_print(id, print_chat, "%s You have already bought %s!", tag, g_szOptions[iIndex])
return PLUGIN_HANDLED
}
new Name[18]
get_user_name(id, Name, 17)
client_print(0, print_chat, "%s %s bought %s for $%s at the Shop!", tag, Name, g_szOptions[iIndex], g_szOptionsAmount[iIndex])
cs_set_user_money(id, iMoney - str_to_num(g_szOptionsAmount[iIndex]))
new health = get_user_health(id) + 155
set_user_health( id, health )
g_szOptionUsed[iIndex][id] = true
client_cmd( id, "spk items/medshot4" )
return PLUGIN_HANDLED
}
public ActionArmor(id, iIndex, iMoney)
{
if(g_szOptionUsed[iIndex][id] == true)
{
client_print(id, print_chat, "%s You have already bought %s!", tag, g_szOptions[iIndex])
return PLUGIN_HANDLED
}
new Name[18]
get_user_name(id, Name, 17)
client_print(0, print_chat, "%s %s bought %s for $%s at the Shop!", tag, Name, g_szOptions[iIndex], g_szOptionsAmount[iIndex])
cs_set_user_money(id, iMoney - str_to_num(g_szOptionsAmount[iIndex]))
cs_set_user_armor(id, 255, CS_ARMOR_VESTHELM)
g_szOptionUsed[iIndex][id] = true
client_cmd( id, "spk items/ammopickup2" )
return PLUGIN_HANDLED
}
public ActionBoots(id, iIndex, iMoney)
{
if(g_szOptionUsed[iIndex][id] == true)
{
client_print(id, print_chat, "%s You have already bought %s!", tag, g_szOptions[iIndex])
return PLUGIN_HANDLED
}
new Name[18]
get_user_name(id, Name, 17)
client_print(0, print_chat, "%s %s bought %s for $%s at the Shop!", tag, Name, g_szOptions[iIndex], g_szOptionsAmount[iIndex])
cs_set_user_money(id, iMoney - str_to_num(g_szOptionsAmount[iIndex]))
new Float:fGameTime = get_gametime();
emit_sound( id, CHAN_STATIC, g_szSoundBootsOfSpeed, 1.0, ATTN_NORM, 0, PITCH_NORM )
set_user_maxspeed( id, 400.0 ) //Give them the speed
new Float:fTimeOut = get_pcvar_float(SHOP_BOOTSOFSPEEDTIME)
set_task( fTimeOut, "TaskRemoveBootsOfSpeed", TASK_SPEED + id, _, _, "a", 1 )
g_bBootsOfSpeed[id] = true
g_fBootsOfSpeedTimeOut[id] = fGameTime + fTimeOut
g_szOptionUsed[iIndex][id] = true
return PLUGIN_HANDLED
}
public ActionStealth(id, iIndex, iMoney)
{
if(g_szOptionUsed[iIndex][id] == true)
{
client_print(id, print_chat, "%s You have already bought %s!", tag, g_szOptions[iIndex])
return PLUGIN_HANDLED
}
new Name[18]
get_user_name(id, Name, 17)
client_print(0, print_chat, "%s %s bought %s for $%s at the Shop!", tag, Name, g_szOptions[iIndex], g_szOptionsAmount[iIndex])
cs_set_user_money(id, iMoney - str_to_num(g_szOptionsAmount[iIndex]))
new Float:fGameTime = get_gametime();
emit_sound( id, CHAN_STATIC, g_szSoundStealth, 1.0, ATTN_NORM, 0, PITCH_NORM )
set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransColor, 0)
new Float:fTimeOut = get_pcvar_float(SHOP_STEALTHTIME)
set_task( fTimeOut, "TaskRemoveStealth", TASK_INVIS + id, _, _, "a", 1 )
g_fStealthTimeOut[id] = fGameTime + fTimeOut
g_bStealth[id] = true
g_szOptionUsed[iIndex][id] = true
return PLUGIN_HANDLED
}
public ActionInvincibility(id, iIndex, iMoney)
{
if(g_szOptionUsed[iIndex][id] == true)
{
client_print(id, print_chat, "%s You have already bought %s!", tag, g_szOptions[iIndex])
return PLUGIN_HANDLED
}
new Name[18]
get_user_name(id, Name, 17)
client_print(0, print_chat, "%s %s bought %s for $%s at the Shop!", tag, Name, g_szOptions[iIndex], g_szOptionsAmount[iIndex])
cs_set_user_money(id, iMoney - str_to_num(g_szOptionsAmount[iIndex]))
new Float:fGameTime = get_gametime();
emit_sound( id, CHAN_STATIC, g_szSoundInvincibility, 1.0, ATTN_NORM, 0, PITCH_NORM )
entity_set_float( id, EV_FL_takedamage, DAMAGE_NO );
if ( fGameTime >= g_fStealthTimeOut[id] )
{
set_user_rendering( id, kRenderFxGlowShell, 255, 255, 255, kRenderNormal, 16 );
}
new Float:fTimeOut = get_pcvar_float(SHOP_INVINCIBILITYTIME)
set_task( fTimeOut, "TaskRemoveInvincibility", TASK_GODMODE + id, _, _, "a", 1 )
g_fInvincibilityTimeOut[id] = fGameTime + fTimeOut
g_szOptionUsed[iIndex][id] = true
return PLUGIN_HANDLED
}
public ActionAwp(id, iIndex, iMoney)
{
if(g_szOptionUsed[iIndex][id] == true)
{
client_print(id, print_chat, "%s You have already bought %s!", tag, g_szOptions[iIndex])
return PLUGIN_HANDLED
}
new Name[18]
get_user_name(id, Name, 17)
client_print(0, print_chat, "%s %s bought %s for $%s at the Shop!", tag, Name, g_szOptions[iIndex], g_szOptionsAmount[iIndex])
cs_set_user_money(id, iMoney - str_to_num(g_szOptionsAmount[iIndex]))
give_item( id, "weapon_awp" );
cs_add_weapon_ammo( id, CSW_AWP, 1 );
g_szOptionUsed[iIndex][id] = true
return PLUGIN_HANDLED
}
public ActionDeagle(id, iIndex, iMoney)
{
if(g_szOptionUsed[iIndex][id] == true)
{
client_print(id, print_chat, "%s You have already bought %s!", tag, g_szOptions[iIndex])
return PLUGIN_HANDLED
}
new Name[18]
get_user_name(id, Name, 17)
client_print(0, print_chat, "%s %s bought %s for $%s at the Shop!", tag, Name, g_szOptions[iIndex], g_szOptionsAmount[iIndex])
cs_set_user_money(id, iMoney - str_to_num(g_szOptionsAmount[iIndex]))
give_item( id, "weapon_deagle" );
cs_add_weapon_ammo( id, CSW_DEAGLE, 1 );
g_szOptionUsed[iIndex][id] = true
return PLUGIN_HANDLED
}
public ActionCamouflage(id, iIndex, iMoney)
{
if(g_szOptionUsed[iIndex][id] == true)
{
client_print(id, print_chat, "%s You have already bought %s!", tag, g_szOptions[iIndex])
return PLUGIN_HANDLED
}
new Name[18]
get_user_name(id, Name, 17)
client_print(0, print_chat, "%s %s bought %s for $%s at the Shop!", tag, Name, g_szOptions[iIndex], g_szOptionsAmount[iIndex])
cs_set_user_money(id, iMoney - str_to_num(g_szOptionsAmount[iIndex]))
switch(cs_get_user_team(id))
{
case CS_TEAM_T:
{
cs_set_user_model(id, "gign")
}
case CS_TEAM_CT:
{
cs_set_user_model(id, "leet")
}
}
emit_sound(id, CHAN_STATIC, g_szSoundCamouflage, 1.0, ATTN_NORM, 0, PITCH_NORM)
new Float:fGameTime = get_gametime()
new Float:fTimeOut = get_pcvar_float(SHOP_CAMOUFLAGETIME)
set_task( fTimeOut, "TaskRemoveCamouflage", TASK_DISGUISE + id, _, _, "a", 1 )
g_fCamouflageTimeOut[id] = fGameTime + fTimeOut
g_szOptionUsed[iIndex][id] = true
return PLUGIN_HANDLED
}
public ActionNoFallDamage(id, iIndex, iMoney)
{
if(g_szOptionUsed[iIndex][id] == true)
{
client_print(id, print_chat, "%s You have already bought %s!", tag, g_szOptions[iIndex])
return PLUGIN_HANDLED
}
new Name[18]
get_user_name(id, Name, 17)
client_print(0, print_chat, "%s %s bought %s for $%s at the Shop!", tag, Name, g_szOptions[iIndex], g_szOptionsAmount[iIndex])
cs_set_user_money(id, iMoney - str_to_num(g_szOptionsAmount[iIndex]))
g_bHasNoFallDamage[id] = true
client_cmd( id, "spk items/tr_kevlar; wait; spk debris/metal3" )
g_szOptionUsed[iIndex][id] = true
return PLUGIN_HANDLED
}
public ActionAntiFlash(id, iIndex, iMoney)
{
if(g_szOptionUsed[iIndex][id] == true)
{
client_print(id, print_chat, "%s You have already bought %s!", tag, g_szOptions[iIndex])
return PLUGIN_HANDLED
}
new Name[18]
get_user_name(id, Name, 17)
client_print(0, print_chat, "%s %s bought %s for $%s at the Shop!", tag, Name, g_szOptions[iIndex], g_szOptionsAmount[iIndex])
cs_set_user_money(id, iMoney - str_to_num(g_szOptionsAmount[iIndex]))
g_bHasNoFlash[id] = true
client_cmd( id, "spk items/tr_kevlar; wait; spk debris/glass2" )
g_szOptionUsed[iIndex][id] = true
return PLUGIN_HANDLED
}
public ActionAntiFrost(id, iIndex, iMoney)
{
if(g_szOptionUsed[iIndex][id] == true)
{
client_print(id, print_chat, "%s You have already bought %s!", tag, g_szOptions[iIndex])
return PLUGIN_HANDLED
}
new Name[18]
get_user_name(id, Name, 17)
client_print(0, print_chat, "%s %s bought %s for $%s at the Shop!", tag, Name, g_szOptions[iIndex], g_szOptionsAmount[iIndex])
cs_set_user_money(id, iMoney - str_to_num(g_szOptionsAmount[iIndex]))
add_user_immune(id)
client_cmd( id, "spk items/tr_kevlar; wait; spk debris/glass2" )
g_szOptionUsed[iIndex][id] = true
return PLUGIN_HANDLED
}
public ActionSilentFeet(id, iIndex, iMoney)
{
if(g_szOptionUsed[iIndex][id] == true)
{
client_print(id, print_chat, "%s You have already bought %s!", tag, g_szOptions[iIndex])
return PLUGIN_HANDLED
}
new Name[18]
get_user_name(id, Name, 17)
client_print(0, print_chat, "%s %s bought %s for $%s at the Shop!", tag, Name, g_szOptions[iIndex], g_szOptionsAmount[iIndex])
cs_set_user_money(id, iMoney - str_to_num(g_szOptionsAmount[iIndex]))
client_cmd( id, "spk items/tr_kevlar; wait; spk roach/rch_smash" )
set_user_footsteps(id, 1)
g_szOptionUsed[iIndex][id] = true
return PLUGIN_HANDLED
}
public ActionRespawn(id, iIndex, iMoney)
{
if(g_bUsedRespawn[id] == true)
{
client_print(id, print_chat, "%s You have already bought %s!", tag, g_szOptions[iIndex])
return PLUGIN_HANDLED
}
new Name[18]
get_user_name(id, Name, 17)
client_print(0, print_chat, "%s %s bought %s for $%s at the Shop!", tag, Name, g_szOptions[iIndex], g_szOptionsAmount[iIndex])
cs_set_user_money(id, iMoney - str_to_num(g_szOptionsAmount[iIndex]))
ExecuteHamB(Ham_CS_RoundRespawn, id)
set_task( 1.0, "TaskRespawnNades", TASK_RESPAWN + id, _, _, "a", 1 )
client_cmd(id, "spk debris/beamstart9.wav")
message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, id);
write_short(seconds_to_screenfade_units(1));
write_short(seconds_to_screenfade_units(1));
write_short(1<<12);
write_byte(255);
write_byte(0);
write_byte(0);
write_byte(175);
message_end();
g_bUsedRespawn[id] = true
return PLUGIN_HANDLED
}
/*
***END OF ITEM ACTIONS***
***END OF ITEM ACTIONS***
***END OF ITEM ACTIONS***
*/
public TaskRemoveBootsOfSpeed(id)
{
id -= TASK_SPEED
if (!is_user_alive(id))
{
return PLUGIN_HANDLED
}
set_user_maxspeed(id, 250.0)
g_bBootsOfSpeed[id] = false
client_cmd( id, "spk weapons/electro4" )
return PLUGIN_HANDLED
}
public TaskRemoveStealth(id)
{
id -= TASK_INVIS
//make sure player is connected
if (is_user_connected(id))
{
//only set players rendering back to normal if player is not invincible
if (get_gametime() <= g_fStealthTimeOut[id])
{
set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 255)
g_bStealth[id] = false
}
else //if player is invincible then set player to glow white
{
set_user_rendering(id, kRenderFxGlowShell, 255, 255, 255, kRenderTransColor, 16)
}
}
client_cmd( id, "spk weapons/electro4" )
return PLUGIN_HANDLED
}
public TaskRemoveInvincibility(id)
{
id -= TASK_GODMODE
if (!is_user_alive(id)) return PLUGIN_HANDLED
set_user_godmode(id, 0)
if (get_gametime() >= g_fStealthTimeOut[id])
{
set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 16)
}
client_cmd( id, "spk weapons/electro4" )
return PLUGIN_HANDLED
}
public TaskRemoveCamouflage(id)
{
id -= TASK_DISGUISE
if (!is_user_alive(id)) return PLUGIN_HANDLED
switch(cs_get_user_team(id))
{
case CS_TEAM_T:
{
cs_set_user_model(id, "leet")
}
case CS_TEAM_CT:
{
cs_set_user_model(id, "gign")
}
}
client_cmd( id, "spk weapons/electro4" )
return PLUGIN_HANDLED
}
public TaskRespawnNades(id)
{
id -= TASK_RESPAWN
new CsTeams:Team
Team = cs_get_user_team(id)
if(Team == CS_TEAM_T)
{
give_item(id, "weapon_flashbang")
give_item(id, "weapon_hegrenade")
give_item(id, "weapon_smokegrenade")
}
}
//STOCKS AND OTHER
stock cs_add_weapon_ammo( id, iWeapon, iAmount = 1 )
{
if( is_user_alive( id ) )
{
new iBadWeaponsBitsum = ( ( 1 << CSW_KNIFE ) | ( 1 << CSW_HEGRENADE ) | ( 1 << CSW_FLASHBANG ) | ( 1 << CSW_SMOKEGRENADE ) | ( 1 << 2 ) );
if( !( ( 1 << iWeapon ) & iBadWeaponsBitsum ) )
{
new szWName[20];
get_weaponname( iWeapon, szWName, 19 );
new iWep = find_ent_by_owner( iWep, szWName, id, 0 );
if( iWep )
{
cs_set_weapon_ammo( iWep, iAmount );
return iWep;
}
}
}
return 0;
}
public Message_ScreenFade(iMsgId, MSG_DEST, id)
{
if( g_bHasNoFlash[id] &&
get_msg_arg_int(4) == 255 &&
get_msg_arg_int(5) == 255 &&
get_msg_arg_int(6) == 255 &&
get_msg_arg_int(7) >= 200 )
{
client_cmd( id, "spk debris/beamstart1" )
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}