#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <fun>
#include <cstrike>
#include <hamsandwich>
#include <engine>
#include <nvault>
#include <xs>
/*================================================================================
[Defines & Variables]
=================================================================================*/
#define get_bit(%1,%2) ( %1 & 1 << ( %2 & 31 ) )//if(SO)
#define set_bit(%1,%2) %1 |= ( 1 << ( %2 & 31 ) )//true
#define clear_bit(%1,%2) %1 &= ~( 1 << ( %2 & 31 ) )//false
new g_iMaxPlayers
#define FIRST_PLAYER_ID 1
#define IsPlayer(%1) ( FIRST_PLAYER_ID <= %1 <= g_iMaxPlayers )
#define PLUGIN_NAME "Plugin De Baza JbFreakz"
#define PLUGIN_VERS "1.0"
#define PLUGIN_AUTH "Edit By Fantasy"
#define PLUGIN_CVAR "JailBreakMod"
#define GetPlayerHullSize(%1) ( ( pev ( %1, pev_flags ) & FL_DUCKING ) ? HULL_HEAD : HULL_HUMAN )
// --| The first search distance for finding a free location in the map.
#define START_DISTANCE 32
// --| How many times to search in an area for a free space.
#define MAX_ATTEMPTS 128
// --| Just for readability.
enum Coord_e { Float:x, Float:y, Float:z }
// Tasks ID's
#define TASK_BEAM 4000 // Beam Cylinder Task
#define TASK_HNS 3000
#define TASK_DAYTIMER 2000
#define TASKID 1000
// Offsets (FM)
#define OFFSET_CLIPAMMO 51 // Clip Ammo Offset
#define OFFSET_LINUX 4 // Weapons Linux Offset
#define OFFSET_PRIMWEAPON 116 // Primary Weapon Fix
#if cellbits == 32
#define OFFSET_BUYZONE 235
#else
#define OFFSET_BUYZONE 268
#endif
// Offsets (Ham)
#define m_pPlayer 41 // Ham_Item_Deploy (Weapon Owner)
#define HITGROUP_HEAD 1
// damage of explode, required for fm_radius_damage
#define EXPLODE_DAMAGE 100.0
// radius of damage (required for fm_radius damage )
#define EXPLODE_RADIUS 300.0
#define TEAM_T 1
#define TEAM_CT 2
#define XO_PLAYER 5
#define m_iTeam 114
#define cs_get_user_team_index(%1) get_pdata_int(%1, m_iTeam, XO_PLAYER)
#define cs_set_user_team_index(%1,%2) set_pdata_int(%1, m_iTeam, %2, XO_PLAYER)
#define m_iFlashBattery 244
new const g_szPluginPrefix[] = "Jb.Freakz.Ro" // Plugin g_szPluginPrefix (Tag)
#define m_flWait 44 // Offset for button delay
#define DAY_ACCESS ADMIN_RESERVATION // access to start a day
#define VOTEDAY_ACCESS ADMIN_RESERVATION // access to start a vote day.
#define SPRAY_ACCESS ADMIN_RESERVATION // turn message on/off
//The weight of players votes
#define WEIGHT_PLAYER 1
#define WEIGHT_ADMIN 2
const WEAPONS_PISTOLS = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE);
const WEAPONS_SHOTGUNS = (1<<CSW_XM1014)|(1<<CSW_M3);
const WEAPONS_SUBMACHINEGUNS = (1<<CSW_MAC10)|(1<<CSW_UMP45)|(1<<CSW_MP5NAVY)|(1<<CSW_TMP)|(1<<CSW_P90);
const WEAPONS_RIFLES = (1<<CSW_SCOUT)|(1<<CSW_AUG)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_M4A1)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47);
const WEAPONS_MACHINEGUNS = (1<<CSW_M249);
const VALID_WEAPONS = WEAPONS_PISTOLS|WEAPONS_SHOTGUNS|WEAPONS_SUBMACHINEGUNS|WEAPONS_RIFLES|WEAPONS_MACHINEGUNS;
#define IsWeaponInBits(%1,%2) (((1<<%1) & %2) > 0)
const MAX_PLAYERS = 32
new g_iWeaponBits[MAX_PLAYERS+1]
new g_iWeaponClip[MAX_PLAYERS+1][CSW_P90+1]
new g_iWeaponAmmo[MAX_PLAYERS+1][CSW_P90+1]
new g_TagCount[MAX_PLAYERS+1]
new bool:g_iIsTag[MAX_PLAYERS+1]
static const g_szWeaponNames[CSW_P90+1][] =
{
"","weapon_p228","","weapon_scout",
"weapon_hegrenade","weapon_xm1014",
"","weapon_mac10","weapon_aug",
"weapon_smokegrenade","weapon_elite",
"weapon_fiveseven","weapon_ump45",
"weapon_sg550","weapon_galil",
"weapon_famas","weapon_usp",
"weapon_glock18","weapon_awp",
"weapon_mp5navy","weapon_m249",
"weapon_m3","weapon_m4a1","weapon_tmp",
"weapon_g3sg1","weapon_flashbang","weapon_deagle",
"weapon_sg552","weapon_ak47","","weapon_p90"
};
new iRandom;
static const szWeapons[][] = {
"weapon_p228", "weapon_scout", "weapon_hegrenade",
"weapon_xm1014", "weapon_mac10", "weapon_aug",
"weapon_elite", "weapon_fiveseven", "weapon_ump45",
"weapon_sg550", "weapon_galil", "weapon_famas",
"weapon_usp", "weapon_glock18", "weapon_awp",
"weapon_mp5navy", "weapon_m249", "weapon_m3",
"weapon_m4a1", "weapon_tmp", "weapon_g3sg1",
"weapon_deagle", "weapon_sg552", "weapon_ak47",
"weapon_p90"
}
static const szWeapons2[][] = {
"weapon_p228", "weapon_scout", "weapon_xm1014",
"weapon_mac10", "weapon_aug", "weapon_elite",
"weapon_fiveseven", "weapon_ump45", "weapon_sg550",
"weapon_galil", "weapon_famas", "weapon_usp",
"weapon_glock18", "weapon_awp", "weapon_mp5navy",
"weapon_m249", "weapon_m3", "weapon_m4a1",
"weapon_tmp", "weapon_g3sg1", "weapon_deagle",
"weapon_sg552", "weapon_ak47", "weapon_p90"
}
static const iWeaponId[] = {
CSW_P228, CSW_SCOUT, CSW_HEGRENADE,
CSW_XM1014, CSW_MAC10, CSW_AUG,
CSW_ELITE, CSW_FIVESEVEN, CSW_UMP45,
CSW_SG550, CSW_GALIL, CSW_FAMAS,
CSW_USP, CSW_GLOCK18, CSW_AWP,
CSW_MP5NAVY, CSW_M249, CSW_M3,
CSW_M4A1, CSW_TMP, CSW_G3SG1,
CSW_DEAGLE, CSW_SG552, CSW_AK47,
CSW_P90
}
static const iBpAmmo[] = {
52, 90, 90,
32, 100, 90,
120, 100, 100,
90, 90, 90,
100, 120, 30,
120, 200, 32,
90, 120, 90,
35, 90, 90,
100
}
/*
new g_PlayerReason[33]
new const g_Reasons[][] = {
"asa trebuie",
"ti-ai facut laba",
"te-ai violat singur",
"ai violat un stalp",
"pentru ca automobile",
"pentru ca deaia",
"cred ca e mai bine",
"violator in serie",
"da"
}*/
new g_szWeaponList1[][] =
{
"weapon_galil", "weapon_famas",
"weapon_ak47", "weapon_m4a1"
}
static const iWeaponId2[] = {
CSW_GALIL, CSW_FAMAS,
CSW_AK47, CSW_M4A1
}
// Button Classnames
new g_szButtonClasses[][] =
{
"func_button",
"func_rot_button",
"button_target"
}
new const g_szClassNameCrowbar[] = "crowbar"
enum _:g_iStartDay
{
DAY_NONE, DAY_GRAVITY, DAY_FREEDAY,
DAY_ZOMBIE, DAY_LAVA, DAY_SHARK,
DAY_CAGE, DAY_DEATHMATCH, DAY_NIGHT,
DAY_SPARTAN, DAY_HIDENSEEK, DAY_REZOMBIE,
DAY_RESHARK, DAY_RENIGHT, DAY_FREEZETAG
}
new gVoteMenu
new gVotes[g_iStartDay]
new gVoting
new bool:g_iHasVotedAlready[33]
//new bool:g_iHasClosedMenu[33]
new bool:g_iAreWeInaVote
new g_DayTimer = 0
new g_iAutoStartVote = 0
new const g_iStartDayNames[g_iStartDay][] =
{
"", "Gravity Day", "FreeDay",
"Zombie Day", "Rambo Day", "Shark Day",
"1HP Day", "DeathMatch Day", "Night Crawler Day",
"Spartan Day", "HNS Day", "Reverse Zombie Day",
"GodMode Day", "War Day",
"Freeze Tag Day"
}
new g_iDay[ g_iStartDay ]
// Precache
new const CrowbarModels[][] = { "models/p_crowbar.mdl", "models/v_crowbar.mdl", "models/w_crowbar.mdl" }
new const CrowbarSounds[][] = { "weapons/cbar_hitbod2.wav",
"weapons/cbar_hitbod1.wav", "weapons/bullet_hit1.wav", "weapons/bullet_hit2.wav",
"weapons/knife_slash1.wav", "weapons/cbar_miss1.wav", "weapons/cbar_hit1.wav",
"debris/metal2.wav", "items/gunpickup2.wav"
}
new Float:Vec[3] = {0.0,0.0,-549.0}
new Float:DetectionMaxDistance = 1000.0
new g_bIsLast // It's the last terrorist?
new g_bIsGlowing // Is the user glowing?
new bool:g_bAutoOpened // Did the cells open at 8:00?
new g_bHasFreeday // Do they have a freeday?
new g_bHasCrowbar // Does he own a crowbar?
new g_bHasSpeed // Does he own speed?
new g_bHasInvis // Does he own invisibility?
new g_bHasNadepack // Does he own a nadepack?
new g_bHasArmor // Does he own armor?
new g_bHasDisguise // Does he own a disguise?
new g_bHasFootstep // Does he own no footstep?
new g_bIsChosen // It's the chosen ct for the battle?
new bool:g_bAlreadyOpened // If the cells have been opened before 8:00
new g_bHasMenuOpen // Has a menu open
new g_bInDisguise // Are they in disguise
new bool:g_bInLr // Is the terrorist in an Lr?
new bool:g_bCanBuy // Can they use the shop?
new bool:g_iDayHasStarted
new bool:g_iGrenade
new bool:g_iFrozenTime
new bool:g_iSprayMessages
new g_iFinalCT
new g_iRingSprite // ShockWave Sprite
new g_iCrowbars // number of players with crowbars
new g_iDisguise // number of players with disguise
new g_iSpeed // number of players with speed
new g_iInvis // number of players with invisibility
new g_iFootstep // number of players with no footsteps
new g_iMsgSayText // SayText (ColorPrint)
new g_iMsgTextMsg
new g_iMsgId_ScreenFade
new g_iBlockLastRequest // Block Last Request Command (BugFix)
new g_iGameType // Last Request Game Type
new g_iPoints[33] // Amount of Points a player has
new g_vault // Open a new vault to store a players points.
new g_buttonvault // Open a new vault to store the cell door button.
new iEnt // This is the button
new explosion_sprite // Suicide bomber sprite
new g_iAdminDay = 0
new szMap[33]
new g_bHeadShot[33][33]
new szClass[33]
new szModel[33]
new g_iAuthID[33][36]
new g_ThermalOn[33]
new g_iVictimTeam
new HamHook:g_iHhTakeDamagePost
new g_Timer
new g_FrozenT
new g_10HP = 10
new g_25HP = 25
new g_50HP = 50
new g_100HP = 100
// Cvars
new cvar_crowbarlimit // How many people are allowed to have a crowbar per round
new cvar_disguiselimit // How many people are allowed to have a disguise per round
new cvar_alphavalue // What the alpha should be set to
new cvar_invislimit // How many people are allowed to have stealth per round
new cvar_footsteplimit // How many people are allowed no-footsteps per round
new cvar_speedlimit // How many people are allowed speed per round
new cvar_footstepprice // How many Points no-footsteps costs
new cvar_disguiseprice // How many Points a disguise costs
new cvar_invisprice // How many Points stealth costs
new cvar_speedprice // How many Points speed costs
new cvar_crowbarprice // How many Points a crowbar costs
new cvar_armorprice // How many Points armor costs
new cvar_nadepackprice // How many Points nades cost
new cvar_killpoints // How many Points a terrorist gets for 1 ct kill
new cvar_headshotpoints // How many extra points a t gets for killing a ct
new cvar_shop // Open or close the shop
new cvar_shopspeed
new cvar_admindaywait
new cvar_autostartvote
new g_iTimerEntity
/*================================================================================
[Init]
=================================================================================*/
public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERS, PLUGIN_AUTH)
register_cvar(PLUGIN_CVAR, PLUGIN_VERS, FCVAR_SERVER|FCVAR_SPONLY)
// Variables
g_iMaxPlayers = get_maxplayers()
g_iMsgSayText = get_user_msgid("SayText")
g_iMsgTextMsg = get_user_msgid("TextMsg")
g_iMsgId_ScreenFade = get_user_msgid("ScreenFade")
g_bCanBuy = true
g_bAutoOpened = false
// HAM Forwards
RegisterHam(Ham_Spawn, "player", "Fwd_PlayerSpawn_Post", 1)
RegisterHam(Ham_Killed, "player", "Fwd_PlayerKilled_Pre", 0)
RegisterHam(Ham_TraceAttack, "player", "Fwd_TraceAttack_Player", 1)
RegisterHam(Ham_Touch, "player", "Fwd_PlayerTouch")
RegisterHam(Ham_Touch, "weaponbox", "Fwd_PlayerWeaponTouch")
RegisterHam(Ham_Touch, "armoury_entity", "Fwd_PlayerWeaponTouch")
RegisterHam(Ham_AddPlayerItem, "player", "Player_AddPlayerItem", 0)
RegisterHam(Ham_TakeDamage, "player", "Fwd_PlayerDamage")
g_iHhTakeDamagePost = RegisterHam(Ham_TakeDamage, "player", "Player_TakeDamage_Post", 1)
DisableHamForward( g_iHhTakeDamagePost )
register_forward(FM_EmitSound, "sound_emit")
register_forward(FM_Voice_SetClientListening, "FwdSetVoice")
register_forward(FM_Think, "Forward_Entity_Think")
register_forward(FM_SetModel,"Forward_Model_Think")
register_forward(FM_Touch, "crowbar_touch")
register_forward(FM_AddToFullPack, "forward_AddToFullPack", 1)
register_touch(g_szClassNameCrowbar, "worldspawn", "cr_bar_snd")
new szWeaponName[32]
for(new i=CSW_P228; i<=CSW_P90; i++)
if( get_weaponname(i, szWeaponName, charsmax(szWeaponName)) )
RegisterHam(Ham_Item_Deploy, szWeaponName, "Fwd_ItemDeploy_Pre", 0)
for (new i = 0; i < sizeof(g_szButtonClasses); i++)
RegisterHam(Ham_Use, g_szButtonClasses[i], "Fwd_Use_Pre", 0)
//cvars
cvar_shop = register_cvar("jb_shop", "1") // Enable/disable shop
cvar_killpoints = register_cvar("jb_points_kill", "1") // Points per kill
cvar_headshotpoints = register_cvar("jb_points_headshot", "1") // Additional points per headshot
cvar_crowbarprice = register_cvar("jb_shop_crowbar", "20") // price for crowbar
cvar_armorprice = register_cvar("jb_shop_armor", "10") // price for armor
cvar_disguiseprice = register_cvar("jb_shop_disguise", "50") // price for armor
cvar_nadepackprice = register_cvar("jb_shop_nadepack", "10") // price for nade pack
cvar_speedprice = register_cvar("jb_shop_speed", "10") // price for speed
cvar_invisprice = register_cvar("jb_shop_invisibility", "10") // price for stealth
cvar_footstepprice = register_cvar("jb_shop_footstep", "10") // price for footstep
cvar_crowbarlimit = register_cvar("jb_crowbar_limit", "2") // crowbar limit
cvar_invislimit = register_cvar("jb_invisibility_limit", "5") // stealth limit
cvar_footsteplimit = register_cvar("jb_footstep_limit", "5") // footstep limit
cvar_speedlimit = register_cvar("jb_speed_limit", "5") // speed limit
cvar_disguiselimit = register_cvar("jb_disguise_limit", "1") // disguise limit
cvar_alphavalue = register_cvar("jb_shop_alpha_value","120") // alpha value
cvar_shopspeed = register_cvar("jb_shop_speed_value","500") // speed value
cvar_admindaywait = register_cvar("jb_admin_daywait", "2")
cvar_autostartvote = register_cvar("jb_startvote_wait", "5")
// Events
register_logevent("EventNewRound", 2, "1=Round_Start")
register_event("CurWeapon", "Event_current_weapon", "be", "1=1")
register_event("SendAudio", "Event_SendAudio", "a", "2&%!MRAD_terwin")
register_event("HLTV", "Event_HLTV", "a", "1=0", "2=0")
register_event("NVGToggle", "Event_NVGToggle", "be")
register_event("23", "EventSpray", "a", "1=112")
register_message(get_user_msgid("SendAudio"), "Message_SendAudio")
register_message(get_user_msgid("StatusIcon"), "msgStatusIcon")
register_message(get_user_msgid("FlashBat"), "MsgFlashBat")
register_message(get_user_msgid("Flashlight"), "MsgFlashLight")
// Client Commands
register_clcmd("say /vs", "ClCmd_LastRequest", _, "Last Request Menu")
register_clcmd("say_team /vs", "ClCmd_LastRequest", _, "Last Request Menu")
register_clcmd("say .vs", "ClCmd_LastRequest", _, "Last Request Menu")
register_clcmd("say_team .vs", "ClCmd_LastRequest", _, "Last Request Menu")
register_clcmd("wear_disguise", "ClCmd_CheckDisguise", _, "Wear Disguise")
register_clcmd("glow_blue", "Clcmd_GlowBlue", _, "Glow Blue")
register_clcmd("glow_red", "Clcmd_GlowRed", _, "Glow Red")
register_clcmd("unglow", "Clcmd_UnglowPlayer", _, "Unglow Player")
register_clcmd("say /spray", "CmdSprayMessage")
register_clcmd("say_team /spray", "CmdSprayMessage")
register_clcmd("say /status", "status")
register_clcmd("say_team /status", "status")
register_clcmd("say /gunler", "specialday_check")
register_clcmd("say_team /gunler", "specialday_check")
register_clcmd("say /gunler", "specialday_check")
register_clcmd("say_team /gunler", "specialday_check")
register_clcmd("say /voteday","CheckStartVote")
register_clcmd("say_team /voteday","CheckStartVote")
register_clcmd("say /endday", "specialday_ends")
register_clcmd("say_team /endday", "specialday_ends")
register_clcmd("say /glow","JBGlowMenu")
register_clcmd("say_team /glow","JBGlowMenu")
register_clcmd("say /freeday","JBGlowMenu")
register_clcmd("say_team /freeday","JBGlowMenu")
register_clcmd("say /unglow","JBUnglowMenu")
register_clcmd("say_team /unglow","JBUnglowMenu")
register_clcmd("say /sinif","ClassMenu")
register_clcmd("say_team /sinif","ClassMenu")
register_clcmd("say /dukkan", "ClCmd_shop")
register_clcmd("say_team /dukkan", "ClCmd_shop")
register_clcmd("say /points", "ClCmd_points")
register_clcmd("say_team /points", "ClCmd_points")
register_clcmd("say /points", "ClCmd_points")
register_clcmd("say_team /points", "ClCmd_points")
register_clcmd("drop", "ClCmd_drop", 0, "")
register_concmd("amx_take_points", "cmd_take_points", ADMIN_IMMUNITY, "<target> <amount>")
register_concmd("amx_give_points", "cmd_give_points", ADMIN_IMMUNITY, "<target> <amount>")
register_concmd("amx_reset_points", "cmd_reset_points", ADMIN_IMMUNITY, "<target>")
register_concmd("amx_set_button", "cmd_set_button", ADMIN_IMMUNITY)
g_iTimerEntity = create_entity( "info_target" )
entity_set_string( g_iTimerEntity, EV_SZ_classname, "hud_entity" )
register_think( "hud_entity", "FwdHUDThink" )
entity_set_float( g_iTimerEntity, EV_FL_nextthink, get_gametime() + 1.0 )
g_vault = nvault_open("jbpoints")
}
public MsgFlashLight( const MsgId, const MsgType, const id )
set_msg_arg_int( 2, ARG_BYTE, 100 )
public MsgFlashBat( const MsgId, const MsgType, const id ) {
if( get_msg_arg_int( 1 ) < 100 ) {
set_msg_arg_int( 1, ARG_BYTE, 100 )
set_pdata_int( id, m_iFlashBattery, 100, 5 )
}
}
public Fwd_PlayerWeaponTouch( const iEntity, const id )
{
if(!(1 <= id <= g_iMaxPlayers ))
return HAM_IGNORED
new Model[32];
pev(iEntity, pev_model, Model, 31)
static CsTeams:team
team = cs_get_user_team(id)
switch( g_iDay[ 14 ] )
{
case DAY_ZOMBIE:
switch(team)
{
case CS_TEAM_T:
if (!equal(Model, "models/w_ak47.mdl"))
return HAM_SUPERCEDE
case CS_TEAM_CT:
return HAM_SUPERCEDE
}
case DAY_SHARK:
switch(team)
{
case CS_TEAM_T:
if (!equal(Model, "models/w_awp.mdl"))
return HAM_SUPERCEDE
case CS_TEAM_CT:
return HAM_SUPERCEDE
}
case DAY_NIGHT:
switch(team)
{
case CS_TEAM_T:
if (!equal(Model, "models/w_m4a1.mdl"))
return HAM_SUPERCEDE
case CS_TEAM_CT:
return HAM_SUPERCEDE
}
case DAY_HIDENSEEK:
if(team == CS_TEAM_T)
return HAM_SUPERCEDE
case DAY_REZOMBIE:
switch(team)
{
case CS_TEAM_T:
return HAM_SUPERCEDE
case CS_TEAM_CT:
if (!equal(Model, "models/w_ak47.mdl"))
return HAM_SUPERCEDE
}
case DAY_RESHARK:
switch(team)
{
case CS_TEAM_T:
return HAM_SUPERCEDE
case CS_TEAM_CT:
if (!equal(Model, "models/w_awp.mdl"))
return HAM_SUPERCEDE
}
case DAY_RENIGHT:
switch(team)
{
case CS_TEAM_T:
return HAM_SUPERCEDE
case CS_TEAM_CT:
if (!equal(Model, "models/w_m4a1.mdl"))
return HAM_SUPERCEDE
}
case DAY_FREEZETAG:
return HAM_SUPERCEDE
}
return HAM_IGNORED
}
public Player_AddPlayerItem(id, iEntity)
{
new iWeapID = cs_get_weapon_id( iEntity )
if( !iWeapID )
return HAM_IGNORED
static CsTeams:team
team = cs_get_user_team(id)
switch( g_iDay[ 14 ] )
{
case DAY_ZOMBIE:
switch(team)
{
case CS_TEAM_T:
if(iWeapID != CSW_KNIFE && iWeapID != CSW_AK47)
{
SetHamReturnInteger( 1 )
return HAM_SUPERCEDE
}
case CS_TEAM_CT:
if(iWeapID != CSW_KNIFE)
{
SetHamReturnInteger( 1 )
return HAM_SUPERCEDE
}
}
case DAY_SHARK:
switch(team)
{
case CS_TEAM_T:
if(iWeapID != CSW_KNIFE && iWeapID != CSW_AWP)
{
SetHamReturnInteger( 1 )
return HAM_SUPERCEDE
}
case CS_TEAM_CT:
if(iWeapID != CSW_KNIFE)
{
SetHamReturnInteger( 1 )
return HAM_SUPERCEDE
}
}
case DAY_NIGHT:
switch(team)
{
case CS_TEAM_T:
if(iWeapID != CSW_KNIFE && iWeapID != CSW_M4A1)
{
SetHamReturnInteger( 1 )
return HAM_SUPERCEDE
}
case CS_TEAM_CT:
if(iWeapID != CSW_KNIFE)
{
SetHamReturnInteger( 1 )
return HAM_SUPERCEDE
}
}
case DAY_HIDENSEEK:
if(team == CS_TEAM_T)
if(iWeapID != CSW_KNIFE)
{
SetHamReturnInteger( 1 )
return HAM_SUPERCEDE
}
case DAY_REZOMBIE:
switch(team)
{
case CS_TEAM_T:
if(iWeapID != CSW_KNIFE)
{
SetHamReturnInteger( 1 )
return HAM_SUPERCEDE
}
case CS_TEAM_CT:
if(iWeapID != CSW_KNIFE && iWeapID != CSW_AK47)
{
SetHamReturnInteger( 1 )
return HAM_SUPERCEDE
}
}
case DAY_RESHARK:
switch(team)
{
case CS_TEAM_CT:
if(iWeapID != CSW_KNIFE && iWeapID != CSW_AWP)
{
SetHamReturnInteger( 1 )
return HAM_SUPERCEDE
}
case CS_TEAM_T:
if(iWeapID != CSW_KNIFE)
{
SetHamReturnInteger( 1 )
return HAM_SUPERCEDE
}
}
case DAY_RENIGHT:
switch(team)
{
case CS_TEAM_T:
if(iWeapID != CSW_KNIFE)
{
SetHamReturnInteger( 1 )
return HAM_SUPERCEDE
}
case CS_TEAM_CT:
if(iWeapID != CSW_KNIFE && iWeapID != CSW_M4A1)
{
SetHamReturnInteger( 1 )
return HAM_SUPERCEDE
}
}
case DAY_FREEZETAG:
if(iWeapID != CSW_KNIFE)
{
SetHamReturnInteger( 1 )
return HAM_SUPERCEDE
}
}
return HAM_IGNORED
}
public plugin_precache()
{
g_iRingSprite = precache_model("sprites/shockwave.spr")
static i
for(i = 0; i < sizeof(CrowbarModels); i++)
precache_model(CrowbarModels[i])
for(i = 0; i < sizeof(CrowbarSounds); i++)
precache_sound(CrowbarSounds[i])
precache_model("models/player/urban/urban.mdl")
precache_model("models/player/leet/leet.mdl")
g_buttonvault = nvault_open("cellbuttons")
RegisterHam(Ham_Spawn, "func_button", "ButtonSpawn")
Get_Button()
}
public plugin_cfg()
get_mapname( szMap, 32 )
public client_putinserver(id)
reset_all(id)
public client_authorized( id ) {
if( !is_user_bot( id ) && !is_user_hltv( id ) )
{
get_user_authid(id, g_iAuthID[id], 31)
GetData(id)
}
}
public plugin_end(){
nvault_close(g_vault)
nvault_close(g_buttonvault)
}
public client_disconnect(id){
remove_task(id+TASK_BEAM)
// Save Points
SaveData(id)
if( g_iDay[ 14 ] == DAY_FREEZETAG )
CheckTerrorist( )
}
public status( id )
if( g_iDay[ 14 ] == DAY_FREEZETAG )
fnColorPrint(id, "Vii:^3 %d^1 Inghetati:^3 %d", fnGetTerrorists(), g_FrozenT )
public EventNewRound() {
if(g_iAdminDay >= 1)
g_iAdminDay--
g_iAutoStartVote++
if(g_iAutoStartVote == get_pcvar_num(cvar_autostartvote))
{
set_task(5.0, "CheckVoteDay")
g_iAutoStartVote = 0
}
// Reset LR Blocker
g_iBlockLastRequest = 0
g_iDayHasStarted = false
g_iGrenade = false
remove_entity_name(g_szClassNameCrowbar)
Day_Ends( )
}
public CheckVoteDay()
StartVote(0, 0)
public specialday_check(id){
if(get_user_team(id) != 2 )
{
fnColorPrint(id, "Doar ^x03 Gardienii ^x04 pot incepe o zi ^x03 speciala.")
return PLUGIN_HANDLED
}
// if(!access(id, DAY_ACCESS) )
{
fnColorPrint(id, "Doar ^x03 Adminii ^x04 pot pornii o zi ^x03 speciala.")
return PLUGIN_HANDLED
}
if(!is_user_connected(id))
return PLUGIN_HANDLED
if(!is_user_alive(id))
{
fnColorPrint(id, "Trebuie sa fii ^x03 viu ^x04 pentru a porni o ^x03 zi speciala..")
return PLUGIN_HANDLED
}
if(g_iDay[ 14 ] != DAY_NONE)
{
fnColorPrint(id, "Deja ti-ai ales clasa..")
return PLUGIN_HANDLED
}
if(g_iDayHasStarted == true)
{
fnColorPrint(id, "Nu poti lua alta arma.")
return PLUGIN_HANDLED
}
if(g_iAreWeInaVote == true)
{
fnColorPrint(id, "Nu este nici un vot in curs de desfasurare.")
return PLUGIN_HANDLED
}
new g_iAdminDayChat
if( g_iAdminDay == 1 )
g_iAdminDayChat = true
else
g_iAdminDayChat = false
if( g_iAdminDay >= 1 && !access(id, ADMIN_IMMUNITY) )
{
fnColorPrint(id, "Sorry you have to wait %d day%s before you can pick a admin day.", g_iAdminDay, g_iAdminDayChat ? "" : "s" )
return PLUGIN_HANDLED
}
if(fnGetTerrorists() <= 1)
{
fnColorPrint(id, "Nu poti da un day daca nu sunt mai multi de 2 prizonieri.")
return PLUGIN_HANDLED
}
specialday_menu(id)
return PLUGIN_HANDLED
}
public specialday_ends(id)
{
if(get_user_team(id) != 2){
fnColorPrint(id, "Doar^x03 Gardienii^x04pot incheia^x03 o zi speciala.")
return PLUGIN_HANDLED
}
if(g_iDay[ 14 ] == DAY_NONE){
fnColorPrint(id, "Ziua s-a terminat.")
return PLUGIN_HANDLED
}
static name[32]
get_user_name(id, name, charsmax(name))
fnColorPrint(id, "%s has ended the day.", name)
Day_Ends( )
return PLUGIN_HANDLED
}
stock StripPlayerWeapons(id)
{
strip_user_weapons(id)
give_item(id, "weapon_knife")
set_pdata_int(id, OFFSET_PRIMWEAPON, 0)
}
public Day_Ends( )
{
if( g_iDay[ 14 ] == DAY_NONE )
{
return PLUGIN_HANDLED
}
static CsTeams:team
static iPlayers[32], iNum, i, iPlayer
get_players( iPlayers, iNum, "a" )
for ( i=0; i<iNum; i++ )
{
iPlayer = iPlayers[i]
team = cs_get_user_team(iPlayer)
set_user_health(iPlayer, g_100HP)
set_user_noclip(iPlayer, 0)
set_user_footsteps(iPlayer, 0)
set_user_maxspeed(iPlayer, 250.0)
set_user_rendering(iPlayer)
switch(g_iDay[ 14 ])
{
case DAY_ZOMBIE:
{
if(team == CS_TEAM_CT)
{
if( g_ThermalOn[iPlayer] )
{
engclient_cmd(iPlayer, "nightvision")
cs_set_user_nvg(iPlayer,false)
}
else
{
cs_set_user_nvg(iPlayer,false)
}
}
}
case DAY_REZOMBIE:
{
if(team == CS_TEAM_T)
{
if( g_ThermalOn[iPlayer] )
{
engclient_cmd(iPlayer, "nightvision")
cs_set_user_nvg(iPlayer,false)
}
else
{
cs_set_user_nvg(iPlayer,false)
}
}
}
case DAY_FREEZETAG:
Unfreeze(iPlayer)
case DAY_HIDENSEEK:
Unfreeze(iPlayer)
}
if(is_user_stuck(iPlayer))
ClientCommand_UnStuck(iPlayer)
}
server_cmd("sv_gravity 800")
set_lights("#OFF")
g_iDay[ 14 ] = DAY_NONE
for ( i=0; i<iNum; i++ )
{
iPlayer = iPlayers[i]
team = cs_get_user_team(iPlayer)
switch(team)
{
case CS_TEAM_T:
StripPlayerWeapons(iPlayer)
case CS_TEAM_CT:
RestoreWeapons(iPlayer)
}
}
return PLUGIN_HANDLED
}
public CheckStartVote(id)
{
if( gVoting )
{
fnColorPrint(id, "Deja se voteaza.")
return PLUGIN_HANDLED
}
//if( !access(id, ADMIN_IMMUNITY) )
if( !access(id, VOTEDAY_ACCESS) )
{
fnColorPrint(id, "Nu ai acces la aceasta comanda." )
return PLUGIN_HANDLED
}
if(g_iDay[ 14 ] != DAY_NONE || g_iDayHasStarted == true/* || fnGetTerrorists() <= 1 || fnGetCounterTerrorists() == 0*/ )
{
return PLUGIN_HANDLED
}
StartVote(id, 0)
return PLUGIN_HANDLED
}
public StartVote(id, iPage){
if( g_iDayHasStarted == true )
return PLUGIN_HANDLED
if( !task_exists(TASK_DAYTIMER) )
{
fnColorPrint(0, "Alegeti ziua preferata !!")
g_DayTimer = 30
set_task( 1.0, "EndVote", TASK_DAYTIMER, _, _, "b" )
}
new gMenu[256]
formatex( gMenu, charsmax(gMenu), "\r%s^n\yCe day vrei sa fie azi ?^nMenu Timer: %i", g_szPluginPrefix, g_DayTimer )
gVoteMenu = menu_create( gMenu, "menu_handler" )
new iNumber[5], szOption[40]
for( new i = 1; i < g_iStartDay; i++ )
{
num_to_str(i, iNumber, 4)
formatex(szOption, 39, "%s\y Voturi:\r %i", g_iStartDayNames[i], gVotes[i])
menu_additem(gVoteMenu, szOption, iNumber)
}
menu_display(id, gVoteMenu, iPage)
if( access(id, VOTEDAY_ACCESS) )
gVoting += WEIGHT_ADMIN
else
gVoting += WEIGHT_PLAYER
//g_iHasClosedMenu[id] = false
g_iAreWeInaVote = true
return PLUGIN_HANDLED
}
new iPage
public menu_handler(id, gVoteMenu, item)
{
//If the menu was exited or if there is not a vote
if( item == MENU_EXIT || !gVoting )
{
//g_iHasClosedMenu[id] = true
menu_destroy(gVoteMenu)
return PLUGIN_HANDLED
}
if(g_iHasVotedAlready[id] == true)
{
player_menu_info(id, gVoteMenu, gVoteMenu, iPage)
StartVote(id, iPage)
return PLUGIN_HANDLED
}
new data[6], szName[64]
new access, callback
menu_item_getinfo(gVoteMenu, item, access, data,charsmax(data), szName,charsmax(szName), callback)
new szKey = str_to_num(data)
new Name[32]
get_user_name(id, Name, 31)
if( !g_iHasVotedAlready[id] && is_user_admin(id))
{
gVotes[szKey] += WEIGHT_ADMIN
fnColorPrint(0, "^3%s^1 has chosen %s ^4[^1+2^4 Votes]", Name, g_iStartDayNames[ szKey ])
}
else if( !g_iHasVotedAlready[id] )
{
gVotes[szKey] += WEIGHT_PLAYER
fnColorPrint(0, "^3%s^1 has chosen %s ^4[^1+1^4 Votes]", Name, g_iStartDayNames[ szKey ])
}
g_iHasVotedAlready[id] = true
player_menu_info(id, gVoteMenu, gVoteMenu, iPage)
StartVote(id, iPage)
return PLUGIN_HANDLED
}
public EndVote()
{
g_DayTimer--
if( g_DayTimer >= 0 )
{
static iPlayers[32], iNum, iPlayer, i
get_players( iPlayers, iNum )
for( i = 0; i < iNum; i++ )
{
iPlayer = iPlayers[i]
player_menu_info(iPlayer, gVoteMenu, gVoteMenu, iPage)
//if( !g_iHasClosedMenu[iPlayer] )
StartVote(iPlayer, iPage)
}
}
if( g_DayTimer <= 5 )
{
new sSound[16];
num_to_word(g_DayTimer, sSound, 15);
client_cmd(0, "spk vox/%s.wav", sSound);
}
if( g_DayTimer <= 0 ) // if for some reason it glitches and gets below zero
{
remove_task(TASK_DAYTIMER)
new bigger = 0;
for( new i=1; i<g_iStartDay; i++ )
{
if( gVotes[i] > gVotes[bigger] )
{
bigger = i;
}
}
if( bigger == 0 )
{
bigger = random_num(1,13)
fnColorPrint(0, "Due to no one voting the day will be randomly seleted.");
}
EXEC_DayAction( 0, bigger)
gVoting = 0;
g_DayTimer = 0;
for( new i=1; i<g_iStartDay; i++ )
{
gVotes[i] = 0;
}
}
}
EXEC_DayAction( id, iValue )
{
switch( iValue )
{
case 1: g_iDay[ 14 ] = DAY_GRAVITY
case 2: g_iDay[ 14 ] = DAY_FREEDAY
case 3: g_iDay[ 14 ] = DAY_ZOMBIE
case 4: g_iDay[ 14 ] = DAY_LAVA
case 5: g_iDay[ 14 ] = DAY_SHARK
case 6: g_iDay[ 14 ] = DAY_CAGE
case 7: g_iDay[ 14 ] = DAY_DEATHMATCH
case 8: g_iDay[ 14 ] = DAY_NIGHT
case 9: g_iDay[ 14 ] = DAY_SPARTAN
case 10: g_iDay[ 14 ] = DAY_HIDENSEEK
case 11: g_iDay[ 14 ] = DAY_REZOMBIE
case 12: g_iDay[ 14 ] = DAY_RESHARK
case 13: g_iDay[ 14 ] = DAY_RENIGHT
case 14: g_iDay[ 14 ] = DAY_FREEZETAG
}
static iPlayers[32], iNum, i, iPlayer
get_players(iPlayers, iNum)
new newmenu;
for( i = 0; i < iNum; i++ )
{
iPlayer = iPlayers[i]
g_iHasVotedAlready[iPlayer] = false
if( player_menu_info(iPlayer, gVoteMenu, newmenu) )
{
menu_cancel(iPlayer);
client_cmd(iPlayer, "slot1" );
}
//g_iHasClosedMenu[iPlayer] = false
}
iPage = 0
do_specialday(id)
g_iAreWeInaVote = false
}
public specialday_menu(id)
{
new specialdaymenu = menu_create("\yZile Speciale :", "specialday_submenu")
new iNumber[5], szOption[40]
for( new i = 1; i < g_iStartDay; i++ )
{
num_to_str(i, iNumber, 4);
formatex(szOption, 39, "%s ", g_iStartDayNames[i]);
menu_additem(specialdaymenu, szOption, iNumber);
}
menu_setprop(specialdaymenu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, specialdaymenu, 0);
}
public specialday_submenu(id, specialdaymenu, item)
{
if (item == MENU_EXIT)
{
menu_destroy(specialdaymenu);
return PLUGIN_HANDLED;
}
if(!is_user_connected(id))
return PLUGIN_HANDLED
if(!is_user_alive(id) )
{
menu_destroy(specialdaymenu);
fnColorPrint(id, "Nu poti porni un day daca esti mort.")
return PLUGIN_HANDLED
}
new Data[7], Name[64];
new Access, Callback;
menu_item_getinfo(specialdaymenu, item, Access, Data,5, Name, 63, Callback);
new Key = str_to_num(Data);
for( new i = 1; i < g_iStartDay; i++ )
{
g_iDay[ i ] = Key
}
g_iAdminDay = get_pcvar_num(cvar_admindaywait) + 1;
do_specialday(id)
menu_destroy(specialdaymenu);
return PLUGIN_HANDLED
}
public do_specialday(id)
{
static CsTeams:team
if(g_iDayHasStarted == true)
{
return PLUGIN_HANDLED
}
if(g_iDay[ 14 ] == DAY_DEATHMATCH)
{
iRandom = random( sizeof(szWeapons) )
}
remove_task( TASKID )
new g_AliveCT = fnGetCounterTerrorists()
new g_AliveT = fnGetTerrorists()
static iPlayers[32], iNum, i, iPlayer
get_players( iPlayers, iNum, "a" )
for ( i=0; i<iNum; i++ )
{
iPlayer = iPlayers[i]
team = cs_get_user_team(iPlayer)
if(team == CS_TEAM_T)
{
if(get_bit(g_bHasNadepack, iPlayer)) {
ham_strip_weapon(iPlayer, "weapon_flashbang")
ham_strip_weapon(iPlayer, "weapon_hegrenade")
ham_strip_weapon(iPlayer, "weapon_smokegrenade")
g_iPoints[iPlayer] += get_pcvar_num(cvar_nadepackprice)
fnColorPrint(iPlayer, "Your nade pack has been removed, and your points have been refunded.")
clear_bit(g_bHasNadepack, iPlayer)
}
}
switch(g_iDay[ 14 ])
{
//case DAY_GRAVITY:
case DAY_FREEDAY:
{
if(team == CS_TEAM_T)
{
set_user_rendering(iPlayer, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 16);
}
//jail_open()
}
case DAY_ZOMBIE:
{
switch(team)
{
case CS_TEAM_T:
{
//set_user_health(Players[ i ], g_AliveCT * g_10HP + g_100HP)
//set_user_health(Players[ i ], 150)
give_item(iPlayer, "weapon_ak47")
cs_set_user_bpammo(iPlayer, CSW_AK47, 600)
}
case CS_TEAM_CT:
{
SaveWeapons(iPlayer)
cs_set_user_nvg(iPlayer,true)
engclient_cmd(iPlayer, "nightvision")
//set_user_rendering(Players[ i ], kRenderFxGlowShell, 0, 255, 0, kRenderNormal, 16);
set_user_health(iPlayer, g_AliveT * g_100HP + g_100HP)
//fnSetRatioHealth(Players[ i ])
set_user_maxspeed(iPlayer, 400.0)
}
}
//fog(true)
set_lights("a")
}
//case DAY_LAVA:
case DAY_SHARK:
{
switch(team)
{
case CS_TEAM_T:
{
//set_user_health(Players[ i ], g_AliveCT * g_10HP + g_100HP)
give_item(iPlayer, "weapon_awp")
cs_set_user_bpammo(iPlayer, CSW_AWP, 30)
}
case CS_TEAM_CT:
{
SaveWeapons(iPlayer)
set_user_noclip(iPlayer, 1)
set_user_health(iPlayer, g_AliveT * g_25HP + g_100HP)
}
}
}
//case DAY_CAGE:
case DAY_DEATHMATCH:
{
SaveWeapons(iPlayer)
give_item(iPlayer, szWeapons[iRandom])
cs_set_user_bpammo(iPlayer, iWeaponId[iRandom], iBpAmmo[iRandom])
}
case DAY_NIGHT:
{
switch(team)
{
case CS_TEAM_T:
{
give_item(iPlayer, "weapon_m4a1")
give_item(iPlayer, "weapon_deagle")
cs_set_user_bpammo(iPlayer, CSW_M4A1, 90)
cs_set_user_bpammo(iPlayer, CSW_DEAGLE, 35)
}
case CS_TEAM_CT:
{
SaveWeapons(iPlayer)
//strip_weapons(i)
//set_user_rendering(Players[ i ], kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 0)
set_user_footsteps(iPlayer, 1);
set_user_maxspeed(iPlayer, 400.0);
}
}
}
case DAY_SPARTAN:
{
switch(team)
{
case CS_TEAM_T:
{
give_item(iPlayer, "weapon_shield")
}
case CS_TEAM_CT:
{
SaveWeapons(iPlayer)
give_item(iPlayer, "weapon_m4a1")
cs_set_user_bpammo(iPlayer, CSW_M4A1, 150)
}
}
}
//case DAY_HIDENSEEK:
case DAY_REZOMBIE:
{
switch(team)
{
case CS_TEAM_CT:
{
SaveWeapons(iPlayer)
//set_user_health(Players[ i ], g_AliveT * g_10HP + g_100HP )
//fnSetRatioHealth(Players[ i ])
give_item(iPlayer, "weapon_ak47")
cs_set_user_bpammo(iPlayer, CSW_AK47, 600)
}
case CS_TEAM_T:
{
cs_set_user_nvg(iPlayer,true)
engclient_cmd(iPlayer, "nightvision")
set_user_health(iPlayer, g_AliveCT * g_100HP + g_100HP )
set_user_maxspeed(iPlayer, 325.0)
}
}
set_lights("a")
}
case DAY_RESHARK:
{
switch(team)
{
case CS_TEAM_CT:
{
SaveWeapons(iPlayer)
set_user_health(iPlayer, g_AliveT * g_10HP + g_100HP)
give_item(iPlayer, "weapon_awp")
cs_set_user_bpammo(iPlayer, CSW_AWP, 30)
set_user_godmode(id, true)
}
case CS_TEAM_T:
{
set_user_health(iPlayer, g_AliveCT * g_10HP + g_50HP )
}
}
}
case DAY_RENIGHT:
{
switch(team)
{
case CS_TEAM_CT:
{
SaveWeapons(iPlayer)
give_item(iPlayer, "weapon_m4a1")
give_item(iPlayer, "weapon_deagle")
set_user_health(iPlayer, g_AliveT * g_10HP + g_100HP )
cs_set_user_bpammo(iPlayer, CSW_M4A1, 90)
cs_set_user_bpammo(iPlayer, CSW_DEAGLE, 35)
}
case CS_TEAM_T:
{
set_user_footsteps(iPlayer, 1);
set_user_maxspeed(iPlayer, 325.0);
cs_set_user_bpammo(iPlayer, CSW_M4A1, 90)
}
}
}
case DAY_FREEZETAG:
{
SaveWeapons(iPlayer)
if(get_bit(g_bHasSpeed, iPlayer)) {
fnColorPrint(iPlayer, "You may not have speed during a Freezetag day!")
fnColorPrint(iPlayer, "Your speed has been removed and your points have been refunded.")
g_iPoints[iPlayer] += get_pcvar_num(cvar_speedprice)
clear_bit(g_bHasSpeed, iPlayer)
}
}
}
}
switch(g_iDay[ 14 ])
{
case DAY_GRAVITY:
server_cmd("sv_gravity 200")
case DAY_LAVA:
server_cmd("decalfrequency 5")
case DAY_HIDENSEEK:
{
g_Timer = 120
g_iFrozenTime = true
set_task( 1.0, "countdown", TASK_HNS )
}
case DAY_FREEZETAG:
{
server_cmd("sv_gravity 400")
g_FrozenT = 0
}
}
g_iDayHasStarted = true
if(!g_iAreWeInaVote)
{
new szName[ 32 ]
get_user_name(id, szName, 31)
fnColorPrint(0, "%s A pornit Ziua Speciala: a^x03 %s.", szName, g_iStartDayNames[ g_iDay[ 14 ] ] )
}else{
fnColorPrint(0, "Astazi este a^x03 %s.", g_iStartDayNames[ g_iDay[ 14 ] ] )
}
return PLUGIN_HANDLED
}
public countdown()
{
static iPlayers[32], iNum, i, iPlayer
get_players( iPlayers, iNum, "ae", "CT" )
set_hudmessage(255, 255, 255, -1.0, -1.0, 0, 0.75, 0.75, 0.75, 0.75, 1)
if( g_Timer > 60 )
show_hudmessage(0, "Gardienii au %i secunde pentru a deschide celulele prizonierilor pentru a incepe HNS Day !", g_Timer-60)
if( g_Timer == 60 )
for ( i=0; i<iNum; i++ )
{
iPlayer = iPlayers[i]
set_pev(iPlayer, pev_flags, pev(iPlayer, pev_flags) | FL_FROZEN)
}
if( g_Timer <= 60 && g_Timer > 0 )
{
show_hudmessage(0, "Priszonierii au %i secunde pentru a se ascunde !", g_Timer)
if( g_Timer <= 10 )
{
new sSound[16];
num_to_word(g_Timer, sSound, 15);
client_cmd(0, "spk vox/%s.wav", sSound);
}
for ( i=0; i<iNum; i++ )
{
iPlayer = iPlayers[i]
UTIL_ScreenFade(iPlayer, 1.0, 1.0)
}
}
g_Timer--;
set_task( 1.0, "countdown", TASK_HNS )
if( g_iDay[ 14 ] == DAY_NONE )
g_Timer = 0
if( g_Timer <= 0 )
{
for ( i=0; i<iNum; i++ )
{
iPlayer = iPlayers[i]
RestoreWeapons(iPlayer)
Unfreeze(iPlayer)
}
g_iFrozenTime = false
show_hudmessage(0, "Go go go")
client_cmd(0, "spk ^"sound/radio/com_go.wav^"")
remove_task( TASK_HNS )
}
}
#define CLAMP_SHORT(%1) clamp( %1, 0, 0xFFFF )
#define CLAMP_BYTE(%1) clamp( %1, 0, 0xFF )
UTIL_ScreenFade( client, Float:fDuration, Float:fHoldTime ) {
message_begin( MSG_ONE, g_iMsgId_ScreenFade, _, client );
write_short( CLAMP_SHORT( floatround( 4096 * fDuration ) ) ); // 1 << 12 = 4096
write_short( CLAMP_SHORT( floatround( 4096 * fHoldTime ) ) );
write_short( 0x0000 ); // FFADE_IN = 0x0000
write_byte( 0 );
write_byte( 0 );
write_byte( 0 );
write_byte( 200 );
message_end( );
}
/*================================================================================
[Forwards / Events]
=================================================================================*/
public Fwd_PlayerSpawn_Post(id)
{
static CsTeams:team
if (!is_user_alive(id))
return HAM_IGNORED
team = cs_get_user_team(id)
switch( g_iDay[ 14 ] )
{
case DAY_NONE:
{
StripPlayerWeapons(id)
reset_all(id)
if(team == CS_TEAM_CT)
set_task(0.4, "ClassMenu", id)
}
case DAY_FREEDAY:
if(team == CS_TEAM_T)
set_user_rendering(id, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 16);
case DAY_ZOMBIE:
{
//new g_AliveCT = fnGetCounterTerrorists()
new g_AliveT = fnGetTerrorists()
switch(team)
{
case CS_TEAM_T:
{
//set_user_health(id, g_AliveCT * g_10HP + g_100HP)
give_item(id, "weapon_ak47")
cs_set_user_bpammo(id, CSW_AK47, 600)
}
case CS_TEAM_CT:
{
cs_set_user_nvg(id,true)
engclient_cmd(id, "nightvision")
set_user_health(id, g_AliveT * g_100HP + g_100HP)
set_user_maxspeed(id, 400.0);
}
}
}
case DAY_SHARK:
{
//new g_AliveCT = fnGetCounterTerrorists()
new g_AliveT = fnGetTerrorists()
switch(team)
{
case CS_TEAM_T:
{
//set_user_health(id, g_AliveCT * g_10HP + g_100HP)
give_item(id, "weapon_awp")
cs_set_user_bpammo(id, CSW_AWP, 30)
}
case CS_TEAM_CT:
{
set_user_noclip(id, 1)
set_user_health(id, g_AliveT * g_25HP + g_100HP)
}
}
}
//case DAY_CAGE:
case DAY_DEATHMATCH:
{
if(team == CS_TEAM_T)
{
give_item(id, szWeapons[iRandom])
cs_set_user_bpammo(id, iWeaponId[iRandom], iBpAmmo[iRandom])
}
}
case DAY_NIGHT:
{
switch(team)
{
case CS_TEAM_T:
{
give_item(id, "weapon_m4a1")
give_item(id, "weapon_deagle")
cs_set_user_bpammo(id, CSW_M4A1, 90)
cs_set_user_bpammo(id, CSW_DEAGLE, 35)
}
case CS_TEAM_CT:
{
SaveWeapons(id)
set_user_footsteps(id, 1);
set_user_maxspeed(id, 400.0);
}
}
}
case DAY_SPARTAN:
{
switch(team)
{
case CS_TEAM_T:
give_item(id, "weapon_shield")
case CS_TEAM_CT:
{
give_item(id, "weapon_m4a1")
cs_set_user_bpammo(id, CSW_M4A1, 150)
}
}
}
case DAY_HIDENSEEK:
if(team == CS_TEAM_CT)
if(g_iFrozenTime == true)
set_pev(id, pev_flags, pev(id, pev_flags) | FL_FROZEN)
case DAY_REZOMBIE:
{
new g_AliveCT = fnGetCounterTerrorists()
new g_AliveT = fnGetTerrorists()
switch(team)
{
case CS_TEAM_CT:
{
set_user_health(id, g_AliveT * g_10HP + g_100HP )
give_item(id, "weapon_ak47")
cs_set_user_bpammo(id, CSW_AK47, 600)
}
case CS_TEAM_T:
{
cs_set_user_nvg(id,true)
engclient_cmd(id, "nightvision")
set_user_health(id, g_AliveCT * g_100HP + g_100HP )
set_user_maxspeed(id, 325.0);
}
}
}
case DAY_RESHARK:
{
new g_AliveCT = fnGetCounterTerrorists()
new g_AliveT = fnGetTerrorists()
switch(team)
{
case CS_TEAM_CT:
{
set_user_health(id, g_AliveT * g_10HP + g_100HP)
give_item(id, "weapon_awp")
cs_set_user_bpammo(id, CSW_AWP, 30)
set_user_godmode(id,true)
}
case CS_TEAM_T:
{
set_user_health(id, g_AliveCT * g_10HP + g_50HP )
}
}
}
case DAY_RENIGHT:
{
new g_AliveT = fnGetTerrorists()
switch(team)
{
case CS_TEAM_CT:
{
give_item(id, "weapon_m4a1")
give_item(id, "weapon_deagle")
set_user_health(id, g_AliveT * g_10HP + g_100HP )
cs_set_user_bpammo(id, CSW_M4A1, 90)
cs_set_user_bpammo(id, CSW_DEAGLE, 35)
}
case CS_TEAM_T:
{
SaveWeapons(id)
set_user_footsteps(id, 1);
set_user_maxspeed(id, 400.0);
cs_set_user_bpammo(id, CSW_M4A1, 90)
}
}
}
case DAY_FREEZETAG:
if( g_iIsTag[ id ] )
g_FrozenT--
}
return HAM_IGNORED
}
public Fwd_TraceAttack_Player(victim, attacker, Float:flDamage, Float:flDirection[3], ptr, iDamagebits)
{
// Not a valid attacker / no victim
if (!(1 <= attacker <= g_iMaxPlayers))
return HAM_IGNORED
if (!is_user_connected(victim))
return HAM_IGNORED
g_bHeadShot[attacker][victim] = bool:( get_tr2(ptr, TR_iHitgroup) == HITGROUP_HEAD )
return HAM_IGNORED
}
public Event_current_weapon(id)
{
if(!is_user_connected(id) && !is_user_alive(id))
return PLUGIN_CONTINUE
switch( g_iDay[ 14 ] )
{
case DAY_ZOMBIE:
if(cs_get_user_team( id ) == CS_TEAM_CT)
set_user_maxspeed(id, 400.0)
case DAY_NIGHT:
if(cs_get_user_team( id ) == CS_TEAM_CT)
set_user_maxspeed(id, 400.0);
case DAY_REZOMBIE:
if(cs_get_user_team( id ) == CS_TEAM_T)
set_user_maxspeed(id, 325.0)
case DAY_RENIGHT:
if(cs_get_user_team( id ) == CS_TEAM_T)
set_user_maxspeed(id, 325.0);
}
if(get_user_weapon(id) == CSW_KNIFE && get_bit(g_bHasCrowbar, id))
{
set_pev(id, pev_viewmodel2, CrowbarModels[1])
set_pev(id, pev_weaponmodel2, CrowbarModels[0])
}
else if(get_user_weapon(id) == CSW_KNIFE)
{
set_pev(id, pev_viewmodel2, "models/v_knife.mdl")
set_pev(id, pev_weaponmodel2, "models/p_knife.mdl")
}
if(get_bit(g_bHasSpeed, id))
{
new Float:maxSpeed = get_pcvar_float(cvar_shopspeed)
set_pev(id, pev_maxspeed, maxSpeed);
}
return PLUGIN_CONTINUE
}
public Fwd_PlayerDamage(victim, ent, attacker, Float:damage, bits)
{
if(!is_user_connected(victim) || !is_user_connected(attacker) || victim == attacker)
return HAM_IGNORED
switch( g_iDay[ 14 ] )
{
case DAY_DEATHMATCH:
{
if( IsPlayer( attacker ) && victim != attacker )
{
g_iVictimTeam = cs_get_user_team_index(victim)
if( g_iVictimTeam == cs_get_user_team_index(attacker) )
{
cs_set_user_team_index(victim, g_iVictimTeam == TEAM_T ? TEAM_CT : TEAM_T)
EnableHamForward( g_iHhTakeDamagePost )
return HAM_HANDLED
}
}
}
case DAY_HIDENSEEK:
if( g_iFrozenTime == true )
if(cs_get_user_team( attacker ) == CS_TEAM_T)
return HAM_SUPERCEDE
case DAY_FREEZETAG:
return HAM_SUPERCEDE
}
if(get_bit(g_bInDisguise, victim))
{
cs_reset_user_model(victim)
fnColorPrint(victim, "The Cts have spotted you!")
fnColorPrint(victim, "Find somewhere safe to change back!")
clear_bit(g_bInDisguise, victim)
}
if(attacker == ent && get_user_weapon(attacker) == CSW_KNIFE && get_bit(g_bHasCrowbar, victim) && cs_get_user_team(victim) != CS_TEAM_T)
{
SetHamParamFloat(4, damage + 35)
return HAM_OVERRIDE
}
return HAM_IGNORED
}
public Player_TakeDamage_Post(victim)
{
if( g_iDay[ 14 ] == DAY_DEATHMATCH )
{
cs_set_user_team_index(victim, g_iVictimTeam)
DisableHamForward( g_iHhTakeDamagePost )
}
}
public Fwd_PlayerKilled_Pre(victim, attacker, shouldgib)
{
if (!is_user_connected(victim))
return HAM_IGNORED
if(get_bit(g_bHasCrowbar, victim))
g_iCrowbars--
if(get_bit(g_bHasSpeed, victim))
g_iSpeed--
if(get_bit(g_bHasInvis, victim))
g_iInvis--
if(get_bit(g_bHasFootstep, victim))
g_iFootstep--
if(get_bit(g_bHasDisguise, victim))
{
g_iDisguise--
cs_reset_user_model(victim)
clear_bit(g_bHasDisguise, victim)
clear_bit(g_bInDisguise, victim)
}
// Get info
new vName[32]
get_user_name(victim, vName, sizeof(vName)-1)
// Check if they are something special to annoy them lol
if( get_bit(g_bIsChosen, victim) || get_bit(g_bIsLast, victim) && g_bInLr )
{
// Advertise
if (g_iGameType == 10)
{
//fnColorPrint(0, "OMG! %s sucks! He died as Rambo", vName)
if(get_user_team(victim) == 1)
{
remove_task(victim+TASK_BEAM)
clear_bit(g_bIsLast, victim)
g_bInLr = false
}
}
else
{
fnColorPrint(0, "OMG! %s a pierdut la LR ! He just lost the %s", vName, fnGetGameType())
for (new i = 1; i <= g_iMaxPlayers; i++)
{
remove_task(i+TASK_BEAM)
clear_bit(g_bIsLast, i)
clear_bit(g_bIsChosen, i)
g_bInLr = false
}
}
}
// Hide Terrorist's name/give points for kill by Kruegs (soccdooccs)
if (get_user_team(attacker) == 1 && get_user_team(victim) == 2)
{
g_iPoints[attacker] += get_pcvar_num(cvar_killpoints)
if(g_bHeadShot[attacker][victim])
{
g_bHeadShot[attacker][victim] = false;
g_iPoints[attacker] += get_pcvar_num(cvar_headshotpoints);
}
SaveData(attacker)
ExecuteHamB(Ham_Killed, victim, 0, shouldgib)
set_pev(attacker, pev_frags, pev(attacker, pev_frags) + 1.0)
return HAM_SUPERCEDE
}
if( g_iDay[ 14 ] == DAY_FREEZETAG )
CheckTerrorist( )
return HAM_IGNORED;
}
public Fwd_PlayerTouch( Touched, Toucher )
{
if( g_iDay[ 14 ] == DAY_FREEZETAG )
{
if( ( 1 <= Toucher <= g_iMaxPlayers ) )
{
static Flags; Flags = entity_get_int( Touched, EV_INT_flags )
// Freeze an enemy
if( cs_get_user_team(Toucher) == CS_TEAM_CT && cs_get_user_team(Touched) == CS_TEAM_T )
{
// Already frozen ?
if( Flags & FL_FROZEN )
return
entity_set_int( Touched, EV_INT_flags, Flags | FL_FROZEN )
g_TagCount[ Touched ]++
g_FrozenT++
g_iIsTag[ Touched ] = true
// msg
static dName[ 33 ]; get_user_name( Touched, dName, charsmax( dName ) )
static rName[ 33 ]; get_user_name( Toucher, rName, charsmax( rName ) )
fnColorPrint( 0, "^3- Freeze Tag -^4 %s ^1has been tagged by^4 %s ^1, and is now frozen!", dName, rName)
// Check if all the terrorist are frozen
CheckTerrorist( )
if(g_TagCount[ Touched ] < 2)
if( is_user_admin( Touched ) )
set_user_rendering( Touched, kRenderFxGlowShell, 0, 255, 0, kRenderNormal, 40 )
else
set_user_rendering( Touched, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 40 )
else
set_user_rendering( Touched, kRenderFxGlowShell, 255, 255, 0, kRenderNormal, 40 )
}
// Unfreeze a teammate
if( cs_get_user_team(Toucher) == CS_TEAM_T && cs_get_user_team(Touched) == CS_TEAM_T )
{
if( Flags & FL_FROZEN && g_TagCount[ Touched ] < 2 )
{
// msg
static dName[ 33 ]; get_user_name( Touched, dName, charsmax( dName ) )
static rName[ 33 ]; get_user_name( Toucher, rName, charsmax( rName ) )
fnColorPrint( 0, "^3- Freeze Tag -^4 %s ^1has been untagged by^4 %s ^1, and is now unfrozen!", dName, rName)
Unfreeze( Touched )
set_user_rendering( Touched )
}
if( Flags & FL_FROZEN && g_TagCount[ Touched ] >= 2 )
{
new szFrags, szDeaths
szFrags = get_user_frags(Toucher)
set_user_frags(Toucher, szFrags+1)
szDeaths = cs_get_user_deaths(Toucher)
cs_set_user_deaths(Toucher, szDeaths)
szFrags = get_user_frags(Touched)
set_user_frags(Touched, szFrags+1)
szDeaths = cs_get_user_deaths(Touched)
cs_set_user_deaths(Touched, szDeaths)
fnColorPrint( Touched, "^3- Freeze Tag -^1 Sorry you been frozen 2 times")
Unfreeze(Touched)
set_user_rendering( Touched )
user_silentkill(Touched)
}
}
}
}
}
public Unfreeze( id ){
// Unfreeze player if it's frozen
static Flags; Flags = entity_get_int( id, EV_INT_flags )
entity_set_int( id, EV_INT_flags, Flags &~ FL_FROZEN )
if( g_iIsTag[ id ] )
{
g_FrozenT--
g_iIsTag[ id ] = false
}
}
// Check if all the terrorist are frozen
CheckTerrorist( )
{
new g_prisonors = fnGetTerrorists()
new szFrags, szDeaths
if( g_prisonors-1 == g_FrozenT )
{
static iPlayers[32], iNum, i, iPlayer
get_players( iPlayers, iNum, "ae", "TERRORIST" )
for( i=0; i<iNum; i++ )
{
iPlayer = iPlayers[i]
g_TagCount[iPlayer] = 0
if( g_iIsTag[iPlayer] )
{
szFrags = get_user_frags(iPlayer)
set_user_frags(iPlayer, szFrags+1)
szDeaths = cs_get_user_deaths(iPlayer)
cs_set_user_deaths(iPlayer, szDeaths)
Unfreeze(iPlayer)
user_silentkill(iPlayer)
}
}
g_FrozenT = 0
}
}
public sound_emit(id, channel, sample[])
{
if(is_user_alive(id) && equal(sample, "weapons/knife_", 14) && get_bit(g_bHasCrowbar, id))
{
switch(sample[17])
{
case('b'):
emit_sound(id, CHAN_WEAPON, "weapons/cbar_hitbod2.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
case('w'):
if (get_bit(g_bHasCrowbar,id))
emit_sound(id, CHAN_WEAPON, "weapons/cbar_hit1.wav", 1.0, ATTN_NORM, 0, PITCH_LOW)
else
emit_sound(id, CHAN_WEAPON, "weapons/cbar_hitbod1.wav", 1.0, ATTN_NORM, 0, PITCH_LOW)
case('1', '2'):
emit_sound(id, CHAN_WEAPON, "weapons/bullet_hit2.wav", random_float(0.5, 1.0), ATTN_NORM, 0, PITCH_NORM)
case('s'):
if (get_bit(g_bHasCrowbar,id))
emit_sound(id, CHAN_WEAPON, "weapons/cbar_miss1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
}
return FMRES_SUPERCEDE
}
return FMRES_IGNORED
}
public ClCmd_drop(id)
{
if (get_bit(g_bHasCrowbar,id) && (get_user_weapon(id) == CSW_KNIFE))
{
clear_bit(g_bHasCrowbar, id)
Event_current_weapon(id)
spawn_crowbar(id)
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
public spawn_crowbar(id)
{
new ent
new Float:where[3]
ent = create_entity("info_target")
set_pev(ent, pev_classname, g_szClassNameCrowbar)
set_pev(ent, pev_solid, SOLID_TRIGGER)
set_pev(ent, pev_movetype, MOVETYPE_BOUNCE)
entity_set_model(ent, CrowbarModels[2])
pev(id, pev_origin, where)
where[2] += 50.0;
where[0] += random_float(-20.0, 20.0)
where[1] += random_float(-20.0, 20.0)
entity_set_origin(ent, where)
where[0] = 0.0
where[2] = 0.0
where[1] = random_float(0.0, 180.0)
entity_set_vector(ent, EV_VEC_angles, where)
velocity_by_aim(id, 200, where)
entity_set_vector(ent,EV_VEC_velocity,where)
return PLUGIN_HANDLED
}
public cr_bar_snd(id, world)
{
new Float:v[3]
new Float:volume
entity_get_vector(id, EV_VEC_velocity, v)
v[0] = (v[0] * 0.45)
v[1] = (v[1] * 0.45)
v[2] = (v[2] * 0.45)
entity_set_vector(id, EV_VEC_velocity, v)
volume = get_speed(id) * 0.005;
if (volume > 1.0) volume = 1.0
if (volume > 0.1) emit_sound(id, CHAN_AUTO, "debris/metal2.wav", volume, ATTN_NORM, 0, PITCH_NORM)
return PLUGIN_CONTINUE
}
public crowbar_touch(ent, player)
{
static touch_class[32]
if (!pev_valid(ent))
return FMRES_IGNORED
pev(ent, pev_classname, touch_class, 31)
if( is_user_alive(player) && !is_user_bot(player) && cs_get_user_team(player) != CS_TEAM_CT)
{
if (equal(touch_class, g_szClassNameCrowbar) && !get_bit(g_bHasCrowbar, player))
{
set_bit(g_bHasCrowbar, player)
remove_entity(ent)
if (get_user_weapon(player) == CSW_KNIFE) Event_current_weapon(player)
emit_sound(player, CHAN_AUTO, "items/gunpickup2.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
return FMRES_SUPERCEDE
}
}
return FMRES_IGNORED
}
public Fwd_ItemDeploy_Pre(weapon)
{
// Get the owner of the weapon
new id = get_pdata_cbase(weapon, m_pPlayer, OFFSET_LINUX)
// The game isn't Shot4Shot
if (g_iGameType != 2)
return HAM_IGNORED
if (get_bit(g_bIsLast, id) || get_bit(g_bIsChosen, id))
if( weapon != CSW_KNIFE )
set_pdata_int(weapon, OFFSET_CLIPAMMO, 1, 4)
return HAM_IGNORED
}
public Fwd_Use_Pre(this, caller, activator, use_type, Float:value)
{
if (caller != activator)
return HAM_IGNORED
new Float:fNextUse
pev(this, pev_fuser4, fNextUse)
new Float:fGametime = get_gametime()
if (fNextUse > fGametime)
return HAM_IGNORED
new class[32], sModel[32];
pev(this, pev_classname, class, 32);
pev(this, pev_model, sModel, 32);
if( equal(sModel, szModel, 0) )
{
new szTargetName[32]
get_user_name(caller, szTargetName, sizeof(szTargetName)-1)
if(g_bAutoOpened)
g_bAutoOpened = false
else
fnColorPrint(0, "%s has opened the^x03 cells.", szTargetName)
if (!g_bAlreadyOpened)
{
remove_task( TASKID )
g_bAlreadyOpened = true
g_bCanBuy = false
}
set_pev(this, pev_fuser4, fGametime + get_pdata_float(this, m_flWait, 5))
}
return HAM_IGNORED
}
public Event_SendAudio()
g_iBlockLastRequest = 1
public Event_HLTV()
{
remove_task( TASKID )
set_task(61.0, "TASK_PushButton", TASKID )//61
server_cmd("sv_gravity 800")
g_bInLr = false
g_bAlreadyOpened = false
g_bAutoOpened = false
g_bCanBuy = true
g_iCrowbars = 0
g_iDisguise = 0
g_iFootstep = 0
g_iInvis = 0
g_iSpeed = 0
Day_Ends( )
}
/*================================================================================
[Save/Load Points]
=================================================================================*/
public SaveData(id)
{
new vKey[32], vData[32]
//Save their points
formatex(vKey, 31, "%s-points", g_iAuthID[ id ]);
formatex(vData, 31, "%i", g_iPoints[id]);
nvault_set(g_vault, vKey , vData);
}
public GetData(id)
{
new szKey[32];
formatex(szKey , 31 , "%s-points" , g_iAuthID[ id ]);
g_iPoints[id] = nvault_get( g_vault , szKey );
}
/*================================================================================
[The Shop]
=================================================================================*/
public ClCmd_shop(id)
{
if(!is_user_connected(id))
return PLUGIN_HANDLED
if(!get_pcvar_num(cvar_shop))
{
fnColorPrint( id, "The shop is currently disabled.")
return PLUGIN_HANDLED
}
if(cs_get_user_team(id) != CS_TEAM_T)
{
fnColorPrint(id, "Only prisoners can use the shop!")
return PLUGIN_HANDLED;
}
if(!g_bCanBuy)
{
fnColorPrint( id, "You can not use the shop after the cells have been opened!")
return PLUGIN_HANDLED
}
if(!is_user_alive(id))
{
fnColorPrint( id, "You must be alive to use the shop!")
return PLUGIN_HANDLED
}
shopmenu(id)
return PLUGIN_HANDLED
}
public shopmenu(id)
{
//if(is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_T)
{
new szText[777 char]
new points = g_iPoints[id]
//g_bHasMenuOpen[id] = true
set_bit(g_bHasMenuOpen, id)
formatex(szText, charsmax(szText), "Jailbreak Shop^nYour Points: %i", points)
new shopmenu = menu_create(szText, "sub_shopmenu")
formatex(szText, charsmax(szText), "Crowbar: %i Points (%i/%i)", get_pcvar_num(cvar_crowbarprice), g_iCrowbars, get_pcvar_num(cvar_crowbarlimit))
menu_additem(shopmenu, szText, "1", 0)
formatex(szText, charsmax(szText), "Armor: %i Points", get_pcvar_num(cvar_armorprice))
menu_additem(shopmenu, szText, "2", 0)
formatex(szText, charsmax(szText), "Nade pack: %i Points", get_pcvar_num(cvar_nadepackprice))
menu_additem(shopmenu, szText, "3", 0)
formatex(szText, charsmax(szText), "Invisiblity: %i Points (%i/%i)", get_pcvar_num(cvar_invisprice), g_iInvis, get_pcvar_num(cvar_invislimit))
menu_additem(shopmenu, szText, "4", 0)
formatex(szText, charsmax(szText), "Speed: %i Points (%i/%i)", get_pcvar_num(cvar_speedprice), g_iSpeed, get_pcvar_num(cvar_speedlimit))
menu_additem(shopmenu, szText, "5", 0)
formatex(szText, charsmax(szText), "No footsteps: %i Points (%i/%i)", get_pcvar_num(cvar_footstepprice), g_iFootstep, get_pcvar_num(cvar_footsteplimit))
menu_additem(shopmenu, szText, "6", 0)
formatex(szText, charsmax(szText), "Disguise: %i Points (%i/%i)", get_pcvar_num(cvar_disguiseprice), g_iDisguise, get_pcvar_num(cvar_disguiselimit))
menu_additem(shopmenu, szText, "7", 0)
menu_setprop(shopmenu, MPROP_EXIT , MEXIT_ALL);
menu_display(id, shopmenu, 0);
}
return PLUGIN_HANDLED
}
public sub_shopmenu(id, shopmenu, item)
{
if(!is_user_connected(id))
return PLUGIN_HANDLED
if (item == MENU_EXIT || cs_get_user_team(id) == CS_TEAM_CT)
{
clear_bit(g_bHasMenuOpen, id)
menu_destroy(shopmenu);
return PLUGIN_HANDLED;
}
if (!is_user_alive(id) || !g_bCanBuy)
{
clear_bit(g_bHasMenuOpen, id)
menu_destroy(shopmenu);
return PLUGIN_HANDLED;
}
new Data[7], Name[64];
new Access, Callback;
clear_bit(g_bHasMenuOpen, id)
menu_item_getinfo(shopmenu, item, Access, Data,5, Name, 63, Callback);
new Key = str_to_num(Data);
switch (Key)
{
case 1:
{
if(g_iPoints[id] < get_pcvar_num(cvar_crowbarprice))
{
fnColorPrint(id, "You do not have enough Points to buy that item!")
return PLUGIN_HANDLED
}
else
{
if(get_bit(g_bHasCrowbar, id))
{
fnColorPrint(id, "You already own this item!")
return PLUGIN_HANDLED
}
else if(g_iCrowbars >= get_pcvar_num(cvar_crowbarlimit))
{
fnColorPrint(id, "Too many crowbars have been bought!")
return PLUGIN_HANDLED
}
else
{
give_crowbar(id)
}
}
}
case 2:
{
if(get_bit(g_bHasArmor, id))
{
fnColorPrint(id, "You already own this item!")
return PLUGIN_HANDLED
}
else if(g_iPoints[id] < get_pcvar_num(cvar_armorprice))
{
fnColorPrint(id, "You do not have enough Points to buy that item!")
return PLUGIN_HANDLED
}
else
{
give_armor(id)
}
}
case 3:
{
if(get_bit(g_bHasNadepack, id))
{
fnColorPrint(id, "You already own this item!")
return PLUGIN_HANDLED
}
else if(g_iPoints[id] < get_pcvar_num(cvar_nadepackprice))
{
fnColorPrint(id, "You do not have enough Points to buy that item!")
return PLUGIN_HANDLED
}
else
{
give_nadepack(id)
}
}
case 4:
{
if(get_bit(g_bHasInvis, id))
{
fnColorPrint(id, "You already own this item!")
return PLUGIN_HANDLED
}
else if(g_iPoints[id] < get_pcvar_num(cvar_invisprice))
{
fnColorPrint(id, "You do not have enough Points to buy that item!")
return PLUGIN_HANDLED
}
else if(get_bit(g_bHasFreeday, id))
{
fnColorPrint(id, "You can not buy invisibility when you have a freeday!")
return PLUGIN_HANDLED
}
else
{
if(g_iInvis >= get_pcvar_num(cvar_invislimit))
{
fnColorPrint(id, "Too many prisoners own invisibility!")
return PLUGIN_HANDLED
}
else
{
give_invis(id)
}
}
}
case 5:
{
if(get_bit(g_bHasSpeed, id))
{
fnColorPrint(id, "You already own this item!")
return PLUGIN_HANDLED
}
else if(g_iPoints[id] < get_pcvar_num(cvar_speedprice))
{
fnColorPrint(id, "You do not have enough Points to buy that item!")
return PLUGIN_HANDLED
}
else if(g_iDay[ 14 ] == DAY_FREEZETAG)
{
fnColorPrint(id, "You can not buy speed when the day is FreezeTag!")
return PLUGIN_HANDLED
}
else
{
if(g_iSpeed >= get_pcvar_num(cvar_speedlimit))
{
fnColorPrint(id, "Too many prisoners own speed!")
return PLUGIN_HANDLED
}
else
{
give_speed(id)
}
}
}
case 6:
{
if(get_bit(g_bHasFootstep, id))
{
fnColorPrint(id, "You already own this item!")
return PLUGIN_HANDLED
}
else if(g_iPoints[id] < get_pcvar_num(cvar_footstepprice))
{
fnColorPrint(id, "You do not have enough Points to buy that item!")
return PLUGIN_HANDLED
}
else
{
if(g_iFootstep >= get_pcvar_num(cvar_footsteplimit))
{
fnColorPrint(id, "Too many prisoners do not have footsteps!")
return PLUGIN_HANDLED
}
else
{
give_footstep(id)
}
}
}
case 7:
{
if(get_bit(g_bHasDisguise, id))
{
fnColorPrint(id, "You already own this item!")
return PLUGIN_HANDLED
}
else if(g_iPoints[id] < get_pcvar_num(cvar_disguiseprice))
{
fnColorPrint(id, "You do not have enough Points to buy that item!")
return PLUGIN_HANDLED
}
else
{
if(g_iDisguise >= get_pcvar_num(cvar_disguiselimit))
{
fnColorPrint(id, "Too many prisoners have a disguise!")
return PLUGIN_HANDLED
}
else
{
give_disguise(id)
}
}
}
}
menu_destroy(shopmenu);
return PLUGIN_HANDLED;
}
public give_crowbar(id)
{
set_bit(g_bHasCrowbar, id)
ham_strip_weapon(id, "weapon_knife")
give_item(id, "weapon_knife")
g_iCrowbars++
g_iPoints[id] -= get_pcvar_num(cvar_crowbarprice)
fnColorPrint(id, "You bought a crowbar.")
return PLUGIN_HANDLED
}
public give_armor(id)
{
set_bit(g_bHasArmor, id)
set_user_armor(id, 100);
fnColorPrint(id, "You bought armour.")
g_iPoints[id] -= get_pcvar_num(cvar_armorprice)
return PLUGIN_HANDLED
}
public give_nadepack(id)
{
set_bit(g_bHasNadepack, id)
give_item(id, "weapon_flashbang")
give_item(id, "weapon_hegrenade")
give_item(id, "weapon_smokegrenade")
g_iPoints[id] -= get_pcvar_num(cvar_nadepackprice)
fnColorPrint(id, "You bought a nade pack.")
return PLUGIN_HANDLED
}
public give_invis(id)
{
new AlphaVal = get_pcvar_num(cvar_alphavalue)
set_bit(g_bHasInvis, id)
set_user_rendering(id,kRenderFxGlowShell,0,0,0,kRenderTransAlpha,AlphaVal)
g_iPoints[id] -= get_pcvar_num(cvar_invisprice)
g_iInvis++
fnColorPrint(id, "You bought invisiblity.")
return PLUGIN_HANDLED
}
public give_speed(id)
{
new Float:maxSpeed = get_pcvar_float(cvar_shopspeed)
set_bit(g_bHasSpeed, id)
set_user_maxspeed(id,maxSpeed)
g_iPoints[id] -= get_pcvar_num(cvar_speedprice)
g_iSpeed++
fnColorPrint(id, "You bought speed.")
return PLUGIN_HANDLED
}
public give_footstep(id)
{
set_user_footsteps(id, 1)
set_bit(g_bHasFootstep, id)
g_iPoints[id] -= get_pcvar_num(cvar_footstepprice)
g_iFootstep++
fnColorPrint(id, "You bought no footsteps.")
return PLUGIN_HANDLED
}
public give_disguise(id)
{
set_bit(g_bHasDisguise, id)
g_iPoints[id] -= get_pcvar_num(cvar_crowbarprice)
g_iDisguise++
fnColorPrint(id, "You bought a disguise.")
fnColorPrint(id, "Bind a key to wear_disguise to use it.")
return PLUGIN_HANDLED
}
/*================================================================================
[Give/Take Points]
=================================================================================*/
public cmd_give_points(id,level,cid)
{
if(!cmd_access(id,level,cid,3))
return PLUGIN_HANDLED;
new target[32], amount[21];
read_argv(1, target, 31 );
read_argv(2, amount, 20 );
new player = cmd_target( id, target, 8 );
if(!player)
return PLUGIN_HANDLED;
new admin_name[32], player_name[32];
get_user_name(id, admin_name, 31);
get_user_name(player, player_name, 31);
new pointnum = str_to_num(amount);
g_iPoints[player] += pointnum;
switch(get_cvar_num ("amx_show_activity"))
{
case 1: fnColorPrint( 0, "ADMIN gave %i points to %s.", pointnum, player_name)
case 2: fnColorPrint( 0, "ADMIN %s gave %i points to %s.", admin_name, pointnum, player_name)
}
fnColorPrint(player, "You received %i points.(Total: %i)", pointnum, g_iPoints[player]);
SaveData( id )
return PLUGIN_HANDLED;
}
public cmd_take_points(id,level,cid)
{
if(!cmd_access (id, level, cid, 2))
return PLUGIN_HANDLED;
new target[32], amount[21];
read_argv( 1, target, 31 );
read_argv( 2, amount, 20 );
new player = cmd_target( id, target, 8 );
if(!player )
return PLUGIN_HANDLED;
new admin_name[32], player_name[32];
get_user_name( id, admin_name, 31 );
get_user_name( player, player_name, 31 );
new pointnum = str_to_num( amount );
if(g_iPoints[player] < pointnum)
{
fnColorPrint( id, "You are attempting to take away too many points!")
return PLUGIN_HANDLED;
}
g_iPoints[player] -= pointnum;
switch(get_cvar_num("amx_show_activity"))
{
case 1: fnColorPrint( 0, "ADMIN took %i points from %s.", pointnum, player_name)
case 2: fnColorPrint( 0, "ADMIN %s took %i points from %s.", admin_name, pointnum, player_name)
}
fnColorPrint( player, "You lost %i points. (Total: %i)", pointnum, g_iPoints[player])
SaveData( id )
return PLUGIN_HANDLED;
}
public cmd_reset_points(id,level,cid)
{
if(!cmd_access(id,level,cid,2))
return PLUGIN_HANDLED;
new target[32];
read_argv(1, target, 31 );
new player = cmd_target( id, target, 8 );
if(!player)
return PLUGIN_HANDLED;
new admin_name[32], player_name[32];
get_user_name(id, admin_name, 31);
get_user_name(player, player_name, 31);
g_iPoints[player] = 0;
switch(get_cvar_num ("amx_show_activity"))
{
case 1: fnColorPrint( 0, "ADMIN has reset %s's points.", player_name)
case 2: fnColorPrint( 0, "ADMIN %s has reset %s's points.", admin_name, player_name)
}
fnColorPrint(player, "Your points have been reset.");
SaveData( id )
return PLUGIN_HANDLED;
}
/*================================================================================
[Open By 8:00/cell button stuff]
=================================================================================*/
public cmd_set_button(id,level,cid)
{
if(!cmd_access(id,level,cid,1))
return PLUGIN_HANDLED;
new szTempModel[64]
new szTempClass[64]
new szTemp[64]
new szTempEnt
new Map[32]
new szKey[32];
szTempEnt = GetAimingEnt(id);
if( pev_valid(szTempEnt) )
{
entity_get_string( szTempEnt, EV_SZ_classname, szTempClass, charsmax( szTempClass ) )
if( equal( szTempClass, "func_button" ) || equal( szTempClass, "func_rot_button" ) || equal( szTempClass, "button_target" ) )
{
pev(szTempEnt, pev_model, szTempModel, 63);
iEnt = szTempEnt
log_amx("%s", iEnt)
get_mapname(Map, 31)
strtolower(Map)
formatex(szKey , 31 , "%s" , Map);
formatex(szTemp , 64, "%s#%s#", szTempModel, szTempClass)
nvault_set(g_buttonvault , szKey , szTemp);
fnColorPrint(id, "The Ent with model #: ^"%s^",and Class name: ^"%s^" was set as the button for %s.", szTempModel, szTempClass, Map)
}
else{
fnColorPrint(id, "You can not set that entity as the cell button.")
}
}
else{
fnColorPrint(id, "You are not aiming at an entity.")
}
return PLUGIN_HANDLED;
}
GetAimingEnt(id)
{
static Float:start[3], Float:view_ofs[3], Float:dest[3], i;
pev(id, pev_origin, start);
pev(id, pev_view_ofs, view_ofs);
for( i = 0; i < 3; i++ )
{
start[i] += view_ofs[i];
}
pev(id, pev_v_angle, dest);
engfunc(EngFunc_MakeVectors, dest);
global_get(glb_v_forward, dest);
for( i = 0; i < 3; i++ )
{
dest[i] *= 9999.0;
dest[i] += start[i];
}
engfunc(EngFunc_TraceLine, start, dest, DONT_IGNORE_MONSTERS, id, 0);
return get_tr2(0, TR_pHit);
}
public TASK_PushButton()
{
fnColorPrint(0, "The Ct's have failed to open the cells by 8:00, it is now a freeday.")
g_bCanBuy = false
if(pev_valid(iEnt))
{
g_bAutoOpened = true
ExecuteHamB(Ham_Use, iEnt, 0, 0, 1, 1.0)
if(equal(szMap, "some1s_jailbreak"))
{
new iEntity
fnColorPrint(0, "It is valid moving wall.")
iEntity = find_ent_by_model(-1, "func_breakable", "*106")
if(pev_valid(iEntity))
engfunc( EngFunc_SetOrigin, iEntity, Vec );
}
}
}
public Get_Button()
{
new szTemp[64]
new Map[32]
new szKey[32];
new ButtonModel, ButtonClass
get_mapname(Map, 31)
strtolower(Map)
formatex(szKey , 31 , "%s" , Map);
formatex(szTemp , 63, "%s#%s#", ButtonModel, ButtonClass)
nvault_get(g_buttonvault, szKey, szTemp, 255)
replace_all(szTemp , 255, "#", " ")
parse(szTemp,szModel, 31, szClass, 31)
log_amx("The Ent with model #:%s,and Class name:%s was set as the button", szModel[0], szClass[0])
ButtonClass = szClass[0]
ButtonModel = szModel[0]
return PLUGIN_HANDLED;
}
public ButtonSpawn( Ent )
{
new Mnumber[ 32 ]
pev( Ent, pev_model, Mnumber, 31 )
if( equali( Mnumber, szModel ) )
iEnt = Ent
}
/*================================================================================
[Commands]
=================================================================================*/
public ClCmd_points(id){
fnColorPrint(id, "You currently have %i points.", g_iPoints[id])
return PLUGIN_HANDLED
}
public ClCmd_LastRequest(id)
{
if(!is_user_connected(id))
return PLUGIN_HANDLED
// Not a terrorist
if (get_user_team(id) != 1)
{
fnColorPrint(id, "Esti CT , nu poti folosi LR!.")
return PLUGIN_HANDLED
}
// Not alive
if (!is_user_alive(id))
{
fnColorPrint(id, "Sorry! Esti mort.")
return PLUGIN_HANDLED
}
// More than 1 terrorist
if (fnGetTerrorists() > 1)
{
fnColorPrint(id, "Sorry! You are not the last terrorist.")
return PLUGIN_HANDLED
}
// Less than 1 Counter-terrorist
if (fnGetCounterTerrorists() < 1)
{
fnColorPrint(id, "Nu este CT pentru a da LR.")
return PLUGIN_HANDLED
}
// Is he the last one?
if (get_bit(g_bIsLast, id))
{
// Check if there's a game
if (g_iGameType)
{
// There's a battle in progress
if (fnGetChosen())
{
fnColorPrint(id, "A battle is in progress!")
return PLUGIN_HANDLED
}
else if (g_iGameType == 10)
{
fnColorPrint(id, "A battle is in progress!")
return PLUGIN_HANDLED
}
}
}
// He's the last terrorist, open menu!
Show_LastRequestMenu(id)
return PLUGIN_HANDLED
}
public Task_StartRing(id)
{
// id = id - TASK_BEAM = id
id -= TASK_BEAM
// Avoid the task call if the user died
if (!is_user_connected(id) && !is_user_alive(id))
{
remove_task(id+TASK_BEAM)
return;
}
// Set the beam
fnSetRing(id)
}
/*================================================================================
[Lr Menu]
=================================================================================*/
Show_LastRequestMenu(id)
{
new players[32], pnum, tempid;
new alivenumm = 0
get_players(players, pnum, "a");
for( new i; i<pnum; i++ )
{
tempid = players[i];
if (cs_get_user_team(tempid) != CS_TEAM_CT)
{
continue;
}
alivenumm++
}
// Avoid Round End Last Request
if (g_iBlockLastRequest)
{
fnColorPrint(id, "Round End. You can not use this command now.")
return PLUGIN_HANDLED
}
set_bit(g_bHasMenuOpen, id)
set_bit(g_bIsLast, id)
new rMenu = menu_create("\rLast Request:", "LastRequestHandler")
menu_additem(rMenu, "1 on 1 Knife", "1", 0)
menu_additem(rMenu, "Shot 4 Shot", "2", 0)
menu_additem(rMenu, "Race", "3", 0)
menu_additem(rMenu, "Gun Toss", "4", 0)
menu_additem(rMenu, "Spray Contest", "5", 0)
menu_additem(rMenu, "Grenade Duel", "6", 0)
menu_additem(rMenu, "Suicide Bomber", "7", 0)
menu_additem(rMenu, "Shotgun Duel", "8", 0)
menu_additem(rMenu, "Scout Duel", "9", 0)
if (alivenumm > 2)
menu_additem(rMenu, "Rambo", "10", 0)
else
menu_additem(rMenu, "Rambo", "10", ADMIN_IMMUNITY)
menu_setprop(rMenu, MPROP_EXIT, MEXIT_ALL)
menu_display(id, rMenu, 0)
return PLUGIN_CONTINUE
}
Show_PlayersMenu(id)
{
new Pos[3], Name[32], Title[96]
formatex(Title, sizeof(Title)-1, "\rCT's Menu \w[Game: \r%s\w]", fnGetGameType())
new pMenu = menu_create(Title, "PlayersHandler")
if (g_iGameType > 9)
{
menu_additem(pMenu, "All", "1")
}
else
{
static iPlayers[32], iNum, i, iPlayer
get_players( iPlayers, iNum, "ae", "CT" )
for ( i=0; i<iNum; i++ )
{
iPlayer = iPlayers[i]
// Add them to the menu
num_to_str(iPlayer, Pos, sizeof(Pos)-1)
get_user_name(iPlayer, Name, sizeof(Name)-1)
menu_additem(pMenu, Name, Pos)
}
}
menu_setprop(pMenu, MPROP_EXIT, MEXIT_NEVER)
menu_display(id, pMenu, 0)
}
public LastRequestHandler(id, rMenu, item)
{
if (item == MENU_EXIT || !get_bit(g_bHasMenuOpen, id)) {
menu_destroy(rMenu)
return PLUGIN_HANDLED
}
new szName[64], szData[6]
new szAccess, szCallback
menu_item_getinfo(rMenu, item, szAccess, szData, sizeof(szData)-1, szName, sizeof(szName)-1, szCallback)
new szKey = str_to_num(szData)
// Show CT's Menu + Set the gametype to the key chosen
g_iGameType = szKey
Show_PlayersMenu(id)
return PLUGIN_HANDLED
}
public PlayersHandler(id, pMenu, item) {
if(!is_user_connected(id))
return PLUGIN_HANDLED
if (item == MENU_EXIT || !get_bit(g_bHasMenuOpen, id)) {
menu_destroy(pMenu)
return PLUGIN_HANDLED
}
// Not a terrorist
if (get_user_team(id) != 1)
return PLUGIN_HANDLED
// Not alive
if (!is_user_alive(id))
return PLUGIN_HANDLED
// More than 1 terrorist
if (fnGetTerrorists() > 1)
return PLUGIN_HANDLED
if(is_user_alive(id)) {
if(g_iGameType == 10) {
clear_bit(g_bHasMenuOpen, id)
new rebelingmenu = menu_create("\yRebel Options:", "sub_rebelmenu")
menu_additem(rebelingmenu, "Rambo", "1", 0);
menu_additem(rebelingmenu, "Deagle Dude", "2", 0);
menu_additem(rebelingmenu, "Crazy guy", "3", 0);
menu_additem(rebelingmenu, "Uber Glocker", "4", 0);
menu_setprop(rebelingmenu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, rebelingmenu, 0);
g_iGrenade = false
}
else {
new cName[32], Name[64], Data[6]
new Access, Callback
menu_item_getinfo(pMenu, item, Access, Data, sizeof(Data)-1, Name, sizeof(Name)-1, Callback)
get_user_name(id, cName, sizeof(cName)-1)
clear_bit(g_bHasMenuOpen, id)
g_iFinalCT = str_to_num(Data)
// Start the battle
fnColorPrint(0, "%s has chosen to play^x04 %s^x01 battle against^x04 %s", cName, fnGetGameType(), Name)
set_user_footsteps(id, 0)
set_pev(id, pev_maxspeed, 250.0)
// Make the rings
set_task(3.0, "Task_StartRing", g_iFinalCT+TASK_BEAM, _, _, "b")
// Avoid the task twice for the last terrorist
if (!task_exists(id+TASK_BEAM))
set_task(3.0, "Task_StartRing", id+TASK_BEAM, _, _, "b")
// Reset health
set_user_health(g_iFinalCT, 100)
set_user_health(id, 100)
// Strip Weapons
StripPlayerWeapons(id)
StripPlayerWeapons(g_iFinalCT)
g_iGrenade = false
// GameType = Key = Game
switch (g_iGameType)
{
case 1: {
// No ideas here..
fnColorPrint(0, "Choose a place to fight...or")
fnColorPrint(0, "Fight right now!")
server_cmd("sv_gravity 800")
}
case 2: {
// Give random weapon for Shot4Shot
new Shot4Shot = menu_create("\yShot 4 Shot Choice", "Shot4Shot_submenu")
menu_additem(Shot4Shot, "Random Weapon", "1", 0)
menu_additem(Shot4Shot, "USP", "2", 0)
menu_additem(Shot4Shot, "Deagle", "3", 0)
menu_additem(Shot4Shot, "Five Seven", "4", 0)
menu_additem(Shot4Shot, "M4A1", "5", 0)
menu_additem(Shot4Shot, "TMP", "6", 0)
menu_additem(Shot4Shot, "Machine Gun", "7", 0)
menu_additem(Shot4Shot, "Awp", "8", 0)
menu_additem(Shot4Shot, "Scout", "9", 0)
menu_setprop(Shot4Shot,MPROP_EXIT, MEXIT_ALL)
menu_display(id, Shot4Shot, 0)
server_cmd("sv_gravity 800")
}
case 3: {
// No ideas here..
fnColorPrint(0, "Choose a place to race!")
server_cmd("sv_gravity 800")
}
case 4: {
// Give a random weapon for the gun toss
new Weapon_Toss = menu_create("\yWeapon Toss Choice", "Weapon_Toss_submenu")
menu_additem(Weapon_Toss, "Random Weapon", "1", 0)
menu_additem(Weapon_Toss, "Grenade", "2", 0)
menu_additem(Weapon_Toss, "Deagle", "3", 0)
menu_additem(Weapon_Toss, "M4A1", "4", 0)
menu_setprop(Weapon_Toss,MPROP_EXIT, MEXIT_ALL)
menu_display(id, Weapon_Toss, 0)
// Empty clip ammo
//set_pdata_int(Ent, OFFSET_CLIPAMMO, 0, OFFSET_LINUX)
//set_pdata_int(Ent2, OFFSET_CLIPAMMO, 0, OFFSET_LINUX)
server_cmd("sv_gravity 800")
}
case 5: {
// No ideas here..
fnColorPrint(0, "Choose a wall and choose your rules.")
server_cmd("sv_gravity 800")
}
case 6: {
give_item(id, "weapon_hegrenade");
give_item(g_iFinalCT, "weapon_hegrenade")
set_user_armor(id ,100)
set_user_armor(g_iFinalCT ,100)
cs_set_user_bpammo(id,CSW_HEGRENADE, 1000)
cs_set_user_bpammo(g_iFinalCT,CSW_HEGRENADE, 1000)
fnColorPrint(0, "Blow up your opponent!")
server_cmd("sv_gravity 800")
}
case 7: {
explode_me(id)
server_cmd("sv_gravity 800")
}
case 8: {
give_item(id, "weapon_m3");
give_item(g_iFinalCT, "weapon_m3")
cs_set_user_bpammo(id,CSW_M3,100)
cs_set_user_bpammo(g_iFinalCT,CSW_M3,100)
set_user_health(g_iFinalCT, 500)
set_user_health(id, 500)
set_user_armor(id ,100)
set_user_armor(g_iFinalCT ,100)
server_cmd("sv_gravity 800")
}
case 9: {
give_item(id, "weapon_scout");
give_item(g_iFinalCT, "weapon_scout")
cs_set_user_bpammo(id,CSW_SCOUT,100)
cs_set_user_bpammo(g_iFinalCT,CSW_SCOUT,100)
set_user_armor(id ,100)
set_user_armor(g_iFinalCT ,100)
server_cmd("sv_gravity 300")
}
}
set_bit(g_bIsChosen, g_iFinalCT)
}
g_bInLr = true
clear_bit(g_bHasCrowbar, id)
}
return PLUGIN_HANDLED
}
public sub_rebelmenu(id, rebelingmenu, item)
{
if (item == MENU_EXIT)
{
menu_destroy(rebelingmenu);
return PLUGIN_HANDLED;
}
if(g_bInLr == false)
{
menu_destroy(rebelingmenu)
return PLUGIN_HANDLED
}
new Data[7], Name[64];
new Access, Callback;
menu_item_getinfo(rebelingmenu, item, Access, Data,5, Name, 63, Callback);
new Key = str_to_num(Data);
StripPlayerWeapons(id)
new g_AliveCT = fnGetCounterTerrorists()
switch (Key)
{
case 1:
{
// Start the battle
fnColorPrint(0, "The last terrorist is now RAMBO, kill him on sight!")
StripPlayerWeapons(id)
iRandom = random( sizeof(g_szWeaponList1) )
give_item(id, g_szWeaponList1[iRandom])
cs_set_user_bpammo(id, iWeaponId2[iRandom], 600)
set_user_health(id, g_AliveCT * g_100HP + g_100HP )
set_user_armor(id, 100)
set_user_footsteps(id, 0)
set_pev(id, pev_maxspeed, 250.0)
}
case 2:
{
StripPlayerWeapons(id)
set_user_health(id, g_AliveCT * g_100HP + g_100HP )
give_item( id, "weapon_deagle")
cs_set_user_bpammo(id,CSW_DEAGLE,35)
fnColorPrint(0, "The last terrorist is now DEAGLE DUDE, kill him on sight!")
}
case 3:
{
StripPlayerWeapons(id)
set_user_health(id, 1)
give_item( id, "weapon_ak47")
cs_set_user_bpammo(id,CSW_AK47,200)
set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 15)
fnColorPrint(0, "The last terrorist is now CRAZY GUY, kill him on sight!")
}
case 4:
{
StripPlayerWeapons(id)
set_user_health(id, g_AliveCT * g_100HP + g_100HP )
give_item( id, "weapon_glock18")
cs_set_user_bpammo(id,CSW_GLOCK18,200)
set_user_rendering(id, kRenderFxGlowShell, 255, 0, 0, kRenderTransAlpha, 255)
fnColorPrint(0, "The last terrorist is now UBER GLOCKER, kill him on sight!")
}
}
menu_destroy(rebelingmenu);
return PLUGIN_HANDLED;
}
public Shot4Shot_submenu(id, Shot4Shot, item)
{
if(item == MENU_EXIT)
{
menu_destroy(Shot4Shot)
return PLUGIN_HANDLED
}
if(g_bInLr == false)
{
menu_destroy(Shot4Shot)
return PLUGIN_HANDLED
}
new Data[7], Name[64]
new Access, Callback
menu_item_getinfo(Shot4Shot, item, Access, Data, 5, Name, 63, Callback)
new key = str_to_num(Data)
static weapon
switch(key)
{
case 1:
GiveRandomWeapon(id)
case 2:
{
weapon = give_item(g_iFinalCT, "weapon_usp")
weapon = give_item(id, "weapon_usp")
set_pdata_int(weapon, OFFSET_CLIPAMMO, 1, OFFSET_LINUX)
}
case 3:
{
weapon = give_item(g_iFinalCT, "weapon_deagle")
weapon = give_item(id, "weapon_deagle")
set_pdata_int(weapon, OFFSET_CLIPAMMO, 1, OFFSET_LINUX)
}
case 4:
{
weapon = give_item(g_iFinalCT, "weapon_fiveseven")
weapon = give_item(id, "weapon_fiveseven")
set_pdata_int(weapon, OFFSET_CLIPAMMO, 1, OFFSET_LINUX)
}
case 5:
{
weapon = give_item(g_iFinalCT, "weapon_m4a1")
weapon = give_item(id, "weapon_m4a1")
set_pdata_int(weapon, OFFSET_CLIPAMMO, 1, OFFSET_LINUX)
}
case 6:
{
weapon = give_item(g_iFinalCT, "weapon_tmp")
weapon = give_item(id, "weapon_tmp")
set_pdata_int(weapon, OFFSET_CLIPAMMO, 1, OFFSET_LINUX)
}
case 7:
{
weapon = give_item(g_iFinalCT, "weapon_m249")
weapon = give_item(id, "weapon_m249")
set_pdata_int(weapon, OFFSET_CLIPAMMO, 1, OFFSET_LINUX)
}
case 8:
{
weapon = give_item(g_iFinalCT, "weapon_awp")
weapon = give_item(id, "weapon_awp")
set_pdata_int(weapon, OFFSET_CLIPAMMO, 1, OFFSET_LINUX)
}
case 9:
{
weapon = give_item(g_iFinalCT, "weapon_scout")
weapon = give_item(id, "weapon_scout")
set_pdata_int(weapon, OFFSET_CLIPAMMO, 1, OFFSET_LINUX)
}
}
menu_destroy( Shot4Shot )
return PLUGIN_CONTINUE
}
public Weapon_Toss_submenu(id, Weapon_Toss, item)
{
if(item == MENU_EXIT)
{
menu_destroy(Weapon_Toss)
return PLUGIN_HANDLED
}
if(g_bInLr == false)
{
menu_destroy(Weapon_Toss)
return PLUGIN_HANDLED
}
new Data[7], Name[64]
new Access, Callback
menu_item_getinfo(Weapon_Toss, item, Access, Data, 5, Name, 63, Callback)
new key = str_to_num(Data)
static weapon
switch(key)
{
case 1:
GiveRandomWeapon(id)
case 2:
{
give_item(g_iFinalCT, "weapon_hegrenade")
give_item(id, "weapon_hegrenade")
}
case 3:
{
weapon = give_item(g_iFinalCT, "weapon_deagle")
weapon = give_item(id, "weapon_deagle")
set_pdata_int(weapon, OFFSET_CLIPAMMO, 0, OFFSET_LINUX)
}
case 4:
{
weapon = give_item(g_iFinalCT, "weapon_m4a1")
weapon = give_item(id, "weapon_m4a1")
set_pdata_int(weapon, OFFSET_CLIPAMMO, 0, OFFSET_LINUX)
}
}
g_iGrenade = true
menu_destroy( Weapon_Toss )
return PLUGIN_CONTINUE
}
public GiveRandomWeapon(id)
{
static weapon
iRandom = random( sizeof(szWeapons2) )
weapon = give_item(g_iFinalCT, szWeapons2[iRandom])
weapon = give_item(id, szWeapons2[iRandom])
if(g_iGameType == 2)
set_pdata_int(weapon, OFFSET_CLIPAMMO, 1, OFFSET_LINUX)
else
set_pdata_int(weapon, OFFSET_CLIPAMMO, 0, OFFSET_LINUX)
}
public Forward_Entity_Think( ent )
{
if( !g_bInLr )
return FMRES_IGNORED;
if ( !pev_valid( ent ) )
return FMRES_IGNORED;
if( g_iGrenade == true )
{
static owner;
owner = pev( ent, pev_owner );
if(get_bit(g_bIsLast, owner) || get_bit(g_bIsChosen, owner))
{
new hit = -1, Float:origin[3]
// Get the origin
pev(ent, pev_origin, origin)
while ((hit = find_ent_in_sphere(hit, origin, 18.2)))
{
if (hit > g_iMaxPlayers)
break
if (!is_user_connected(hit))
continue
if (!is_user_alive(hit))
continue
return touch_em(ent, hit)
}
set_pev(ent, pev_nextthink, get_gametime() + 0.1)
return FMRES_SUPERCEDE;
}
}
return FMRES_IGNORED;
}
touch_em(ent, id)
{
new classname[32]
pev(ent, pev_model, classname, charsmax(classname))
if (contain(classname, "w_hegrenade.mdl") != -1)
{
// User can have the grenade, give it to him and remove it
if (cs_get_user_bpammo(id, CSW_HEGRENADE) < 1)
{
if (cs_get_user_bpammo(id, CSW_HEGRENADE) == 0)
give_item(id, "weapon_hegrenade")
else
cs_set_user_bpammo(id, CSW_HEGRENADE, cs_get_user_bpammo(id, CSW_HEGRENADE) + 1)
// Remove and block engine call
remove_entity(ent)
return PLUGIN_HANDLED
}
}
// If not then we set the next think and block again the engine call
set_pev(ent, pev_nextthink, get_gametime() + 0.1)
return HAM_SUPERCEDE
}
public Forward_Model_Think( ent )
{
if( !g_bInLr )
return FMRES_IGNORED;
if ( !pev_valid( ent ) )
return FMRES_IGNORED;
static id
id = pev( ent, pev_owner )
if(!(1<=id<=g_iMaxPlayers))
return FMRES_IGNORED
if(get_bit(g_bIsLast, id) || get_bit(g_bIsChosen, id))
if( g_iGrenade == true )
switch(get_user_team(id))
{
case 1:set_rendering(ent,kRenderFxGlowShell,255,0,0,kRenderNormal,16)
case 2:set_rendering(ent,kRenderFxGlowShell,0,0,255,kRenderNormal,16)
}
return FMRES_IGNORED
}
/*================================================================================
[Suicide Bomber]
=================================================================================*/
public explode_me(id) {
// get my origin
new Float:explosion[3];
pev(id, pev_origin, explosion);
user_kill(id)
// create explosion
message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
write_byte(TE_EXPLOSION)
write_coord(floatround(explosion[0]));
write_coord(floatround(explosion[1]));
write_coord(floatround(explosion[2]));
write_short(explosion_sprite);
write_byte(30);
write_byte(30);
write_byte(0);
message_end();
fm_radius_damage(id, explosion, EXPLODE_DAMAGE, EXPLODE_RADIUS, "grenade");
}
stock fm_radius_damage(id, Float:orig[3], Float:dmg , Float:rad, wpnName[]="") {
new Classname[33], Float:Health;
static Ent
Ent = -1
while((Ent = engfunc(EngFunc_FindEntityInSphere, Ent, orig, rad))) {
pev(Ent,pev_classname,Classname,32)
if(!equali(Classname, "player"))
continue;
if(!is_user_connected(Ent))
continue;
if(!is_user_alive(Ent))
continue;
pev(Ent, pev_health, Health);
Health -= dmg;
new szName[32], szName1[32]
get_user_name(Ent, szName, 31)
get_user_name(id, szName1, 31)
if(Health <= 0.0)
createKill(Ent, id, wpnName);
else
set_pev(Ent, pev_health, Health);
}
}
// stock for create kill
stock createKill(id, attacker, weaponDescription[]) {
new szfrags, szfrags2
if(id != attacker) {
szfrags = get_user_frags(attacker)
set_user_frags(attacker, szfrags + 1)
logKill(attacker, id, weaponDescription);
//Kill the victim and block the messages
set_msg_block(get_user_msgid("DeathMsg"),BLOCK_ONCE);
set_msg_block(get_user_msgid("ScoreInfo"),BLOCK_ONCE);
user_kill(id);
//user_kill removes a frag, this gives it back
szfrags2 = get_user_frags(id)
set_user_frags(id, szfrags2 + 1)
//Replaced HUD death message
message_begin(MSG_ALL, get_user_msgid("DeathMsg"),{0,0,0},0);
write_byte(attacker);
write_byte(id);
write_byte(0);
write_string(weaponDescription);
message_end();
//Update killers scorboard with new info
message_begin(MSG_ALL, get_user_msgid("ScoreInfo"));
write_byte(attacker);
write_short(get_user_frags(attacker));
write_short(get_user_deaths(attacker));
write_short(0);
write_short(get_user_team(attacker));
message_end();
//Update victims scoreboard with correct info
message_begin(MSG_ALL, get_user_msgid("ScoreInfo"));
write_byte(id);
write_short(get_user_frags(id));
write_short(get_user_deaths(id));
write_short(0);
write_short(get_user_team(id));
message_end();
new szName[32], szName1[32]
get_user_name(id, szName, 31)
get_user_name(attacker, szName1, 31)
}
}
// stock for log kill
stock logKill(id, victim, weaponDescription[] ) {
new namea[32],namev[32],authida[35],authidv[35],teama[16],teamv[16];
//Info On Attacker
get_user_name(id,namea,31);
get_user_team(id,teama,15);
get_user_authid(id,authida,34);
//Info On Victim
get_user_name(victim,namev,31);
get_user_team(victim,teamv,15);
get_user_authid(victim,authidv,34);
//Log This Kill
if(id != victim)
log_message("^"%s<%d><%s><%s>^" killed ^"%s<%d><%s><%s>^" with ^"%s^"",
namea,get_user_userid(id),authida,teama,namev,get_user_userid(victim),authidv,teamv, weaponDescription );
else
log_message("^"%s<%d><%s><%s>^" committed suicide with ^"%s^"",
namea,get_user_userid(id),authida,teama, weaponDescription );
}
// from fakemeta_util, fm_fakedamage
stock fm_gFakedamage(victim, const classname[], Float:takedmgdamage, damagetype) {
new class[] = "trigger_hurt"
new entity = engfunc(EngFunc_CreateEntity,engfunc(EngFunc_AllocString,class))
if (!entity)
return 0
new value[16],kvbuffer = engfunc(EngFunc_GetInfoKeyBuffer,entity)
format(value, 15, "%f", takedmgdamage * 2)
engfunc(EngFunc_SetKeyValue, kvbuffer, "dmg", value)
format(value, 15, "%i", damagetype)
engfunc(EngFunc_SetKeyValue, kvbuffer, "damagetype", value)
engfunc(EngFunc_SetKeyValue, kvbuffer, "origin", "8192 8192 8192")
dllfunc(DLLFunc_Spawn,entity)
set_pev(entity, pev_classname, classname)
dllfunc(DLLFunc_Touch,entity,victim)
engfunc(EngFunc_RemoveEntity,entity)
return 1
}
/*================================================================================
[Glow/UnGlow Menu]
=================================================================================*/
public JBGlowMenu(id) {
if(!is_user_connected(id))
return PLUGIN_HANDLED;
if(!is_user_admin(id)) {
if( cs_get_user_team( id ) != CS_TEAM_CT ) {
fnColorPrint(id, "Terrorists cant use the glow command!")
return PLUGIN_HANDLED;
}
if(!is_user_alive(id)) {
fnColorPrint(id, "You can not use the glow command while you are dead!")
return PLUGIN_HANDLED;
}
}
new menu = menu_create("\rGlow Menu:", "sub_menu");
new players[32], pnum, tempid;
new szName[32], szTempid[10];
set_bit(g_bHasMenuOpen, id)
get_players(players, pnum, "a");
for( new i; i<pnum; i++ ) {
tempid = players[i];
if (cs_get_user_team(tempid) != CS_TEAM_T) {
continue;
}
if(!get_bit(g_bHasFreeday, tempid)) {
get_user_name(tempid, szName, 31);
num_to_str(tempid, szTempid, 9);
menu_additem(menu, szName, szTempid, 0);
}
}
menu_display(id, menu);
return PLUGIN_HANDLED;
}
public sub_menu(id, menu, item) {
if(!is_user_connected(id))
return PLUGIN_HANDLED;
if( item == MENU_EXIT ) {
clear_bit(g_bHasMenuOpen, id)
menu_destroy(menu);
return PLUGIN_HANDLED;
}
if(!is_user_admin(id)) {
if( cs_get_user_team( id ) != CS_TEAM_CT )
return PLUGIN_HANDLED;
if(!is_user_alive(id))
return PLUGIN_HANDLED;
}
new data[6], iName[64];
new access, callback;
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
new tempid = str_to_num(data);
new szName[32], szName2[32], szauth[32], szauth2[32];
get_user_name(id, szName, 31);
get_user_name(tempid, szName2, 31);
get_user_authid(id, szauth, 31);
get_user_authid(tempid, szauth2, 31);
set_user_rendering(tempid, kRenderFxGlowShell, 255, 140, 0, kRenderNormal, 20)
set_bit(g_bHasFreeday, tempid)
clear_bit(g_bHasMenuOpen, id)
fnColorPrint(0, "%s gave a freeday to %s.", szName, szName2)
log_amx("%s(%s) gave a freeday to %s(%s)^n.", szName, szauth, szName2, szauth2)
if(get_bit(g_bHasInvis, tempid)) {
fnColorPrint(tempid, "You may not have a freeday and invisiblity at the same time!")
fnColorPrint(tempid, "Your invisiblity has been removed and your points have been refunded.")
g_iPoints[tempid] += get_pcvar_num(cvar_invisprice)
clear_bit(g_bHasInvis, tempid)
return PLUGIN_HANDLED
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}
public JBUnglowMenu(id) {
if(!is_user_connected(id))
return PLUGIN_HANDLED;
if(!is_user_admin(id)) {
if( cs_get_user_team( id ) != CS_TEAM_CT ) {
fnColorPrint(id, "Terrorists cant use the unglow command!")
return PLUGIN_HANDLED;
}
if(!is_user_alive(id)) {
fnColorPrint(id, "You can not use the unglow command while you are dead!")
return PLUGIN_HANDLED;
}
}
new menu = menu_create("\rUnglow Menu:", "Unglow_sub_menu");
new players[32], pnum, tempid;
new szName[32], szTempid[10];
set_bit(g_bHasMenuOpen, id)
get_players(players, pnum, "a");
for( new i; i<pnum; i++ ) {
tempid = players[i];
if (get_bit(g_bHasFreeday, tempid)) {
get_user_name(tempid, szName, 31);
num_to_str(tempid, szTempid, 9);
menu_additem(menu, szName, szTempid, 0);
}
}
menu_display(id, menu);
return PLUGIN_HANDLED;
}
public Unglow_sub_menu(id, menu, item) {
if(!is_user_connected(id))
return PLUGIN_HANDLED;
if( item == MENU_EXIT ) {
clear_bit(g_bHasMenuOpen, id)
menu_destroy(menu);
return PLUGIN_HANDLED;
}
if(!is_user_admin(id)) {
if( cs_get_user_team( id ) != CS_TEAM_CT ) {
return PLUGIN_HANDLED;
}
if(!is_user_alive(id)) {
return PLUGIN_HANDLED;
}
}
new data[6], iName[64];
new access, callback;
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
clear_bit(g_bHasMenuOpen, id)
new tempid = str_to_num(data);
new szName[32], szName2[32], szauth[32], szauth2[32];
get_user_name(id, szName, 31);
get_user_name(tempid, szName2, 31);
get_user_authid(id, szauth, 31);
get_user_authid(tempid, szauth2, 31);
set_user_rendering(tempid)
clear_bit(g_bHasFreeday, tempid)
fnColorPrint(0, "%s removed glow from %s.", szName, szName2)
log_amx("%s(%s) removed glow from %s(%s)^n.", szName, szauth, szName2, szauth2)
menu_destroy(menu);
return PLUGIN_HANDLED;
}
public Clcmd_GlowRed(id) {
if(!is_user_connected(id))
return PLUGIN_HANDLED;
if(!is_user_admin(id)) {
if( cs_get_user_team( id ) != CS_TEAM_CT ) {
fnColorPrint(id, "Terrorists cant use the glow command!")
return PLUGIN_HANDLED;
}
if(!is_user_alive(id)) {
fnColorPrint(id, "You can not use the glow command while you are dead!")
return PLUGIN_HANDLED;
}
}
new szTempClass[64]
new player
player = GetAimingEnt(id);
if(!pev_valid(player))
return PLUGIN_HANDLED;
pev(player, pev_classname, szTempClass, 63);
if(equali(szTempClass, "player", 0)) {
if(cs_get_user_team(player) == CS_TEAM_CT) {
fnColorPrint(id, "You can not glow a Guard!")
return PLUGIN_HANDLED;
}
if(get_bit(g_bHasFreeday, player)) {
fnColorPrint(id, "You can not glow someone with a freeday!")
return PLUGIN_HANDLED;
}
set_user_rendering(player,kRenderFxGlowShell,255,0,0,kRenderNormal,16)
set_bit(g_bIsGlowing, player)
fnColorPrint(player, "You are glowing red.")
}
else {
fnColorPrint(id, "You are not aiming at a player.")
return PLUGIN_HANDLED;
}
return PLUGIN_HANDLED;
}
public Clcmd_GlowBlue(id) {
if(!is_user_connected(id))
return PLUGIN_HANDLED;
if(!is_user_admin(id)) {
if( cs_get_user_team( id ) != CS_TEAM_CT ) {
fnColorPrint(id, "Terrorists cant use the glow command!")
return PLUGIN_HANDLED;
}
if(!is_user_alive(id)) {
fnColorPrint(id, "You can not use the glow command while you are dead!")
return PLUGIN_HANDLED;
}
}
new szTempClass[64]
new player
player = GetAimingEnt(id);
if(!pev_valid(player))
return PLUGIN_HANDLED;
pev(player, pev_classname, szTempClass, 63);
if(equali(szTempClass, "player", 0)) {
if(cs_get_user_team(player) == CS_TEAM_CT) {
fnColorPrint(id, "You can not glow a Guard!")
return PLUGIN_HANDLED;
}
if(get_bit(g_bHasFreeday, player)) {
fnColorPrint(id, "You can not glow someone with a freeday!")
return PLUGIN_HANDLED;
}
set_user_rendering(player,kRenderFxGlowShell,0,0,255,kRenderNormal,16)
set_bit(g_bIsGlowing, player)
fnColorPrint(player, "You are glowing blue.")
}
else {
fnColorPrint(id, "You are not aiming at a player.")
return PLUGIN_HANDLED;
}
return PLUGIN_HANDLED;
}
public Clcmd_UnglowPlayer(id) {
if(!is_user_connected(id))
return PLUGIN_HANDLED;
if(!is_user_admin(id)) {
if( cs_get_user_team( id ) != CS_TEAM_CT ) {
fnColorPrint(id, "Terrorists cant use the unglow command!")
return PLUGIN_HANDLED;
}
if(!is_user_alive(id)) {
fnColorPrint(id, "You can not use the unglow command while you are dead!")
return PLUGIN_HANDLED;
}
}
new szTempClass[64]
new player
new szName[32], szName2[32], szauth[32], szauth2[32];
get_user_name(id, szName, 31);
get_user_name(player, szName2, 31);
get_user_authid(id, szauth, 31);
get_user_authid(player, szauth2, 31);
player = GetAimingEnt(id);
if(!pev_valid(player))
return PLUGIN_HANDLED;
pev(player, pev_classname, szTempClass, 63);
if(equali(szTempClass, "player", 0)) {
if(get_bit(g_bHasFreeday, player)) {
set_user_rendering(id,kRenderFxGlowShell,0,0,0,kRenderNormal,0)
fnColorPrint(0, "%s removed glow from %s.", szName, szName2)
clear_bit(g_bHasFreeday, player)
return PLUGIN_HANDLED;
}
else if(get_bit(g_bIsGlowing, player)) {
set_user_rendering(id,kRenderFxGlowShell,0,0,0,kRenderNormal,0)
clear_bit(g_bIsGlowing, player)
fnColorPrint(player, "%s removed your glow.", szName)
}
else
fnColorPrint(id, "That player is not glowing!")
}
else
fnColorPrint(id, "You are not aiming at a player.")
return PLUGIN_HANDLED;
}
/*================================================================================
[Class Menu]
=================================================================================*/
public ClassMenu(id)
{
if(!is_user_connected(id))
return PLUGIN_HANDLED;
if( cs_get_user_team( id ) != CS_TEAM_CT ) {
fnColorPrint(id, "Terrorists can not use the Class command!")
return PLUGIN_HANDLED;
}
if(!is_user_alive(id)) {
fnColorPrint(id, "You can not use the Class command while you are dead!")
return PLUGIN_HANDLED;
}
if(!g_bCanBuy) {
fnColorPrint( id, "You can not choose a class after the cells have been opened!")
return PLUGIN_HANDLED
}
set_bit(g_bHasMenuOpen, id)
new menu = menu_create("\rClass Menu:", "Class_sub_menu");
menu_additem(menu, "Politia Romana [ M4a1 ]", "1", 0);
menu_additem(menu, "Politia Moldoveana [ Ak47 ]", "2", 0);
menu_additem(menu, "Politia Americana [ AwP ]", "3", 0);
menu_additem(menu, "Politia Italiana ( UMP )", "4", 0);
menu_additem(menu, "Echipa S.W.A.T [ M3 ]", "5", 0);
menu_additem(menu, "Israel Police [ Mac10 ]", "6", 0);
menu_additem(menu, "Trupa Kommando [ Bullup ]", "7", 0);
menu_additem(menu, "Fortele Romane [ Scut ]", "8", ADMIN_BAN);
menu_additem(menu, "Heavy Duty [ M429]", "9", ADMIN_BAN);
menu_additem(menu, "Aparatorii [ Galil ]", "10", ADMIN_BAN);
menu_display(id, menu);
return PLUGIN_HANDLED;
}
public Class_sub_menu(id, menu, item)
{
if(!is_user_connected(id))
return PLUGIN_HANDLED;
if( item == MENU_EXIT || cs_get_user_team( id ) != CS_TEAM_CT) {
clear_bit(g_bHasMenuOpen, id)
menu_destroy(menu);
return PLUGIN_HANDLED;
}
if( cs_get_user_team( id ) != CS_TEAM_CT )
return PLUGIN_HANDLED;
if(!is_user_alive(id))
return PLUGIN_HANDLED;
if(!g_bCanBuy)
return PLUGIN_HANDLED
new data[6], iName[64];
new access, callback;
StripPlayerWeapons(id)
clear_bit(g_bHasMenuOpen, id)
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
switch(str_to_num(data)) {
case(1): {
give_item(id, "weapon_m4a1")
give_item(id, "weapon_usp")
cs_set_user_bpammo(id, CSW_M4A1, 90)
cs_set_user_bpammo(id, CSW_USP, 100)
fnColorPrint(id, "Ti-ai ales clasa. Daca vrei sa o schimbi scrie /class !.")
}
case(2): {
give_item(id, "weapon_ak47")
give_item(id, "weapon_glock18")
cs_set_user_bpammo(id, CSW_AK47, 90)
cs_set_user_bpammo(id, CSW_GLOCK18, 120)
fnColorPrint(id, "Ti-ai ales clasa. Daca vrei sa o schimbi scrie /class !.")
}
case(3): {
give_item(id, "weapon_awp")
give_item(id, "weapon_deagle")
cs_set_user_bpammo(id, CSW_AWP, 30)
cs_set_user_bpammo(id, CSW_DEAGLE, 35)
fnColorPrint(id, "Ti-ai ales clasa. Daca vrei sa o schimbi scrie /class !.")
}
case(4): {
give_item(id, "weapon_ump45")
give_item(id, "weapon_usp")
cs_set_user_bpammo(id, CSW_UMP45, 100)
cs_set_user_bpammo(id, CSW_USP, 100)
fnColorPrint(id, "Ti-ai ales clasa. Daca vrei sa o schimbi scrie /class !.")
}
case(5): {
give_item(id, "weapon_m3")
give_item(id, "weapon_p228")
cs_set_user_bpammo(id, CSW_M3, 32)
cs_set_user_bpammo(id, CSW_P228, 52)
fnColorPrint(id, "Ti-ai ales clasa. Daca vrei sa o schimbi scrie /class !.")
}
case(6): {
give_item(id, "weapon_mac10")
give_item(id, "weapon_deagle")
cs_set_user_bpammo(id, CSW_MAC10, 100)
cs_set_user_bpammo(id, CSW_DEAGLE , 3576)
fnColorPrint(id, "Ti-ai ales clasa. Daca vrei sa o schimbi scrie /class !.")
}
case(7): {
give_item(id, "weapon_aug")
give_item(id, "weapon_p228")
cs_set_user_bpammo(id, CSW_AUG, 90)
cs_set_user_bpammo(id, CSW_P228, 52)
fnColorPrint(id, "Ti-ai ales clasa. Daca vrei sa o schimbi scrie /class !")
}
case(8): {
//cs_set_user_model(id, "vip")
give_item(id, "weapon_shield")
give_item(id, "weapon_usp")
cs_set_user_bpammo(id, CSW_USP, 200)
fnColorPrint(id, "Ti-ai ales clasa. Daca vrei sa o schimbi scrie /class !.")
}
case(9): {
//cs_set_user_model(id, "vip")
give_item(id, "weapon_m249")
give_item(id, "weapon_elite")
cs_set_user_bpammo(id, CSW_ELITE, 100)
cs_set_user_bpammo(id, CSW_M249, 400)
fnColorPrint(id, "Ti-ai ales clasa. Daca vrei sa o schimbi scrie /class !.")
}
case(10): {
//cs_set_user_model(id, "vip")
give_item(id, "weapon_galil")
give_item(id, "weapon_deagle")
cs_set_user_bpammo(id, CSW_DEAGLE, 100)
cs_set_user_bpammo(id, CSW_GALIL, 200)
fnColorPrint(id, "Ti-ai ales clasa. Daca vrei sa o schimbi scrie /class !")
}
}
set_user_armor(id, 100)
menu_destroy(menu);
return PLUGIN_HANDLED;
}
public msgStatusIcon(const iMsgId, const iMsgDest, const iPlayer)
{
if(is_user_alive(iPlayer) && is_user_connected(iPlayer))
{
static szMsg[8]
get_msg_arg_string(2, szMsg, 7)
if(equal(szMsg, "buyzone"))
{
set_pdata_int(iPlayer, OFFSET_BUYZONE, get_pdata_int(iPlayer, OFFSET_BUYZONE) & ~(1<<0))
return PLUGIN_HANDLED
}
}
return PLUGIN_CONTINUE
}
/*================================================================================
[Hud message]
=================================================================================*/
public FwdHUDThink( iEntity )
{
if ( iEntity != g_iTimerEntity )
return
new g_prisoners = fnGetTerrorists();
new g_guards = fnGetCounterTerrorists();
new g_admins = fnGetAdminsOnline();
if( g_prisoners == 1 && g_iDay[ 14 ] != DAY_NONE )
{
fnColorPrint(0, "The day has ended due to 1 Prisoner remaining.")
Day_Ends( )
}
if( g_guards < 1 && g_iDay[ 14 ] != DAY_NONE )
{
fnColorPrint(0, "The day has ended due to No Guards remaining.")
Day_Ends( )
}
set_hudmessage(0, 255, 0, -1.0, 0.01, 0, 0.75, 0.75, 0.75, 0.75, 2)
if( g_iDay[ 14 ] != DAY_NONE && g_iAreWeInaVote == false )
show_hudmessage(0,"Prisoners: %i^nGuards: %i^nToday is a %s.", g_prisoners, g_guards, g_iStartDayNames[ g_iDay[ 14 ] ] )
else
show_hudmessage(0,"Prisoners: %i^nGuards: %i^n", g_prisoners, g_guards )
if(g_admins > 0 && g_iAutoStartVote != get_pcvar_num(cvar_autostartvote) )
g_iAutoStartVote = 0
entity_set_float( g_iTimerEntity, EV_FL_nextthink, get_gametime() + 1.0 )
}
/*================================================================================
[Functions]
=================================================================================*/
fnGetAdminsOnline()
{
static Admins
Admins = 0
for (new i = 1 ; i <= g_iMaxPlayers; i++)
if( is_user_admin(i)) Admins++
return Admins
}
/*
fnSetRatioHealth(id)
{
new players[32], t, ct
get_players(players, t, "ae", "TERRORIST")
get_players(players, ct, "ae", "CT")
new
HP
if( float(t + ct) == 2 )
{
HP = 200
}
}*/
fnGetTerrorists()
{
/* Get's the number of terrorists */
static Terrorists
Terrorists = 0
for (new i = 1 ; i <= g_iMaxPlayers; i++)
if( is_user_alive(i)
&& (get_user_team(i) == 1) ) Terrorists++
return Terrorists
}
fnGetCounterTerrorists()
{
/* Get's the number of counter-terrorists */
static CounterTerrorists
CounterTerrorists = 0
for (new i = 1 ; i <= g_iMaxPlayers; i++)
if( is_user_alive(i)
&& (get_user_team(i) == 2) ) CounterTerrorists++
return CounterTerrorists
}
fnGetChosen()
{
/* Get's if there's a chosen one between players */
new temp
for (new i = 1 ; i <= g_iMaxPlayers; i++)
if( is_user_connected(i)
|| (get_user_team(i) == 2)
|| (get_bit(g_bIsChosen, i))
|| (is_user_alive(i)) ) temp = set_bit(g_bIsChosen, i)
return temp;
}
stock in_array(needle, data[], size) {
for(new i = 0; i < size; i++) {
if(data[i] == needle)
return i
}
return -1
}
fnGetGameType() {
/* Get's the game type of the last request games */
new Game[32]
switch (g_iGameType) {
case 0: Game = "No Game Yet"
case 1: Game = "1 on 1 Knife"
case 2: Game = "Shot 4 Shot"
case 3: Game = "Race"
case 4: Game = "Gun Toss"
case 5: Game = "Spray Contest"
case 6: Game = "Grenade Duel"
case 7: Game = "Suicide Bomber"
case 8: Game = "Shotgun Duel"
case 9: Game = "Scout Duel"
case 10: Game = "Rebel Options"
}
return Game
}
fnSetRing(id) {
if(!is_user_connected(id) && !is_user_alive(id))
return PLUGIN_HANDLED
/* Teh beam cylinder !!! */
new Float:flOrigin[3], iOrigin[3]
pev(id, pev_origin, flOrigin)
FVecIVec(flOrigin, iOrigin)
// Beam Color
new Colors = get_user_team(id)
new Beam = GetPlayerHullSize(id)
new Admin = is_user_admin(id)
message_begin(MSG_BROADCAST, SVC_TEMPENTITY, iOrigin)
write_byte(TE_BEAMCYLINDER)
write_coord(iOrigin[0])
write_coord(iOrigin[1])
if(Beam == HULL_HEAD)
write_coord(iOrigin[2]-16)
else
write_coord(iOrigin[2]-33)
write_coord(iOrigin[0])
write_coord(iOrigin[1])
write_coord(iOrigin[2] + 200)
write_short(g_iRingSprite) // Sprite Index
write_byte(0) // Start Frame
write_byte(0) // Frame Rate
write_byte(5) // Life
write_byte(5) // Width
write_byte(0) // Noise
if(Admin)
{
write_byte(Colors == 2 ? 255 : 0)//r
write_byte(Colors == 1 ? 255 : 255)//g
write_byte(0)//b
}else{
write_byte(Colors == 1 ? 255 : 0)
write_byte(0)
write_byte(Colors == 2 ? 255 : 0)
}
write_byte(200) // Brightness
write_byte(0) // Speed
message_end()
return PLUGIN_HANDLED
}
fnColorPrint(index, const Msg[], {Float, Sql, Result,_}:...) {
new Buffer[190], Buffer2[192];
formatex(Buffer2, sizeof(Buffer2)-1, "^x04[%s] ^x01%s", g_szPluginPrefix, Msg);
vformat(Buffer, sizeof(Buffer)-1, Buffer2, 3);
if (!index) {
for (new i = 1; i <= g_iMaxPlayers; i++) {
if (!is_user_connected(i))
continue;
message_begin(MSG_ONE_UNRELIABLE, g_iMsgSayText,_, i);
write_byte(i);
write_string(Buffer);
message_end();
}
}
else {
if (!is_user_connected(index))
return;
message_begin(MSG_ONE_UNRELIABLE, g_iMsgSayText,_, index);
write_byte(index);
write_string(Buffer);
message_end();
}
}
public Message_SendAudio(iMsgId, iMsgDest, id)
{
if( id )
{
if( g_iGrenade == true )
{
new szRadioKey[19]
static const MRAD_FIREINHOLE[] = "%!MRAD_FIREINHOLE"
get_msg_arg_string(2, szRadioKey, charsmax(szRadioKey))
if( equal(szRadioKey, MRAD_FIREINHOLE) )
{
if( get_msg_block(g_iMsgTextMsg) != BLOCK_SET )
{
set_msg_block(g_iMsgTextMsg, BLOCK_ONCE)
}
return PLUGIN_HANDLED
}
}
}
return PLUGIN_CONTINUE
}
public reset_all(id)
{
clear_bit(g_bIsLast, id)
clear_bit(g_bIsChosen, id)
clear_bit(g_bHasCrowbar, id)
clear_bit(g_bHasArmor, id)
clear_bit(g_bHasSpeed, id)
clear_bit(g_bHasInvis, id)
clear_bit(g_bInDisguise, id)
clear_bit(g_bHasNadepack, id)
clear_bit(g_bHasFootstep, id)
clear_bit(g_bHasDisguise, id)
clear_bit(g_bHasFreeday, id)
clear_bit(g_bInDisguise, id)
clear_bit(g_bIsGlowing, id)
remove_task(id+TASK_BEAM)
set_user_footsteps(id, 0)
set_user_maxspeed(id, 250.0)
set_user_rendering(id)
}
// takes a weapon from a player efficiently
// Thanks to XxAvalanchexX
public ham_strip_weapon(id,weapon[])
{
if(!equal(weapon,"weapon_",7)) return 0;
new wId = get_weaponid(weapon);
if(!wId) return 0;
new wEnt;
while((wEnt = engfunc(EngFunc_FindEntityByString,wEnt,"classname",weapon)) && pev(wEnt,pev_owner) != id) {}
if(!wEnt) return 0;
if(get_user_weapon(id) == wId) ExecuteHamB(Ham_Weapon_RetireWeapon,wEnt);
if(!ExecuteHamB(Ham_RemovePlayerItem,id,wEnt)) return 0;
ExecuteHamB(Ham_Item_Kill,wEnt);
set_pev(id,pev_weapons,pev(id,pev_weapons) & ~(1<<wId));
return 1;
}
public ClCmd_CheckDisguise(id) {
if(!is_user_connected(id))
return PLUGIN_HANDLED;
if( cs_get_user_team( id ) != CS_TEAM_T ) {
fnColorPrint(id, "Cts can not use the Disguise command!")
return PLUGIN_HANDLED;
}
if(!is_user_alive(id)) {
fnColorPrint(id, "You can not use the Disguise while you are dead!")
return PLUGIN_HANDLED;
}
if(!get_bit(g_bHasDisguise, id)) {
fnColorPrint( id, "You do not own a disguise!")
return PLUGIN_HANDLED
}
if(get_bit(g_bInDisguise, id)) {
if(IsBeingWatched(id)) {
fnColorPrint( id, "You can not change back while your being watched!")
return PLUGIN_HANDLED
}
else {
cs_set_user_model(id, "leet")
clear_bit(g_bInDisguise, id)
fnColorPrint( id, "You have successfully changed back!")
return PLUGIN_HANDLED
}
}
else {
if(IsBeingWatched(id)) {
fnColorPrint( id, "You can not change to your disguise while your being watched!")
return PLUGIN_HANDLED
}
else {
cs_set_user_model(id, "urban")
set_bit(g_bInDisguise, id)
fnColorPrint( id, "You have successfully changed into your disguise!")
return PLUGIN_HANDLED
}
}
return PLUGIN_HANDLED;
}
// checks if they are in a ct's view
// Thanks to joaquimandrade
IsBeingWatched(id) {
new CsTeams:team = cs_get_user_team(id);
new Float:origin[3]
entity_get_vector(id,EV_VEC_origin,origin)
for(new i=1,CsTeams:teamViewer;i<=g_iMaxPlayers;i++) {
if(is_user_alive(i)) {
teamViewer = cs_get_user_team(i);
if(team != teamViewer)
if(fm_is_ent_visible_maxdistance(i,id,.maxdistance = DetectionMaxDistance) && is_in_viewcone(i,origin))
return true;
}
}
return false
}
bool:fm_is_ent_visible_maxdistance(index, entity,ignoremonsters = 0,Float:maxdistance) {
new Float:start[3], Float:dest[3];
pev(index, pev_origin, start);
pev(index, pev_view_ofs, dest);
xs_vec_add(start, dest, start);
pev(entity, pev_origin, dest);
if(vector_distance(start,dest) <= maxdistance) {
engfunc(EngFunc_TraceLine, start, dest, ignoremonsters, index, 0);
new Float:fraction;
get_tr2(0, TR_flFraction, fraction);
if (fraction == 1.0 || get_tr2(0, TR_pHit) == entity)
return true
}
return false;
}
//Taken From exolent//
public FwdSetVoice(receiver, sender, bool:listen) {
if( !(1 <= receiver <= g_iMaxPlayers)
|| !is_user_connected(receiver)
|| !(1 <= sender <= g_iMaxPlayers)
|| !is_user_connected(sender) ) return FMRES_IGNORED;
new CsTeams:team = cs_get_user_team(sender)
if( (team == CS_TEAM_T && !get_bit(g_bIsLast, sender) || team == CS_TEAM_CT && !is_user_alive(sender)) && !access(sender, ADMIN_MENU) ) {
engfunc(EngFunc_SetClientListening, receiver, sender, 0)
return FMRES_SUPERCEDE;
}
return FMRES_IGNORED;
}
public SaveWeapons(iPlayer)
{
if( !is_user_connected(iPlayer) && !is_user_alive(iPlayer) )
return PLUGIN_HANDLED
new iWeaponBits = g_iWeaponBits[iPlayer] = entity_get_int(iPlayer, EV_INT_weapons) & VALID_WEAPONS;
for(new i;i<=CSW_P90;i++)
{
if(IsWeaponInBits(i, iWeaponBits))
{
g_iWeaponClip[iPlayer][i] = cs_get_weapon_ammo(find_ent_by_owner(-1, g_szWeaponNames[i], iPlayer));
g_iWeaponAmmo[iPlayer][i] = cs_get_user_bpammo(iPlayer, i);
}
}
StripPlayerWeapons(iPlayer)
return PLUGIN_HANDLED
}
public RestoreWeapons(iPlayer)
{
if( !is_user_connected(iPlayer) && !is_user_alive(iPlayer) )
{
return PLUGIN_HANDLED
}
StripPlayerWeapons(iPlayer)
new iWeaponBits = g_iWeaponBits[iPlayer];
new iEntity;
for(new i;i<=CSW_P90;i++)
{
if(IsWeaponInBits(i, iWeaponBits))
{
iEntity = give_item(iPlayer, g_szWeaponNames[i]);
cs_set_weapon_ammo(iEntity, g_iWeaponClip[iPlayer][i]);
cs_set_user_bpammo(iPlayer, i, g_iWeaponAmmo[iPlayer][i]);
}
}
return PLUGIN_HANDLED
}
public ClientCommand_UnStuck( const id )
{
new i_Value;
if ( ( i_Value = UTIL_UnstuckPlayer ( id, START_DISTANCE, MAX_ATTEMPTS ) ) != 1 )
switch ( i_Value )
{
case 0: client_print(id, print_chat, "Couldn't find a free spot to move you too");
case -1: client_print(id, print_chat, "You cannot free yourself as dead player");
}
return PLUGIN_CONTINUE;
}
UTIL_UnstuckPlayer( const id, const i_StartDistance, const i_MaxAttempts )
{
// --| Is Not alive, ignore.
if ( !is_user_alive(id) ) return -1;
static Float:vf_OriginalOrigin[ Coord_e ], Float:vf_NewOrigin[ Coord_e ];
static i_Attempts, i_Distance;
// --| Get the current player's origin.
pev ( id, pev_origin, vf_OriginalOrigin );
i_Distance = i_StartDistance;
while ( i_Distance < 1000 )
{
i_Attempts = i_MaxAttempts;
while ( i_Attempts-- )
{
vf_NewOrigin[ x ] = random_float ( vf_OriginalOrigin[ x ] - i_Distance, vf_OriginalOrigin[ x ] + i_Distance );
vf_NewOrigin[ y ] = random_float ( vf_OriginalOrigin[ y ] - i_Distance, vf_OriginalOrigin[ y ] + i_Distance );
vf_NewOrigin[ z ] = random_float ( vf_OriginalOrigin[ z ] - i_Distance, vf_OriginalOrigin[ z ] + i_Distance );
engfunc ( EngFunc_TraceHull, vf_NewOrigin, vf_NewOrigin, DONT_IGNORE_MONSTERS, GetPlayerHullSize ( id ), id, 0 );
// --| Free space found.
if ( get_tr2 ( 0, TR_InOpen ) && !get_tr2 ( 0, TR_AllSolid ) && !get_tr2 ( 0, TR_StartSolid ) )
{
// --| Set the new origin .
engfunc ( EngFunc_SetOrigin, id, vf_NewOrigin );
return 1;
}
}
i_Distance += i_StartDistance;
}
// --| Could not be found.
return 0;
}
stock bool:is_user_stuck(id) {
new Float:g_origin[3];
pev(id, pev_origin, g_origin);
if ( trace_hull(g_origin, HULL_HUMAN,id) != 0 )
{
return true;
}
return false;
}
public CmdSprayMessage( id )
{
if(get_user_team(id) == 1 && !access(id, SPRAY_ACCESS))
{
fnColorPrint( id, "Sorry you have to be a gruad to enable this." )
return PLUGIN_HANDLED
}
if( g_iSprayMessages == false )
{
g_iSprayMessages = true
fnColorPrint( id, "You have^4 Enable^3 spray messages for everyone to see." )
} else {
if( g_iSprayMessages == true )
{
g_iSprayMessages = false
fnColorPrint( id, "You have^4 Disable^3 spray messages for everyone to see." )
}
}
return PLUGIN_HANDLED
}
public EventSpray( )
{
new iPlayer = read_data( 2 );
new iOrigin[ 3 ];
iOrigin[ 0 ] = read_data( 3 );
iOrigin[ 1 ] = read_data( 4 );
iOrigin[ 2 ] = read_data( 5 );
new Float:vecOrigin[ 3 ];
IVecFVec( iOrigin, vecOrigin );
new Float:vecDirection[ 3 ];
velocity_by_aim( iPlayer, 5, vecDirection );
new Float:vecStop[ 3 ];
xs_vec_add( vecOrigin, vecDirection, vecStop );
xs_vec_mul_scalar( vecDirection, -1.0, vecDirection );
new Float:vecStart[ 3 ];
xs_vec_add( vecOrigin, vecDirection, vecStart );
engfunc( EngFunc_TraceLine, vecStart, vecStop, IGNORE_MONSTERS, -1, 0 );
get_tr2( 0, TR_vecPlaneNormal, vecDirection );
vecDirection[ 2 ] = 0.0;
xs_vec_normalize( vecDirection, vecDirection );
xs_vec_mul_scalar( vecDirection, 5.0, vecDirection );
xs_vec_add( vecOrigin, vecDirection, vecStart );
xs_vec_copy( vecStart, vecStop );
vecStop[ 2 ] -= 9999.0;
engfunc( EngFunc_TraceLine, vecStart, vecStop, IGNORE_MONSTERS, -1, 0 );
get_tr2( 0, TR_vecEndPos, vecStop );
new szName[ 32 ];
get_user_name( iPlayer, szName, charsmax( szName ) );
if( g_iSprayMessages == true )
{
fnColorPrint( 0, "%s sprayed^4 %.1f units^1 above the^3 ground.", szName, ( vecStart[ 2 ] - vecStop[ 2 ] ) )
}
else
{
fnColorPrint( iPlayer, "You have sprayed^4 %.1f units^1 above the^3 ground.", ( vecStart[ 2 ] - vecStop[ 2 ] ) )
}
}
public forward_AddToFullPack(es_handle, e, ent, host, hostflags, player, pSet)
{
if( player && is_user_alive( host ))
{
if(g_iDay[ 14 ] == DAY_HIDENSEEK)
{
new CsTeams:team = cs_get_user_team(ent);
new alpha;
switch (team)
{
case CS_TEAM_CT:
{
alpha = 255;
}
case CS_TEAM_T:
{
static Float:flDistance
flDistance = entity_range(host, ent)
if( flDistance < 1000.0 )
{
alpha = floatround((1.0 - (flDistance / 1000.0)) * 255.0);
}
else
{
alpha = 1
}
}
}
if(get_user_team(ent) != get_user_team(host))
{
//set_es(es_handle, ES_RenderFx, 19);
set_es(es_handle, ES_RenderMode, kRenderTransAlpha);
set_es(es_handle, ES_RenderAmt, alpha);
}
}
if(g_iDay[ 14 ] == DAY_NIGHT)
{
new CsTeams:team = cs_get_user_team(host);
new alpha;
switch (team)
{
case CS_TEAM_CT:
{
alpha = 255;
}
case CS_TEAM_T:
{
alpha = 0;
}
}
if(get_user_team(ent) != get_user_team(host))
{
//set_es(es_handle, ES_RenderFx, 19);
set_es(es_handle, ES_RenderMode, kRenderTransAlpha);
set_es(es_handle, ES_RenderAmt, alpha);
}
}
if(g_iDay[ 14 ] == DAY_RENIGHT)
{
new CsTeams:team = cs_get_user_team(host);
new alpha;
switch (team)
{
case CS_TEAM_CT:
{
alpha = 0;
}
case CS_TEAM_T:
{
alpha = 255;
}
}
if(get_user_team(ent) != get_user_team(host))
{
//set_es(es_handle, ES_RenderFx, 19);
set_es(es_handle, ES_RenderMode, kRenderTransAlpha);
set_es(es_handle, ES_RenderAmt, alpha);
}
}
if(g_ThermalOn[host])
{
new CsTeams:team = cs_get_user_team(host);
static color[3];
switch (team)
{
case CS_TEAM_CT:
{
color[0] = 255;
color[1] = 0;
color[2] = 0;
}
case CS_TEAM_T:
{
color[0] = 0;
color[1] = 0;
color[2] = 255;
}
}
if(get_user_team(ent) != get_user_team(host))
{
set_es(es_handle, ES_RenderFx, 19);
set_es(es_handle, ES_RenderColor, color);
set_es(es_handle, ES_RenderMode, 0);
set_es(es_handle, ES_RenderAmt, 25);
}
}
}
return FMRES_IGNORED;
}
public Event_NVGToggle(id)
g_ThermalOn[id] = read_data(1);