Existing user? Sign in
Sign up
Games
Servers
Useful
User
Pass
2FA
Problema cu C4
Freakz Forum Index
->
Trash Bin
->
CS 2006-2019 (Archived)
->
Addons - Help / Support
Author
Message
643
Lem0n.GFZ
[Mentally Stable]
Status: Offline
(since 10-12-2019 20:54)
Joined: 22 Nov 2019
Posts: 5
,
Topics: 2
Location:
Romania
Reputation:
1.2
Posted: 23-11-2019, 23:37:12
| Translate post to:
... (
Click for more languages
)
Salut. Am o problema la addons-ul meu. Cand adaug pluginul de baza (Furien40.amxx), dispare bomba de la furieni si acestia nu o mai primesc deloc.
Asta este Furien40.sma, ma puteti ajuta va rog frumos?
Spoiler:
Code:
#include <amxmodx>
#include <amxmisc>
#include <csx>
#include <cstrike>
#include <engine>
#include <fakemeta>
#include <fakemeta_util>
#include <hamsandwich>
#define PLUGIN "Furien Mod"
#define VERSION "4.0"
#define AUTHOR "Aragon*"
#define POWERS
#define ULTIMATES
#define GOLD_SISTEM
#if defined POWERS
#include "furien40/furien40_powers.inc"
#endif
#if defined ULTIMATES
#include "furien40/furien40_ultimates.inc"
#endif
#if defined GOLD_SISTEM
#include "furien40/furien40_shop.inc"
#endif
// SETTINGS
#define PARACHUTE
#define LONGJUMP
#define ANTICAMP
#define SKYNAME "blood_"
// Default Furien Settings
#define FURIEN_MODEL "fr30_furien"
#define FURIEN_KNIFE_V "models/Furien30/v_claws.mdl"
#define FURIEN_KNIFE_P ""
#define FURIEN_GRAVITY 0.5
#define FURIEN_SPEED 700.0
// Default Anti Furien Model
#define ANTIFURIEN_MODEL "fr30_antifurien"
// Parachute
#if defined PARACHUTE
#define PARACHUTE_CLASS "Parachute"
#define WingsModel "models/furien30_shop/wings.mdl"
#define ParachuteModel "models/furien30_shop/parachute.mdl"
new ParaENT[33];
#endif
// FlashLight
#define SOUND_FLASHLIGHT_ON "items/flashlight1.wav"
#define SOUND_FLASHLIGHT_OFF "items/flashlight1.wav"
#define RADIUS 10
#define RED 255
#define GREEN 150
#define BLUE 15
#define LIFE 3
// VIP Acces
#define VIP_LEVEL ADMIN_LEVEL_H
#define TEAM_FURIEN 1
#define TEAM_ANTIFURIEN 2
// Macros
#if cellbits == 32
#define OFFSET_BZ 235
#else
#define OFFSET_BZ 268
#endif
#define PRIMARY_WEAPONS_BITSUM (1<<CSW_SCOUT | 1<<CSW_XM1014 | 1<<CSW_MAC10 | 1<<CSW_AUG | 1<<CSW_UMP45 | 1<<CSW_SG550 | 1<<CSW_GALIL | 1<<CSW_FAMAS | 1<<CSW_AWP | 1<<CSW_MP5NAVY | 1<<CSW_M249 | 1<<CSW_M3 | 1<<CSW_M4A1 | 1<<CSW_TMP | 1<<CSW_G3SG1 | 1<<CSW_SG552 | 1<<CSW_AK47 | 1<<CSW_P90)
#define SECONDARY_WEAPONS_BITSUM (1<<CSW_GLOCK18 | 1<<CSW_USP | 1<<CSW_P228 | 1<<CSW_DEAGLE | 1<<CSW_FIVESEVEN | 1<<CSW_ELITE)
#define AMMOWP_NULL (1<<0 | 1<<CSW_KNIFE | 1<<CSW_FLASHBANG | 1<<CSW_HEGRENADE | 1<<CSW_SMOKEGRENADE | 1<<CSW_C4)
#define _random(%1) random_num(0, %1 - 1)
#define TASKID_COUNTDOWN 452
#define TASKID_C4COUNTDOWN 453
#define TASKID_CHECKCAMPING 858
#define TASKID_HUDINFO 552
#define TASKID_SWITCHTEAM 554
new Float:Size[][3] = {
{0.0, 0.0, 1.0}, {0.0, 0.0, -1.0}, {0.0, 1.0, 0.0}, {0.0, -1.0, 0.0}, {1.0, 0.0, 0.0}, {-1.0, 0.0, 0.0}, {-1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, -1.0, 1.0}, {1.0, 1.0, -1.0}, {-1.0, -1.0, 1.0}, {1.0, -1.0, -1.0}, {-1.0, 1.0, -1.0}, {-1.0, -1.0, -1.0},
{0.0, 0.0, 2.0}, {0.0, 0.0, -2.0}, {0.0, 2.0, 0.0}, {0.0, -2.0, 0.0}, {2.0, 0.0, 0.0}, {-2.0, 0.0, 0.0}, {-2.0, 2.0, 2.0}, {2.0, 2.0, 2.0}, {2.0, -2.0, 2.0}, {2.0, 2.0, -2.0}, {-2.0, -2.0, 2.0}, {2.0, -2.0, -2.0}, {-2.0, 2.0, -2.0}, {-2.0, -2.0, -2.0},
{0.0, 0.0, 3.0}, {0.0, 0.0, -3.0}, {0.0, 3.0, 0.0}, {0.0, -3.0, 0.0}, {3.0, 0.0, 0.0}, {-3.0, 0.0, 0.0}, {-3.0, 3.0, 3.0}, {3.0, 3.0, 3.0}, {3.0, -3.0, 3.0}, {3.0, 3.0, -3.0}, {-3.0, -3.0, 3.0}, {3.0, -3.0, -3.0}, {-3.0, 3.0, -3.0}, {-3.0, -3.0, -3.0},
{0.0, 0.0, 4.0}, {0.0, 0.0, -4.0}, {0.0, 4.0, 0.0}, {0.0, -4.0, 0.0}, {4.0, 0.0, 0.0}, {-4.0, 0.0, 0.0}, {-4.0, 4.0, 4.0}, {4.0, 4.0, 4.0}, {4.0, -4.0, 4.0}, {4.0, 4.0, -4.0}, {-4.0, -4.0, 4.0}, {4.0, -4.0, -4.0}, {-4.0, 4.0, -4.0}, {-4.0, -4.0, -4.0},
{0.0, 0.0, 5.0}, {0.0, 0.0, -5.0}, {0.0, 5.0, 0.0}, {0.0, -5.0, 0.0}, {5.0, 0.0, 0.0}, {-5.0, 0.0, 0.0}, {-5.0, 5.0, 5.0}, {5.0, 5.0, 5.0}, {5.0, -5.0, 5.0}, {5.0, 5.0, -5.0}, {-5.0, -5.0, 5.0}, {5.0, -5.0, -5.0}, {-5.0, 5.0, -5.0}, {-5.0, -5.0, -5.0}
}
new PrimaryWeapons[][][] = {
{ "M4A1", "weapon_m4a1" },
{ "AK47", "weapon_ak47" },
{ "AUG", "weapon_aug" },
{ "SG552", "weapon_sg552" },
{ "Galil", "weapon_galil" },
{ "Famas", "weapon_famas" },
{ "MP5 Navy", "weapon_mp5navy" },
{ "XM1014", "weapon_xm1014" },
{ "M3", "weapon_m3" },
{ "P90", "weapon_p90" },
{ "M249", "weapon_m249" },
{ "SG550", "weapon_sg550" },
{ "G3SG1", "weapon_g3sg1" },
{ "AWP", "weapon_awp" },
{ "Scout", "weapon_scout" },
{ "Tmp", "weapon_tmp" },
{ "Ump", "weapon_ump45" },
{ "Mac 10", "weapon_mac10" }
},
SecondaryWeapons[][][] = {
{ "Deagle", "weapon_deagle" },
{ "USP", "weapon_usp" },
{ "Elite", "weapon_elite" },
{ "Fiveseven","weapon_fiveseven" },
{ "Glock", "weapon_glock18" },
{ "P228", "weapon_p228" }
},
Grenades[][] = {
"weapon_hegrenade",
"weapon_flashbang",
"weapon_flashbang"/*,
"weapon_smokegrenade"*/
},
GunsEvents[][]= {
"events/awp.sc","events/g3sg1.sc", "events/ak47.sc", "events/scout.sc",
"events/m249.sc","events/m4a1.sc", "events/sg552.sc", "events/aug.sc",
"events/sg550.sc", "events/m3.sc", "events/xm1014.sc", "events/usp.sc",
"events/mac10.sc", "events/ump45.sc", "events/fiveseven.sc", "events/p90.sc",
"events/deagle.sc", "events/p228.sc", "events/glock18.sc", "events/mp5n.sc",
"events/tmp.sc", "events/elite_left.sc", "events/elite_right.sc",
"events/galil.sc", "events/famas.sc"
},
WeaponsAmmo[][] = {
{ -1, -1 },
{ 13, 52 },
{ -1, -1 },
{ 10, 90 },
{ -1, -1 },
{ 7, 32 },
{ -1, -1 },
{ 30, 100 },
{ 30, 90 },
{ -1, -1 },
{ 30, 120 },
{ 20, 100 },
{ 25, 100 },
{ 30, 90 },
{ 35, 90 },
{ 25, 90 },
{ 12, 100 },
{ 20, 120 },
{ 10, 30 },
{ 30, 120 },
{ 100, 200 },
{ 8, 32 },
{ 30, 90 },
{ 30, 120 },
{ 20, 90 },
{ -1, -1 },
{ 7, 35 },
{ 30, 90 },
{ 30, 90 },
{ -1, -1 },
{ 50, 100 }
}
new AntiFurienWinSounds[][] = {
//"Furien30/antifurien_win1.wav",
"Furien30/antifurien_win2.wav"
},
FurienWinSounds[][] = {
//"Furien30/furien_win1.wav",
"Furien30/furien_win2.wav"
},
FurienMissSounds[][] = {
"zombie/claw_miss1.wav",
"zombie/claw_miss2.wav"
},
FurienHitSounds[][] = {
//"zombie/claw_strike1.wav",
"zombie/claw_strike2.wav",
"zombie/claw_strike3.wav"
},
FurienDieSounds[][] = {
"Furien30/furien_die1.wav"
},
CountDownSounds[][] = {
"Furien30/timer01.wav",
"Furien30/timer02.wav",
"Furien30/timer03.wav",
"Furien30/timer04.wav",
"Furien30/timer05.wav"/*,
"Furien30/timer06.wav",
"Furien30/timer07.wav",
"Furien30/timer08.wav",
"Furien30/timer09.wav",
"Furien30/timer10.wav"*/
},
CountDownFinalSounds[][] = {
"Furien30/timestart.wav"
}
#if defined SKYNAME
new SkyTermination[][] = {
"bk",
"dn",
"ft",
"lf",
"rt",
"up"
}
#endif
new AutoLight[][] = {
"c",
"d",
"e",
"f",
"g",
"h",
"i",
"j"
}
#if defined ANTICAMP
new bool:BombPlanted, bool:ChangeLevel = false, Meter[33], CheckCampingTime[33], StandardDeviation[33], CoordsBody[33][4][3], CoordsEyes[33][4][3],
cvar_camp_limit
#endif
#define TASKID_MODELCHANGE 52342234
new DEFAULT_MODELINDEX_T[] = "models/player/terror/terror.mdl",
DEFAULT_MODELINDEX_CT[] = "models/player/urban/urban.mdl",
bool:HasCustomModel[33], CustomModelIndex[33], CustomPlayerModel[33][32], Float:ModelChangeTargetTime
new Menu, FWD_Spawn, FWD_PrecacheEvent, CountDownDelay, C4_CountDownDelay, bool:MapHasBomb = false, bool:RoundEnded,
Float:RoundTime, Float:MakeVisible[33], Float:Wallorigin[33][3], Float:FlashLightTime[33], bool:CanPlant = false,
bool:HaveC4 = false, bool:Falling[33], bool:FlashLight[33], bool:ShowMenu[33],
bool:NightVisionActive[33], bool:HaveSpecialPrimary[33], bool:HaveSpecialSecondary[33], bool:HavePrimaryWeapon[33],
bool:HaveSecondaryWeapon[33], PrimaryWeapon[33], SecondaryWeapon[33], Stuck[33], FlashLightBattery[33],
GunsEventidsBitsum, C4SpriteCircle, GrenadeTrail, C4Sprite
new cvar_enabled, cvar_gamedescription, cvar_lights, cvar_lights_final, cvar_auto_light, cvar_final_time,
cvar_nvg_radius, cvar_winsounds, cvar_startround, cvar_countdown, cvar_fog, cvar_rainsnow, cvar_weaponsmenu,
cvar_switchteam, cvar_maxdistance, cvar_batterycost
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_cvar("furien40_version", VERSION, FCVAR_SPONLY|FCVAR_SERVER)
set_cvar_string("furien40_version", VERSION)
cvar_enabled = register_cvar("furien40_enabled", "1")
if(!get_pcvar_num(cvar_enabled))
return PLUGIN_HANDLED
cvar_gamedescription = register_cvar("furien40_gamedescription", "Furien V4.0")
cvar_lights = register_cvar("furien40_light", "h")
cvar_lights_final = register_cvar("furien40_lights_c4", "b")
cvar_auto_light = register_cvar("furien40_auto_lights_enable", "1")
cvar_final_time = register_cvar("furien40_final_time", "60")
cvar_nvg_radius = register_cvar("furien40_nvg_radius", "100")
cvar_winsounds = register_cvar("furien40_winsounds_enable", "1")
cvar_startround = register_cvar("furien40_start_round", "5")
cvar_countdown = register_cvar("furien40_countdown", "1")
#if defined ANTICAMP
cvar_camp_limit = register_cvar("furien40_camp_limit", "7");
#endif
cvar_weaponsmenu = register_cvar("furien40_weaponsmenu", "0")
cvar_switchteam = register_cvar("furien40_switch_teams", "1")
cvar_maxdistance = register_cvar("furien40_flashlight_distance_max", "3000")
cvar_batterycost = register_cvar("furien40_flashlight_battery_cost", "100")
register_dictionary("Furien40.txt")
register_clcmd("guns", "CMD_Guns");
register_clcmd("say guns", "CMD_Guns");
register_clcmd("say /guns", "CMD_Guns");
register_clcmd("say_team guns", "CMD_Guns");
register_clcmd("say_team /guns", "CMD_Guns");
register_clcmd("nightvision", "CMD_Nightvision")
/*register_clcmd("jointeam","CMD_JoinTeam");
register_clcmd("jointeam 1","CMD_JoinTeam");
register_clcmd("jointeam 2","CMD_JoinTeam");*/
register_message(get_user_msgid("NVGToggle"), "MSG_NVGToggle")
register_message(get_user_msgid("SendAudio"), "MSG_SendAudio")
register_message(get_user_msgid("Health"), "MSG_Health")
register_message(get_user_msgid("TextMsg"), "MSG_TextMsg")
register_message(get_user_msgid("StatusIcon"), "MSG_StatusIcon");
register_message(get_user_msgid("WeapPickup"), "MSG_WeapPickup")
register_message(get_user_msgid("AmmoPickup"), "MSG_AmmoPickup")
/*register_message(get_user_msgid("ShowMenu"), "MSG_ShowMenu")
register_message(get_user_msgid("VGUIMenu"), "MSG_VGUIMenu")*/
new Bomb1 = engfunc(EngFunc_FindEntityByString,-1, "classname", "func_bomb_target");
new Bomb2 = engfunc(EngFunc_FindEntityByString,-1, "classname", "info_bomb_target");
if(is_valid_ent(Bomb1) || is_valid_ent(Bomb2))
MapHasBomb = true
register_event("HLTV", "EVENT_NewRound", "a", "1=0", "2=0")
register_event("TextMsg", "EVENT_TextMsg", "a", "2=#Game_will_restart_in")
register_event("CurWeapon", "EVENT_CurWeapon", "be", "1=1")
register_event("SendAudio", "EVENT_SwitchTeam", "a", "1=0", "2=%!MRAD_ctwin");
register_logevent("LOGEVENT_BombSpawned", 3, "2=Spawned_With_The_Bomb");
register_logevent("LOGEVENT_RoundStart", 2, "1=Round_Start");
register_logevent("LOGEVENT_RoundEnd", 2, "1=Round_End");
register_logevent("LOGEVENT_RoundEnd", 2, "1&Restart_Round_")
unregister_forward(FM_Spawn, FWD_Spawn)
unregister_forward(FM_PrecacheEvent, FWD_PrecacheEvent, 1);
register_forward(FM_PlaybackEvent, "FWD_PlaybackEvent");
register_forward(FM_GetGameDescription, "FWD_GameDescription")
register_forward(FM_SetClientKeyValue, "FWD_SetClientKeyValue")
register_forward(FM_AddToFullPack, "FWD_AddToFullPack", 1);
register_forward(FM_PlayerPreThink, "FWD_PreThink");
#if defined PARACHUTE
register_forward(FM_PlayerPreThink, "FWD_ParachutePreThink");
#endif
#if defined LONGJUMP
register_forward(FM_PlayerPreThink, "FWD_LongJumpPreThink", 1);
#endif
register_forward(FM_EmitSound, "FWD_Sound")
register_forward(FM_CmdStart, "FWD_CmdStart")
register_forward(FM_CreateNamedEntity, "FWD_CreateNamedEntity")
register_forward(FM_PlayerPostThink, "FWD_PostThink")
RegisterHam(Ham_Spawn, "player", "HAM_Spawn_Post", 1);
RegisterHam(Ham_Touch, "weaponbox", "HAM_Touch_Weapon")
RegisterHam(Ham_Touch, "armoury_entity", "HAM_Touch_Weapon")
RegisterHam(Ham_Touch, "weapon_shield", "HAM_Touch_Weapon")
RegisterHam(Ham_Use, "func_tank", "HAM_Use_Tank")
RegisterHam(Ham_Use, "func_tankmortar", "HAM_Use_Tank")
RegisterHam(Ham_Use, "func_tankrocket", "HAM_Use_Tank")
RegisterHam(Ham_Use, "func_tanklaser", "HAM_Use_Tank")
RegisterHam(Ham_Use, "func_pushable", "HAM_Use_Pushable")
RegisterHam(Ham_Killed, "player", "HAM_Killed_Player")
RegisterHam(Ham_Touch, "player", "HAM_Player_Touch", 1);
RegisterHam(Ham_Item_Deploy , "weapon_knife", "HAM_Knife_Deploy_Post", 1);
RegisterHam(Ham_TakeDamage,"player","HAM_TakeDamage");
RegisterHam(Ham_TakeDamage,"hostage_entity","HAM_Hostage_TakeDamage");
set_task(0.5, "TASK_HUD", _, _, _, "b")
set_task(0.1, "TASK_Light", _, _, _, "b")
set_cvar_num("sv_skycolor_r", 0)
set_cvar_num("sv_skycolor_g", 0)
set_cvar_num("sv_skycolor_b", 0)
set_cvar_num("sv_maxspeed", 9999);
set_cvar_num("sv_airaccelerate", 9999);
set_cvar_float("mp_freezetime", get_pcvar_float(cvar_startround));
set_cvar_num("mp_playerid", 2);
return PLUGIN_CONTINUE
}
public plugin_precache() {
cvar_fog = register_cvar("furien40_fog", "1")
cvar_rainsnow = register_cvar("furien40_rain_snow", "3")
#if defined SKYNAME
set_cvar_string("sv_skyname", SKYNAME)
#endif
FWD_Spawn = register_forward(FM_Spawn, "FMSpawn")
FWD_PrecacheEvent = register_forward (FM_PrecacheEvent, "FMPrecacheEvent", 1)
C4Sprite = precache_model("sprites/Furien30/C4.spr");
C4SpriteCircle = precache_model("sprites/ef_shockwave.spr");
GrenadeTrail = precache_model("sprites/ef_shockwave.spr")
#if defined PARACHUTE
if(file_exists(WingsModel)) precache_model(WingsModel);
if(file_exists(ParachuteModel)) precache_model(ParachuteModel);
#endif
#if defined FURIEN_MODEL
new FurienModel[128]
formatex(FurienModel, charsmax(FurienModel), "models/player/%s/%s.mdl", FURIEN_MODEL, FURIEN_MODEL)
if(file_exists(FurienModel)) precache_model(FurienModel)
// Support modelT.mdl files
formatex(FurienModel, charsmax(FurienModel), "models/player/%s/%sT.mdl", FURIEN_MODEL, FURIEN_MODEL)
if(file_exists(FurienModel)) precache_model(FurienModel)
#endif
#if defined FURIEN_KNIFE_V
if(file_exists(FURIEN_KNIFE_V)) precache_model(FURIEN_KNIFE_V)
#endif
#if defined FURIEN_KNIFE_P
if(file_exists(FURIEN_KNIFE_P)) precache_model(FURIEN_KNIFE_P)
#endif
#if defined ANTIFURIEN_MODEL
new AntiFurienModel[128]
formatex(AntiFurienModel, charsmax(AntiFurienModel), "models/player/%s/%s.mdl", ANTIFURIEN_MODEL, ANTIFURIEN_MODEL)
if(file_exists(AntiFurienModel)) precache_model(AntiFurienModel)
// Support modelT.mdl files
formatex(AntiFurienModel, charsmax(AntiFurienModel), "models/player/%s/%sT.mdl", ANTIFURIEN_MODEL, ANTIFURIEN_MODEL)
if(file_exists(AntiFurienModel)) precache_model(AntiFurienModel)
#endif
new i
for(i = 0; i < sizeof AntiFurienWinSounds; i++)
precache_sound(AntiFurienWinSounds[i])
for(i = 0; i < sizeof FurienWinSounds; i++)
precache_sound(FurienWinSounds[i])
for(i = 0; i < sizeof FurienMissSounds; i++)
precache_sound(FurienMissSounds[i])
for(i = 0; i < sizeof FurienHitSounds; i++)
precache_sound(FurienHitSounds[i])
for(i = 0; i < sizeof FurienDieSounds; i++)
precache_sound(FurienDieSounds[i])
for(i = 0; i < sizeof CountDownSounds; i++)
precache_sound(CountDownSounds[i])
for(i = 0; i < sizeof CountDownFinalSounds; i++)
precache_sound(CountDownFinalSounds[i])
precache_sound(SOUND_FLASHLIGHT_ON)
precache_sound(SOUND_FLASHLIGHT_OFF)
#if defined SKYNAME
for(i = 0; i < sizeof SkyTermination; ++i) {
new Sky[64];
formatex(Sky,sizeof(Sky)-1,"gfx/env/%s%s.tga", SKYNAME, SkyTermination[i]);
precache_generic(Sky);
}
#endif
remove_entity_name("func_buyzone");
new Entity = create_entity("info_map_parameters");
DispatchKeyValue(Entity, "buying", "3");
DispatchSpawn(Entity);
switch(get_pcvar_num(cvar_rainsnow)) {
case 1: {
engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "env_rain"))
}
case 2: {
engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "env_snow"))
}
case 3: {
switch(random_num(1,2)) {
case 1: {
engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "env_rain"))
}
case 2: {
engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "env_snow"))
}
}
}
}
}
// Natives
public plugin_natives() {
register_native("cs_set_player_model", "cs_set_player_model")
register_native("cs_reset_player_model", "cs_reset_player_model")
register_native("make_furien_visible", "make_furien_visible", 1);
register_native("get_antifuriens", "get_antifuriens", 1)
register_native("get_furiens", "get_furiens", 1)
register_native("special_primary", "special_primary", 1)
register_native("special_secondary", "special_secondary", 1)
register_native("have_special_primary", "have_special_primary", 1)
register_native("have_special_secondary", "have_special_secondary", 1)
register_native("ColorChat", "ColorChat", 1)
register_native("HudMessage", "native_hudmessage", 1)
}
#if defined ANTICAMP
public server_changelevel()
ChangeLevel = true;
#endif
public cs_set_player_model(id, const model[]) {
if (!is_user_connected(id)) {
log_error(AMX_ERR_NATIVE, "[CS] Player is not in game (%d)", id)
return false;
}
remove_task(id+TASKID_MODELCHANGE)
HasCustomModel[id] = true
copy(CustomPlayerModel[id], charsmax(CustomPlayerModel[]), model)
new ModelPath[32+(2*32)]
formatex(ModelPath, charsmax(ModelPath), "models/player/%s/%s.mdl", model, model)
CustomModelIndex[id] = engfunc(EngFunc_ModelIndex, ModelPath)
new CurrentModel[32]
fm_cs_get_user_model(id, CurrentModel, charsmax(CurrentModel))
if (!equal(CurrentModel, model))
fm_cs_user_model_update(id+TASKID_MODELCHANGE)
return true;
}
public cs_reset_player_model(id) {
if (!is_user_connected(id)) {
log_error(AMX_ERR_NATIVE, "[CS] Player is not in game (%d)", id)
return false;
}
if (!HasCustomModel[id])
return true;
remove_task(id+TASKID_MODELCHANGE)
HasCustomModel[id] = false
fm_cs_reset_user_model(id)
return true;
}
public make_furien_visible(id, Float:Time)
MakeVisible[id] = get_gametime() + Time
public get_antifuriens() {
new Players[32], Num;
get_players(Players, Num, "ache", "CT");
return Num
}
public get_furiens() {
new Players[32], Num;
get_players(Players, Num, "ache", "TRERORIST");
return Num
}
public special_primary(index, bool:yesno)
HaveSpecialPrimary[index] = yesno;
public special_secondary(index, bool:yesno)
HaveSpecialSecondary[index] = yesno;
public have_special_primary(index)
return HaveSpecialPrimary[index];
public have_special_secondary(index)
return HaveSpecialSecondary[index];
// Client
public client_putinserver(id) {
ShowMenu[id] = true
HavePrimaryWeapon[id] = false
HaveSecondaryWeapon[id] = false
PrimaryWeapon[id] = -1
SecondaryWeapon[id] = -1
HaveSpecialPrimary[id] = false
HaveSpecialSecondary[id] = false
Falling[id] = false
FlashLight[id] = false
FlashLightBattery[id] = 100
FlashLightTime[id] = 0.0
client_cmd(id, "bind f ^"impulse 100^"");
new Light[2]
if(!CanPlant)
get_pcvar_string(cvar_lights, Light, 1)
else if(MapHasBomb)
get_pcvar_string(cvar_lights_final, Light, 1)
engfunc(EngFunc_LightStyle, 0, Light)
}
public client_disconnect(id) {
ShowMenu[id] = true
NightVisionActive[id] = false
HasCustomModel[id] = false
remove_task(id+TASKID_MODELCHANGE)
}
// Events
public EVENT_TextMsg() {
new Players[32], Num;
get_players(Players, Num, "ch");
for(new id = 0; id <= Num; id++) {
HavePrimaryWeapon[Players[id]] = false
HaveSecondaryWeapon[Players[id]] = false
HaveSpecialPrimary[Players[id]] = false
HaveSpecialSecondary[Players[id]] = false
FlashLight[Players[id]] = false
FlashLightBattery[Players[id]] = 100
FlashLightTime[Players[id]] = 0.0
}
}
public EVENT_NewRound() {
ModelChangeTargetTime = get_gametime() + 0.01
new Player
for (Player = 1; Player <= get_maxplayers(); Player++) {
if (task_exists(Player+TASKID_MODELCHANGE)) {
remove_task(Player+TASKID_MODELCHANGE)
fm_cs_user_model_update(Player+TASKID_MODELCHANGE)
}
}
remove_task(TASKID_COUNTDOWN)
if(MapHasBomb)
remove_task(TASKID_C4COUNTDOWN)
remove_task(TASKID_CHECKCAMPING)
CanPlant = false;
HaveC4 = false
RoundTime = get_gametime() + get_cvar_float("mp_freezetime")
if(get_pcvar_num(cvar_auto_light)) {
new Light = _random(sizeof AutoLight)
set_pcvar_string(cvar_lights, AutoLight[Light])
}
if(get_pcvar_num(cvar_countdown)) {
if(get_cvar_num("mp_freezetime") && get_pcvar_num(cvar_countdown)) {
CountDownDelay = get_cvar_num("mp_freezetime");
TASK_CountDown();
}
}
}
public EVENT_CurWeapon(id) {
if(is_user_connected(id) && is_user_alive(id)) {
if(!(AMMOWP_NULL & (1<<read_data(2)))) {
if(fm_get_user_bpammo(id, read_data(2)) < WeaponsAmmo[read_data(2)][1])
fm_set_user_bpammo(id, read_data(2), WeaponsAmmo[read_data(2)][1])
}
}
}
public EVENT_SwitchTeam() {
remove_task(TASKID_SWITCHTEAM)
set_task(3.0, "TASK_SwitchTeam", TASKID_SWITCHTEAM);
if(MapHasBomb)
remove_task(TASKID_C4COUNTDOWN);
}
public LOGEVENT_BombSpawned() {
new LogUser[80], Name[32];
read_logargv(0, LogUser, 79);
parse_loguser(LogUser, Name, 31);
new id = get_user_index(Name);
engclient_cmd(id, "drop", "weapon_c4");
new Bomb = find_ent_by_class(-1, "weapon_c4");
if(Bomb)
remove_entity(Bomb);
}
public LOGEVENT_RoundStart() {
RoundEnded = false
#if defined ANTICAMP
if(MapHasBomb)
BombPlanted = false;
new Players[32], Num;
get_players(Players, Num, "ch");
for(new id = 0; id <= Num; id++) {
Meter[Players[id]] = 0;
CheckCampingTime[Players[id]] = 0;
}
set_task(0.5, "TASK_CheckCamping", TASKID_CHECKCAMPING, _, _, "b");
#endif
}
public LOGEVENT_RoundEnd() {
RoundEnded = true
remove_task(TASKID_CHECKCAMPING);
}
// Messages
public MSG_StatusIcon(msg_id, msg_dest, id) {
if(is_user_connected(id) && is_user_alive(id)) {
static Attrib
Attrib = get_msg_arg_int(2)
if(Attrib == (1<<1))
set_msg_arg_int(2, ARG_BYTE, 0)
new Icon[8];
get_msg_arg_string(2, Icon, 7);
if(equal(Icon, "buyzone")) {
set_pdata_int(id, OFFSET_BZ, get_pdata_int(id, OFFSET_BZ, 5) & ~(1 << 0), 5);
return PLUGIN_HANDLED;
}
}
return PLUGIN_CONTINUE;
}
public MSG_NVGToggle(msg_id, msg_dest, msg_entity)
return PLUGIN_HANDLED;
public MSG_SendAudio(msgid, dest, id) {
if(get_pcvar_num(cvar_winsounds)) {
new AudioCode[22]
get_msg_arg_string(2, AudioCode, 21)
if(equal(AudioCode[7], "terwin"))
set_msg_arg_string(2, FurienWinSounds[_random(sizeof FurienWinSounds)])
else if(equal(AudioCode[7], "ctwin"))
set_msg_arg_string(2, AntiFurienWinSounds[_random(sizeof AntiFurienWinSounds)])
else if(equal(AudioCode ,"%!MRAD_FIREINHOLE"))
return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE;
}
public MSG_Health(msgid, dest, id) {
if(get_msg_arg_int(1) > 255)
set_msg_arg_int(1, ARG_BYTE, 255)
}
public MSG_TextMsg(msgid, dest, id) {
static TxtMsg[25]
get_msg_arg_string(2, TxtMsg, 24)
if(equal(TxtMsg[1], "Terrorists_Win") || equal(TxtMsg, "#Target_Bombed")) {
new Message[32];
formatex(Message,sizeof(Message)-1,"%L", LANG_SERVER, "WIN_TXT_FURIENS");
HudMessage(0, Message, 255, 0, 0, -1.0, 0.40)
set_msg_arg_string(2, "")
return PLUGIN_HANDLED
}
else if(equal(TxtMsg[1], "CTs_Win") || equal(TxtMsg, "#Bomb_Defused") || equal(TxtMsg, "#Target_Saved")) {
new Message[32];
formatex(Message,sizeof(Message)-1,"%L", LANG_SERVER, "WIN_TXT_ANTIFURIENS");
HudMessage(0, Message, 255, 0, 0, -1.0, 0.40)
set_msg_arg_string(2, "")
return PLUGIN_HANDLED
}
else if(equal(TxtMsg, "#Game_bomb_drop")) {
new Message[32];
formatex(Message,sizeof(Message)-1,"Bomba a fost pierduta!");
HudMessage(0, Message, 255, 0, 0, -1.0, 0.40)
set_msg_arg_string(2, "")
return PLUGIN_HANDLED
}
else if(equal(TxtMsg, "#Game_bomb_pickup") || equal(TxtMsg, "#Got_bomb")) {
new Message[32];
formatex(Message,sizeof(Message)-1,"Bomba a fost recuperata!");
HudMessage(0, Message, 255, 0, 0, -1.0, 0.40)
set_msg_arg_string(2, "")
return PLUGIN_HANDLED
}
else if(equal(TxtMsg, "#Bomb_Planted")) {
new Message[32];
formatex(Message,sizeof(Message)-1,"Bomba a fost plantata!");
HudMessage(0, Message, 255, 0, 0, -1.0, 0.40)
set_msg_arg_string(2, "")
return PLUGIN_HANDLED
}
else if(equal(TxtMsg, "#Fire_in_the_hole")) {
set_msg_arg_string(5, "")
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
public MSG_WeapPickup(msgid, dest, id)
return get_user_team(id) == TEAM_FURIEN ? PLUGIN_HANDLED : PLUGIN_CONTINUE
public MSG_AmmoPickup(msgid, dest, id)
return get_user_team(id) == TEAM_FURIEN ? PLUGIN_HANDLED : PLUGIN_CONTINUE
/*
public MSG_ShowMenu(msgid, dest, id) {
if(is_user_connected(id) && !is_user_bot(id)) {
static MenuCode[32]
get_msg_arg_string(4, MenuCode, sizeof MenuCode - 1)
if(equal(MenuCode, "#Team_Select") || equal(MenuCode, "#Team_Select_Spect")) {
set_msg_block(msgid, BLOCK_SET)
engclient_cmd(id, "jointeam", "5")
engclient_cmd(id, "joinclass", "5")
set_msg_block(msgid, get_msg_block(msgid))
return PLUGIN_HANDLED
}
}
return PLUGIN_CONTINUE
}
public MSG_VGUIMenu(msgid, dest, id) {
if(is_user_connected(id) && !is_user_bot(id) && get_msg_arg_int(1) == 2) {
set_msg_block(msgid, BLOCK_SET)
engclient_cmd(id, "jointeam", "5")
engclient_cmd(id, "joinclass", "5")
set_msg_block(msgid, get_msg_block(msgid))
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
*/
// Fakemeta
public FWD_GameDescription() {
static GameName[32]
get_pcvar_string(cvar_gamedescription, GameName, 31)
forward_return(FMV_STRING, GameName)
return FMRES_SUPERCEDE
}
public FWD_SetClientKeyValue(id, const infobuffer[], const key[], const value[]) {
if(HasCustomModel[id] && equal(key, "model")) {
static CurrentModel[32]
fm_cs_get_user_model(id, CurrentModel, charsmax(CurrentModel))
if(!equal(CurrentModel, CustomPlayerModel[id]) && !task_exists(id+TASKID_MODELCHANGE))
fm_cs_set_user_model(id+TASKID_MODELCHANGE)
fm_cs_set_user_model_index(id)
return FMRES_SUPERCEDE;
}
return FMRES_IGNORED;
}
public FWD_AddToFullPack(es, e, ent, host, host_flags, player, p_set) {
if(is_user_connected(ent) && is_user_connected(host) && is_user_alive(ent)) {
if(is_user_alive(host) && get_user_team(ent) == 1 && get_user_team(host) == 1
|| !is_user_alive(host) && get_user_team(ent) == 1 && pev(host, pev_iuser2) == ent
|| get_user_team(ent) == 1 && pev(ent, pev_maxspeed) <= 1.0) {
set_es(es, ES_RenderFx, kRenderFxNone);
set_es(es, ES_RenderMode, kRenderTransTexture);
set_es(es, ES_RenderAmt, 255);
}
else if(get_user_team(ent) == 1) {
set_es(es, ES_RenderFx, kRenderFxNone);
set_es(es, ES_RenderMode, kRenderTransTexture);
static Float:Origin[3]
pev(ent, pev_origin, Origin)
if(get_user_weapon(ent) == CSW_KNIFE && MakeVisible[ent] < get_gametime() && fm_get_speed(ent) <= 5 || get_user_weapon(ent) == CSW_KNIFE && MakeVisible[ent] < get_gametime() && Origin[0] == Wallorigin[ent][0] && Origin[1] == Wallorigin[ent][1] && Origin[2] == Wallorigin[ent][2])
set_es(es, ES_RenderAmt, 0);
else
set_es(es, ES_RenderAmt, 255);
}
}
}
public FWD_PreThink(id) {
if(is_user_connected(id)) {
static Value[32]
engfunc(EngFunc_InfoKeyValue, engfunc(EngFunc_GetInfoKeyBuffer, id), "cl_minmodels", Value, sizeof Value - 1);
if(!equal(Value, "0"))
client_cmd(id, "cl_minmodels 0")
if(is_user_alive(id)) {
static Float:Origin[3]
static Float:Mins[3], Hull
static Float:Vec[3]
static i
pev(id, pev_origin, Origin)
Hull = pev(id, pev_flags) & FL_DUCKING ? HULL_HEAD : HULL_HUMAN
if(!is_hull_vacant(Origin, Hull, id) && !fm_get_user_noclip(id) && !(pev(id, pev_solid) & SOLID_NOT) && !(pev(id, pev_solid) & SOLID_TRIGGER)) {
++Stuck[id]
if(Stuck[id] >= 10) {
pev(id, pev_mins, Mins)
Vec[2] = Origin[2]
for (i = 0; i < sizeof Size; ++i) {
Vec[0] = Origin[0] - Mins[0] * Size[i][0]
Vec[1] = Origin[1] - Mins[1] * Size[i][1]
Vec[2] = Origin[2] - Mins[2] * Size[i][2]
if (is_hull_vacant(Vec, Hull, id)) {
engfunc(EngFunc_SetOrigin, id, Vec)
client_cmd(id,"spk fvox/blip.wav")
set_pev(id,pev_velocity,{0.0,0.0,0.0})
i = sizeof Size
}
}
}
}
else {
if(Stuck[id])
Stuck[id] = 0
}
if(get_pdata_int(id, 361) & ~(1<<3))
set_pdata_int(id, 361, get_pdata_int(id, 361) | (1<<3));
if(FlashLight[id] && FlashLightBattery[id]) {
if(FlashLightTime[id] <= get_gametime()) {
FlashLightTime[id] = get_gametime() + 0.5
FlashLightBattery[id]--
if(!FlashLightBattery[id])
FlashlightTurnOff(id)
else {
emessage_begin(MSG_ONE_UNRELIABLE, get_user_msgid("Flashlight"), _, id)
ewrite_byte(1)
ewrite_byte(FlashLightBattery[id])
emessage_end()
}
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("FlashBat"), _, id)
write_byte(FlashLightBattery[id])
message_end()
}
static Float:Start[3], Float:Aim[3], Float:Dist, Float:MaxDist
Get_StarEndPos(id, Start, Aim)
Dist = get_distance_f(Start, Aim)
MaxDist = get_pcvar_float(cvar_maxdistance)
if(Dist <= MaxDist) {
static Decay
Decay = floatround(Dist * 255.0 / MaxDist)
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_DLIGHT)
engfunc(EngFunc_WriteCoord, Aim[0])
engfunc(EngFunc_WriteCoord, Aim[1])
engfunc(EngFunc_WriteCoord, Aim[2])
write_byte(RADIUS)
write_byte(RED)
write_byte(GREEN)
write_byte(BLUE)
write_byte(LIFE)
write_byte(Decay)
message_end()
}
}
if(!CanPlant && MapHasBomb && !RoundEnded || CanPlant && !HaveC4 && MapHasBomb && !RoundEnded) {
if(cs_get_user_plant(id)) {
cs_set_user_plant(id, 0, 0);
message_begin(MSG_ALL, get_user_msgid("ScoreAttrib"), _, id)
write_byte(id)
write_byte(0)
message_end()
}
if((get_gametime() - RoundTime) > get_pcvar_float(cvar_final_time)) {
CanPlant = true;
new Players[32], Num;
get_players(Players, Num, "ache", "TRERORIST");
if(Num) {
new Player = Players[random_num(1, Num)];
new Name[32]
get_user_name(Player, Name, 31);
fm_give_item(Player, "weapon_c4")
cs_set_user_plant(Player, 1, 1)
message_begin(MSG_ALL, get_user_msgid("ScoreAttrib"), _, id)
write_byte(id)
write_byte((1<<1))
message_end()
HaveC4 = true
new Message[64];
formatex(Message,sizeof(Message)-1,"%s a primit C4 si poate distruge omenirea.", Name);
HudMessage(0, Message, 255, 0, 0, -1.0, 0.45);
}
}
else if(user_has_weapon(id, CSW_C4)) {
cs_set_user_plant(id, 0, 0)
bacon_strip_weapon(id, "weapon_c4");
message_begin(MSG_ALL, get_user_msgid("ScoreAttrib"), _, id)
write_byte(id)
write_byte(0)
message_end()
if(get_user_weapon(id) == CSW_KNIFE) {
#if defined FURIEN_KNIFE_V
set_pev(id, pev_viewmodel2, FURIEN_KNIFE_V);
#endif
#if defined FURIEN_KNIFE_P
set_pev(id, pev_weaponmodel2, FURIEN_KNIFE_P);
#endif
}
}
}
if(get_user_team(id) == TEAM_FURIEN) {
new _C4 = find_ent_by_model(-1, "weaponbox", "models/w_backpack.mdl")
if(is_valid_ent(_C4)) {
new Float:MyOrigin[3], Float:TargetOrigin[3]
entity_get_vector(id, EV_VEC_origin, MyOrigin)
entity_get_vector(_C4, EV_VEC_origin, TargetOrigin)
if(is_in_viewcone(id, TargetOrigin)) {
new Float:Middle[3], Float:HitPoint[3]
xs_vec_sub(TargetOrigin, MyOrigin, Middle)
trace_line(-1, MyOrigin, TargetOrigin, HitPoint)
new Float:WallOffset[3], Float:DistanceToWall
DistanceToWall = vector_distance(MyOrigin, HitPoint) - 10.0
new Float:Len = xs_vec_len(Middle)
xs_vec_copy(Middle, WallOffset)
WallOffset[0] /= Len, WallOffset[1] /= Len, WallOffset[2] /= Len
WallOffset[0] *= DistanceToWall, WallOffset[1] *= DistanceToWall, WallOffset[2] *= DistanceToWall
new Float:SpriteOffset[3]
xs_vec_add(WallOffset, MyOrigin, SpriteOffset)
message_begin(MSG_ONE, SVC_TEMPENTITY, _, id)
write_byte(TE_SPRITE)
write_coord(floatround(SpriteOffset[0]))
write_coord(floatround(SpriteOffset[1]))
write_coord(floatround(SpriteOffset[2]+36.0))
write_short(C4Sprite)
write_byte(floatround(2.5))
write_byte(50)
message_end()
}
}
static Weapon
Weapon = get_user_weapon(id)
if(Weapon) {
new WeaponName[32]
get_weaponname(Weapon, WeaponName, 31)
new WeaponID = get_weaponid(WeaponName)
if((PRIMARY_WEAPONS_BITSUM & (1<<WeaponID)) && !have_special_primary(id)
|| (SECONDARY_WEAPONS_BITSUM & (1<<WeaponID)) && !have_special_secondary(id)) {
bacon_strip_weapon(id, WeaponName);
if(get_user_weapon(id) == CSW_KNIFE) {
#if defined FURIEN_KNIFE_V
set_pev(id, pev_viewmodel2, FURIEN_KNIFE_V);
#endif
#if defined FURIEN_KNIFE_P
set_pev(id, pev_weaponmodel2, FURIEN_KNIFE_P);
#endif
}
}
}
if(!(pev(id, pev_flags) & FL_ONGROUND)) {
static Float:FallVelocity
pev(id, pev_flFallVelocity, FallVelocity)
Falling[id] = FallVelocity >= 350.0 ? true : false
}
if(pev(id, pev_gravity) > FURIEN_GRAVITY && pev(id, pev_gravity) > 0.1)
set_pev(id, pev_gravity, FURIEN_GRAVITY)
if(pev(id, pev_maxspeed) < FURIEN_SPEED && pev(id, pev_maxspeed) > 1.0)
set_pev(id, pev_maxspeed, FURIEN_SPEED)
}
if(!cs_get_user_nvg(id) && NightVisionActive[id])
NightVisionActive[id] = false
else if(NightVisionActive[id]) {
static Origin[3]
get_user_origin(id, Origin)
message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, _, id)
write_byte(TE_DLIGHT) // TE id
write_coord(Origin[0]) // x
write_coord(Origin[1]) // y
write_coord(Origin[2]) // z
write_byte(get_pcvar_num(cvar_nvg_radius)) // radius
if(get_user_team(id) == TEAM_FURIEN) {
write_byte(200) // r
write_byte(0) // g
write_byte(0) // b
}
else {
write_byte(0) // r
write_byte(200) // g
write_byte(0) // b
}
write_byte(1) // life
write_byte(0) // decay rate
message_end()
}
new Target, Body;
get_user_aiming(id, Target, Body);
if(is_user_alive(id) && is_user_connected(Target) && is_user_alive(Target)) {
new Name[32];
get_user_name(Target, Name, 31);
if(!task_exists(id + TASKID_HUDINFO)) {
new Message[128], Powers[64], Ultimate[64];
#if defined POWERS
if(get_user_next_level_xp(Target))
formatex(Powers,sizeof(Powers)-1,"^nLevel: %d | XP: %d/%d", get_user_level(Target), get_user_xp(Target), get_user_next_level_xp(Target));
else
formatex(Powers,sizeof(Powers)-1,"^nLevel: %d | XP: %d", get_user_level(Target), get_user_xp(Target));
#endif
#if defined ULTIMATES
formatex(Ultimate,sizeof(Ultimate)-1, "^nUltimate: None");
if(get_user_ultimate(Target) == 1)
formatex(Ultimate,sizeof(Ultimate)-1,"^nUltimate: Suicide Bomber");
else if(get_user_ultimate(Target) == 2)
formatex(Ultimate,sizeof(Ultimate)-1,"^nUltimate: Blink");
else if(get_user_ultimate(Target) == 3)
formatex(Ultimate,sizeof(Ultimate)-1,"^nUltimate: Chain Lightning");
else if(get_user_ultimate(Target) == 4)
formatex(Ultimate,sizeof(Ultimate)-1,"^nUltimate: Entangling Roots");
else if(get_user_ultimate(Target) == 5)
formatex(Ultimate,sizeof(Ultimate)-1,"^nUltimate: Immolate");
else if(get_user_ultimate(Target) == 6)
formatex(Ultimate,sizeof(Ultimate)-1,"^nUltimate: Big Bad Voodoo");
else if(get_user_ultimate(Target) == 7)
formatex(Ultimate,sizeof(Ultimate)-1,"^nUltimate: Vengeance");
else if(get_user_ultimate(Target) == 8)
formatex(Ultimate,sizeof(Ultimate)-1,"^nUltimate: Locust Swarm");
else if(get_user_ultimate(Target) == 9)
formatex(Ultimate,sizeof(Ultimate)-1,"^nUltimate: Ice Lightning");
#endif
formatex(Message,sizeof(Message)-1,"%s^nHP: %d | AP: %d%s%s", Name, get_user_health(Target), get_user_armor(Target), Powers, Ultimate);
switch(get_user_team(Target)) {
case TEAM_FURIEN: {
if(get_user_team(id) == TEAM_FURIEN)
HudMessage(id, Message, 200, 0, 0, -1.0, 0.60, _, _, 0.1)
}
case TEAM_ANTIFURIEN: {
HudMessage(id, Message, 0, 0, 200, -1.0, 0.60, _, _, 0.1)
}
}
set_task(0.3, "TASK_HudInfo", id + TASKID_HUDINFO);
}
}
}
}
}
#if defined PARACHUTE
public FWD_ParachutePreThink(id) {
if(is_user_alive(id)) {
new Float:FallSpeed = -50.0;
new Float:Frame;
new Button = pev(id, pev_button);
new OldButton = pev(id, pev_oldbuttons);
new Flags = pev(id, pev_flags);
if(ParaENT[id] > 0 &&(Flags & FL_ONGROUND)) {
if(pev(ParaENT[id],pev_sequence) != 2) {
set_pev(ParaENT[id], pev_sequence, 2);
set_pev(ParaENT[id], pev_gaitsequence, 1);
set_pev(ParaENT[id], pev_frame, 0.0);
set_pev(ParaENT[id], pev_fuser1, 0.0);
set_pev(ParaENT[id], pev_animtime, 0.0);
return;
}
pev(ParaENT[id],pev_fuser1, Frame);
Frame += 2.0;
set_pev(ParaENT[id],pev_fuser1,Frame);
set_pev(ParaENT[id],pev_frame,Frame);
if(Frame > 254.0) {
engfunc(EngFunc_RemoveEntity, ParaENT[id]);
ParaENT[id] = 0;
}
else {
engfunc(EngFunc_RemoveEntity, ParaENT[id]);
ParaENT[id] = 0;
}
return;
}
if(Button & IN_USE) {
new Float:Velocity[3];
pev(id, pev_velocity, Velocity);
if(Velocity[2] < 0.0) {
if(ParaENT[id] <= 0) {
ParaENT[id] = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"));
if(ParaENT[id] > 0) {
set_pev(ParaENT[id],pev_classname, PARACHUTE_CLASS);
set_pev(ParaENT[id], pev_aiment, id);
set_pev(ParaENT[id], pev_owner, id);
set_pev(ParaENT[id], pev_movetype, MOVETYPE_FLY);
if(get_user_team(id) == 1)
engfunc(EngFunc_SetModel, ParaENT[id], WingsModel);
else
engfunc(EngFunc_SetModel, ParaENT[id], ParachuteModel);
set_pev(ParaENT[id], pev_sequence, 0);
set_pev(ParaENT[id], pev_gaitsequence, 1);
set_pev(ParaENT[id], pev_frame, 0.0);
set_pev(ParaENT[id], pev_fuser1, 0.0);
}
}
if(ParaENT[id] > 0) {
set_pev(id, pev_sequence, 3);
set_pev(id, pev_gaitsequence, 1);
set_pev(id, pev_frame, 1.0);
set_pev(id, pev_framerate, 1.0);
Velocity[2] = (Velocity[2] + 40.0 < FallSpeed) ? Velocity[2] + 40.0 : FallSpeed;
set_pev(id, pev_velocity, Velocity);
if(pev(ParaENT[id],pev_sequence) == 0) {
pev(ParaENT[id],pev_fuser1, Frame);
Frame += 1.0;
set_pev(ParaENT[id],pev_fuser1,Frame);
set_pev(ParaENT[id],pev_frame,Frame);
if(Frame > 100.0) {
set_pev(ParaENT[id], pev_animtime, 0.0);
set_pev(ParaENT[id], pev_framerate, 0.4);
set_pev(ParaENT[id], pev_sequence, 1);
set_pev(ParaENT[id], pev_gaitsequence, 1);
set_pev(ParaENT[id], pev_frame, 0.0);
set_pev(ParaENT[id], pev_fuser1, 0.0);
}
}
}
}
else if(ParaENT[id] > 0) {
engfunc(EngFunc_RemoveEntity, ParaENT[id]);
ParaENT[id] = 0;
}
}
else if((OldButton & IN_USE) && ParaENT[id] > 0) {
engfunc(EngFunc_RemoveEntity, ParaENT[id]);
ParaENT[id] = 0;
}
}
}
#endif
#if defined LONGJUMP
public FWD_LongJumpPreThink(id) {
if(is_user_connected(id) && is_user_alive(id) && get_user_team(id) == TEAM_FURIEN) {
if((pev(id, pev_flags) & FL_ONGROUND) && fm_get_user_maxspeed(id) > 2.0 && fm_get_speed(id) > 83) {
if(!(pev(id, pev_button) &(IN_JUMP | IN_DUCK) == (IN_JUMP | IN_DUCK)))
return;
static Float:Velocity[3];
velocity_by_aim(id, floatround(FURIEN_SPEED) + 100, Velocity);
Velocity[2] = 450.0;
set_pev(id, pev_velocity, Velocity);
}
}
}
#endif
public FWD_Sound(id, channel, sample[], Float:volume, Float:attn, flag, pitch) {
if(is_user_connected(id) && get_user_team(id) == TEAM_FURIEN) {
if(sample[8] == 'k' && sample[9] == 'n' && sample[10] == 'i') {
if(sample[14] == 's' && sample[15] == 'l' && sample[16] == 'a') {
emit_sound(id, channel, FurienMissSounds[_random(sizeof FurienMissSounds)], volume, attn, flag, pitch)
return FMRES_SUPERCEDE
}
else if(sample[14] == 'h' && sample[15] == 'i' && sample[16] == 't' || sample[14] == 's' && sample[15] == 't' && sample[16] == 'a') {
if(sample[17] == 'w' && sample[18] == 'a' && sample[19] == 'l')
emit_sound(id, channel, FurienMissSounds[_random(sizeof FurienMissSounds)], volume, attn, flag, pitch)
else
emit_sound(id, channel, FurienHitSounds[_random(sizeof FurienHitSounds)], volume, attn, flag, pitch)
return FMRES_SUPERCEDE
}
}
else if(sample[7] == 'd' &&(sample[8] == 'i' && sample[9] == 'e' || sample[12] == '6')) {
emit_sound(id, channel, FurienDieSounds[_random(sizeof FurienDieSounds)], volume, attn, flag, pitch)
return FMRES_SUPERCEDE
}
}
return FMRES_IGNORED
}
public FMPrecacheEvent(const Type, const Name[]) {
for (new i; i < sizeof GunsEvents; ++i) {
if (equal (GunsEvents[i], Name)) {
GunsEventidsBitsum |= (1 << get_orig_retval())
return FMRES_HANDLED;
}
}
return FMRES_IGNORED;
}
public FMSpawn(ent) {
if(pev_valid(ent)) {
static Classname[32]
pev(ent, pev_classname, Classname, 31)
if(equal(Classname, "func_buyzone")) {
engfunc(EngFunc_RemoveEntity, ent)
return FMRES_SUPERCEDE
}
}
return FMRES_IGNORED
}
public FWD_PlaybackEvent (const Flags, const Invoker, const EventId) {
if((GunsEventidsBitsum & (1 << EventId)) && is_user_connected(Invoker) && is_user_alive(Invoker)) {
static ActiveWeaponIndex; ActiveWeaponIndex = get_pdata_cbase (Invoker, 373);
static VecOrigin[3];
pev(Invoker, pev_origin, VecOrigin);
engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, VecOrigin, 0)
write_byte(TE_DLIGHT);
engfunc(EngFunc_WriteCoord, VecOrigin[0]);
engfunc(EngFunc_WriteCoord, VecOrigin[1]);
engfunc(EngFunc_WriteCoord, VecOrigin[2]);
write_byte(GetWeaponSilen (ActiveWeaponIndex) ? floatround(14 * 0.5) : 14);
write_byte(255);
write_byte(150);
write_byte(15);
write_byte(8);
write_byte(60);
message_end();
return FMRES_HANDLED;
}
return FMRES_IGNORED;
}
public FWD_CmdStart(id, handle, seed) {
if(get_uc(handle, UC_Impulse) == 100) {
if(is_user_connected(id) && is_user_alive(id) && get_user_team(id) != TEAM_FURIEN) {
if(FlashLight[id])
FlashlightTurnOff(id)
else
FlashlightTurnOn(id)
}
set_uc(handle, UC_Impulse, 0)
return FMRES_SUPERCEDE
}
return FMRES_IGNORED
}
public FWD_CreateNamedEntity(entclassname) {
static Classname[10]
engfunc(EngFunc_SzFromIndex, entclassname, Classname, 9)
return(Classname[7] == 'c' && Classname[8] == '4') ? FMRES_SUPERCEDE : FMRES_IGNORED
}
public FWD_PostThink(id) {
if(is_user_alive(id)) {
if(get_user_team(id) == TEAM_FURIEN) {
if(Falling[id] && (pev(id, pev_flags) & FL_ONGROUND)) {
set_pev(id, pev_watertype, CONTENTS_WATER)
Falling[id] = false
}
static Float:Origin[3];
pev(id, pev_origin, Origin);
static Button ;
Button = pev(id, pev_button)
if(Button & IN_USE && get_distance_f(Origin, Wallorigin[id]) <= 5.0 && !(pev(id, pev_flags) & FL_ONGROUND)) {
new Float:Velocity[3];
new ClimbSpeed = floatround(pev(id, pev_maxspeed) / 2.0)
if(Button & IN_FORWARD) {
velocity_by_aim(id, ClimbSpeed, Velocity);
fm_set_user_velocity(id, Velocity);
}
else if(Button & IN_BACK) {
velocity_by_aim(id, -ClimbSpeed, Velocity);
fm_set_user_velocity(id, Velocity);
}
else {
set_pev(id, pev_origin, Wallorigin[id])
velocity_by_aim(id, 0, Velocity);
fm_set_user_velocity(id, Velocity);
}
}
}
}
}
// Hamsandwich
public HAM_Spawn_Post(id) {
if(is_user_connected(id)) {
client_cmd(id, "cl_forwardspeed 2000")
client_cmd(id, "cl_sidespeed 2000")
client_cmd(id, "cl_backspeed 2000")
client_cmd(id, "cl_upspeed 2000")
HavePrimaryWeapon[id] = false
HaveSecondaryWeapon[id] = false
Falling[id] = false
cs_reset_player_model(id)
fm_strip_user_weapons(id);
fm_set_user_nvg(id, 1)
bacon_give_weapon(id, "weapon_knife");
for(new i = 0; i < sizeof Grenades; ++i)
bacon_give_weapon(id, Grenades[i]);
switch(get_user_team(id)) {
case TEAM_FURIEN: {
make_furien_visible(id, 0.0)
#if defined FURIEN_MODEL
cs_set_player_model(id, FURIEN_MODEL);
#endif
#if defined PARACHUTE
ColorChat(id, "!t[Fuiren]!g Pentru a folosi Wings apasa tasta!t E");
#endif
#if defined LONGJUMP
ColorChat(id, "!t[Fuiren]!g Pentru a folosi LongJump apasa!t Ctrl + Space");
#endif
ColorChat(id, "!t[Fuiren]!g Pentru a te catara pe perete tine apasat:!t E + W sau S");
}
case TEAM_ANTIFURIEN: {
#if defined PARACHUTE
ColorChat(id, "!t[Fuiren]!g Pentru a folosi Parachute apasa tasta!t E");
#endif
#if defined ANTIFURIEN_MODEL
cs_set_player_model(id, ANTIFURIEN_MODEL);
#endif
if(ShowMenu[id])
Equipment(id)
else
GiveLastWeapons(id)
}
}
}
}
public HAM_Touch_Weapon(ent, id) {
if(is_user_alive(id) && get_user_team(id) == TEAM_FURIEN && !(get_pdata_cbase(ent, 39, 4) > 0))
return HAM_SUPERCEDE
return HAM_IGNORED
}
public HAM_Use_Tank(ent, caller, activator, use_type, Float:value)
return(is_user_alive(caller) && get_user_team(caller) == TEAM_FURIEN) ? HAM_SUPERCEDE : HAM_IGNORED
public HAM_Use_Pushable(ent, caller, activator, use_type, Float:value)
return HAM_SUPERCEDE
public HAM_Killed_Player(victim, killer, shouldgib) {
if(is_user_connected(victim))
FlashlightTurnOff(victim)
if(is_user_alive(killer) && is_user_connected(victim) && victim != killer && get_user_team(killer) != get_user_team(victim)) {
if(!user_has_weapon(killer, CSW_HEGRENADE))
bacon_give_weapon(killer, "weapon_hegrenade");
else if(user_has_weapon(killer, CSW_HEGRENADE))
fm_set_user_bpammo(killer, CSW_HEGRENADE, fm_get_user_bpammo(killer, CSW_HEGRENADE) + 1);
}
}
public HAM_Player_Touch(id, world) {
if(is_user_alive(id) && get_user_team(id) == TEAM_FURIEN) {
new ClassName[32];
pev(world, pev_classname, ClassName,(32-1));
if(equal(ClassName, "worldspawn") || equal(ClassName, "func_wall") || equal(ClassName, "func_breakable"))
pev(id, pev_origin, Wallorigin[id]);
}
return HAM_SUPERCEDE
}
public HAM_Knife_Deploy_Post(Weapon) {
if(pev_valid(Weapon)) {
new Owner = get_pdata_cbase(Weapon, 41, 4);
if(is_user_alive(Owner) && get_user_team(Owner) == TEAM_FURIEN) {
#if defined FURIEN_KNIFE_V
set_pev(Owner, pev_viewmodel2, FURIEN_KNIFE_V);
#endif
#if defined FURIEN_KNIFE_P
set_pev(Owner, pev_weaponmodel2, FURIEN_KNIFE_P);
#endif
}
}
}
public HAM_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type) {
if(is_user_alive(victim)) {
#if defined ANTICAMP
Meter[victim] = 0
#endif
make_furien_visible(victim, 1.0)
}
if(is_user_alive(attacker)) {
#if defined ANTICAMP
Meter[attacker] = 0;
#endif
}
}
public HAM_Hostage_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type) {
new ClassName[32];
pev(victim, pev_classname, ClassName, 31);
if(equal(ClassName, "hostage_entity")) {
SetHamParamFloat(4, 0.0)
return HAM_SUPERCEDE;
}
return HAM_IGNORED;
}
// CSX
public bomb_planted(planter) {
#if defined ANTICAMP
BombPlanted = true;
#endif
C4_CountDownDelay = get_cvar_num("mp_c4timer") - 1
TASK_C4_CountDown();
}
public bomb_defused(defuser) {
#if defined ANTICAMP
BombPlanted = false;
#endif
remove_task(TASKID_C4COUNTDOWN);
}
public bomb_explode(planter,defuser) {
#if defined ANTICAMP
BombPlanted = false;
#endif
remove_task(TASKID_C4COUNTDOWN);
}
public grenade_throw(id, gid, wid) {
new Red, Green, Blue
switch(wid) {
case CSW_HEGRENADE:
Red=255, Green=0, Blue=0;
case CSW_FLASHBANG:
Red=0, Green=0, Blue=255;
case CSW_SMOKEGRENADE:
Red=0, Green=255, Blue=0;
}
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_BEAMFOLLOW)
write_short(gid)
write_short(GrenadeTrail)
write_byte(5)
write_byte(5)
write_byte(Red)
write_byte(Green)
write_byte(Blue)
write_byte(200)
message_end()
}
// Task
public TASK_HUD() {
new Players[32], Num;
get_players(Players, Num, "ch");
for(new index = 0; index <= Num; index++) {
new id = Players[index]
if(is_user_alive(id)) {
new Message[128], Powers[64], Ultimate[64];
#if defined POWERS
if(get_user_next_level_xp(id))
formatex(Powers,sizeof(Powers)-1,"^nLevel: %d XP: %d/%d", get_user_level(id), get_user_xp(id), get_user_next_level_xp(id));
else
formatex(Powers,sizeof(Powers)-1,"^nLevel: %d XP: %d", get_user_level(id), get_user_xp(id));
#endif
#if defined ULTIMATES
formatex(Ultimate,sizeof(Ultimate)-1, "^nUltimate: None");
if(get_user_ultimate(id) == 1)
formatex(Ultimate,sizeof(Ultimate)-1,"^nUltimate: Suicide Bomber");
else if(get_user_ultimate(id) == 2)
formatex(Ultimate,sizeof(Ultimate)-1,"^nUltimate: Blink");
else if(get_user_ultimate(id) == 3)
formatex(Ultimate,sizeof(Ultimate)-1,"^nUltimate: Chain Lightning");
else if(get_user_ultimate(id) == 4)
formatex(Ultimate,sizeof(Ultimate)-1,"^nUltimate: Entangling Roots");
else if(get_user_ultimate(id) == 5)
formatex(Ultimate,sizeof(Ultimate)-1,"^nUltimate: Immolate");
else if(get_user_ultimate(id) == 6)
formatex(Ultimate,sizeof(Ultimate)-1,"^nUltimate: Big Bad Voodoo");
else if(get_user_ultimate(id) == 7)
formatex(Ultimate,sizeof(Ultimate)-1,"^nUltimate: Vengeance");
else if(get_user_ultimate(id) == 8)
formatex(Ultimate,sizeof(Ultimate)-1,"^nUltimate: Locust Swarm");
else if(get_user_ultimate(id) == 9)
formatex(Ultimate,sizeof(Ultimate)-1,"^nUltimate: Ice Lightning");
#endif
formatex(Message,sizeof(Message)-1,"Health: %d Armor: %d%s%s", get_user_health(id), get_user_armor(id), Powers, Ultimate);
HudMessage(id, Message, 200, 100, 0, 0.02, 0.95, _, _, 0.5)
}
new Spectators[32], SpecNum;
get_players(Players, SpecNum, "bch");
for(new i = 0; i < SpecNum; i++) {
new Spectator = Spectators[i];
if(!is_user_alive(Spectator) && pev(Spectator, pev_iuser2) == id && is_user_connected(Spectator) && id != Spectator) {
new Name[32], Message[128], Powers[64], Ultimate[64];
get_user_name(id, Name, 31);
#if defined POWERS
if(get_user_next_level_xp(id))
formatex(Powers,sizeof(Powers)-1,"^nLevel: %d XP: %d/%d", get_user_level(id), get_user_xp(id), get_user_next_level_xp(id));
else
formatex(Powers,sizeof(Powers)-1,"^nLevel: %d XP: %d", get_user_level(id), get_user_xp(id));
#endif
#if defined ULTIMATES
formatex(Ultimate,sizeof(Ultimate)-1, "^nUltimate: None");
if(get_user_ultimate(id) == 1)
formatex(Ultimate,sizeof(Ultimate)-1,"^nUltimate: Suicide Bomber");
else if(get_user_ultimate(id) == 2)
formatex(Ultimate,sizeof(Ultimate)-1,"^nUltimate: Blink");
else if(get_user_ultimate(id) == 3)
formatex(Ultimate,sizeof(Ultimate)-1,"^nUltimate: Chain Lightning");
else if(get_user_ultimate(id) == 4)
formatex(Ultimate,sizeof(Ultimate)-1,"^nUltimate: Entangling Roots");
else if(get_user_ultimate(id) == 5)
formatex(Ultimate,sizeof(Ultimate)-1,"^nUltimate: Immolate");
else if(get_user_ultimate(id) == 6)
formatex(Ultimate,sizeof(Ultimate)-1,"^nUltimate: Big Bad Voodoo");
else if(get_user_ultimate(id) == 7)
formatex(Ultimate,sizeof(Ultimate)-1,"^nUltimate: Vengeance");
else if(get_user_ultimate(id) == 8)
formatex(Ultimate,sizeof(Ultimate)-1,"^nUltimate: Locust Swarm");
else if(get_user_ultimate(id) == 9)
formatex(Ultimate,sizeof(Ultimate)-1,"^nUltimate: Ice Lightning");
#endif
formatex(Message,sizeof(Message)-1,"%s^nHealth: %d Armor: %d%s%s", Name, get_user_health(id), get_user_armor(id), Powers, Ultimate);
HudMessage(Spectator, Message, 200, 100, 0, 0.02, 0.90, _, _, 0.5)
}
}
}
}
public TASK_HudInfo(id) {
id -= TASKID_HUDINFO;
new Target, Body;
get_user_aiming(id, Target, Body);
if(is_user_connected(Target) && is_user_alive(Target) && is_user_alive(id)) {
new Message[128], Powers[64], Ultimate[64], Name[32];
get_user_name(Target, Name, 31);
#if defined POWERS
if(get_user_next_level_xp(Target))
formatex(Powers,sizeof(Powers)-1,"^nLevel: %d | XP: %d/%d", get_user_level(Target), get_user_xp(Target), get_user_next_level_xp(Target));
else
formatex(Powers,sizeof(Powers)-1,"^nLevel: %d | XP: %d", get_user_level(Target), get_user_xp(Target));
#endif
#if defined ULTIMATES
formatex(Ultimate,sizeof(Ultimate)-1, "^nUltimate: None");
if(get_user_ultimate(Target) == 1)
formatex(Ultimate,sizeof(Ultimate)-1,"^nUltimate: Suicide Bomber");
else if(get_user_ultimate(Target) == 2)
formatex(Ultimate,sizeof(Ultimate)-1,"^nUltimate: Blink");
else if(get_user_ultimate(Target) == 3)
formatex(Ultimate,sizeof(Ultimate)-1,"^nUltimate: Chain Lightning");
else if(get_user_ultimate(Target) == 4)
formatex(Ultimate,sizeof(Ultimate)-1,"^nUltimate: Entangling Roots");
else if(get_user_ultimate(Target) == 5)
formatex(Ultimate,sizeof(Ultimate)-1,"^nUltimate: Immolate");
else if(get_user_ultimate(Target) == 6)
formatex(Ultimate,sizeof(Ultimate)-1,"^nUltimate: Big Bad Voodoo");
else if(get_user_ultimate(Target) == 7)
formatex(Ultimate,sizeof(Ultimate)-1,"^nUltimate: Vengeance");
else if(get_user_ultimate(Target) == 8)
formatex(Ultimate,sizeof(Ultimate)-1,"^nUltimate: Locust Swarm");
else if(get_user_ultimate(Target) == 9)
formatex(Ultimate,sizeof(Ultimate)-1,"^nUltimate: Ice Lightning");
#endif
formatex(Message,sizeof(Message)-1,"%s^nHP: %d | AP: %d%s%s", Name, get_user_health(Target), get_user_armor(Target), Powers, Ultimate);
switch(get_user_team(Target)) {
case TEAM_FURIEN: {
if(get_user_team(id) == TEAM_FURIEN)
HudMessage(id, Message, 200, 0, 0, -1.0, 0.60, _, _, 0.1)
}
case TEAM_ANTIFURIEN: {
HudMessage(id, Message, 0, 0, 200, -1.0, 0.60, _, _, 0.1)
}
}
}
}
public TASK_Light() {
static Light[2]
if(!CanPlant) {
get_pcvar_string(cvar_lights, Light, 1)
}
else if(MapHasBomb) {
get_pcvar_string(cvar_lights_final, Light, 1)
}
engfunc(EngFunc_LightStyle, 0, Light)
if(get_pcvar_num(cvar_fog))
CreateFog()
}
public TASK_CountDown() {
new Players[32], Num;
get_players(Players, Num, "ch");
for(new index = 0 ; index < Num ; index++) {
new id = Players[index]
if(CountDownDelay > sizeof CountDownSounds) {
CountDownDelay--;
new Message[64];
formatex(Message,sizeof(Message)-1,"%L",LANG_PLAYER, "COUNTDOWN_HUD", CountDownDelay, CountDownDelay == 1 ? "e" : "a");
HudMessage(id, Message, 179, 0, 0, -1.0, 0.28, _, _, 1.0)
set_task(1.0, "TASK_CountDown", TASKID_COUNTDOWN);
}
else if(CountDownDelay > 1) {
CountDownDelay--;
new Message[64], Color[3], Shock[3]
Color[0] = 100; Color[1] = 000; Color[2] = 000
Shock[0] = 3; Shock[1] = 2; Shock[2] = 3
formatex(Message,sizeof(Message)-1,"%L",LANG_PLAYER, "COUNTDOWN_HUD", CountDownDelay, CountDownDelay == 1 ? "e" : "a");
HudMessage(id, Message, 179, 0, 0, -1.0, 0.28, _, _, 1.0)
emit_sound(id, CHAN_VOICE, CountDownSounds[CountDownDelay-1], VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
UTIL_ScreenFade(id, Color, 0.5, 0.5, 125)
message_begin(MSG_ONE, get_user_msgid("ScreenShake"), _, id)
write_short((1<<12)*Shock[0])
write_short((1<<12)*Shock[1])
write_short((1<<12)*Shock[2])
message_end()
set_task(1.0, "TASK_CountDown", TASKID_COUNTDOWN);
}
else if(CountDownDelay <= 1) {
CountDownDelay = 0;
new Message[64], Color[3], Shock[3]
Color[0] = 100; Color[1] = 000; Color[2] = 000
Shock[0] = 3; Shock[1] = 2; Shock[2] = 3
formatex(Message,sizeof(Message)-1,"%L",LANG_PLAYER, "COUNTDOWN_START_HUD");
HudMessage(id, Message, 179, 0, 0, -1.0, 0.28, _, _, 1.0)
emit_sound(id, CHAN_VOICE, CountDownFinalSounds[_random(sizeof CountDownFinalSounds)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
UTIL_ScreenFade(id, Color, 0.5, 0.5, 125)
message_begin(MSG_ONE, get_user_msgid("ScreenShake"), _, id)
write_short((1<<12)*Shock[0])
write_short((1<<12)*Shock[1])
write_short((1<<12)*Shock[2])
message_end()
}
}
}
public TASK_SwitchTeam() {
if(get_pcvar_num(cvar_switchteam)) {
new Players[32], Num;
get_players(Players, Num, "ch");
for(new index = 0 ; index < Num ; index++) {
new id = Players[index]
if(get_user_team(id) == TEAM_FURIEN)
cs_set_user_team(id, CS_TEAM_CT)
else if(get_user_team(id) == TEAM_ANTIFURIEN)
cs_set_user_team(id, CS_TEAM_T)
}
}
}
public TASK_C4_CountDown() {
new Red, Green, Blue
if(C4_CountDownDelay > 10)
Red = 0, Green = 255, Blue = 0;
else if(C4_CountDownDelay > 5)
Red = 255, Green = 200, Blue = 0;
else if(C4_CountDownDelay <= 5)
Red = 255, Green = 0, Blue = 0;
if(C4_CountDownDelay) {
new Message[64];
formatex(Message,sizeof(Message)-1,"C4: %d", C4_CountDownDelay);
HudMessage(0, Message, Red, Green, Blue, -1.0, 0.95, _, _, 1.0)
set_task(1.0, "TASK_C4_CountDown", TASKID_C4COUNTDOWN);
if(C4_CountDownDelay <= 5)
emit_sound(0, CHAN_VOICE, CountDownSounds[C4_CountDownDelay - 1], VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
C4_CountDownDelay--;
new _C4 = find_ent_by_model(-1, "grenade", "models/w_c4.mdl")
if(is_valid_ent(_C4)) {
new Float:Origin[3]
pev(_C4, pev_origin, Origin)
engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, Origin, 0)
write_byte(TE_BEAMCYLINDER)
engfunc(EngFunc_WriteCoord,Origin[0]) // center position(X)
engfunc(EngFunc_WriteCoord,Origin[1]) // center position(Y)
engfunc(EngFunc_WriteCoord,Origin[2]) // center position(Z)
engfunc(EngFunc_WriteCoord,Origin[0]) // axis and radius(X)
engfunc(EngFunc_WriteCoord,Origin[1]) // axis and radius(Y)
engfunc(EngFunc_WriteCoord,Origin[2] + 125)// axis and radius(Z)
write_short(C4SpriteCircle) // sprite index
write_byte(0) // starting frame
write_byte(1) // frame rate in 0.1's
write_byte(6) // life in 0.1's
write_byte(8) // line width in 0.1's
write_byte(1) // noise amplitude in 0.01's
write_byte(Red) // color(red)
write_byte(Green) // color(green)
write_byte(Blue) // color(blue)
write_byte(128) // brightness
write_byte(5) // scroll speed in 0.1's
message_end()
}
}
else if(!C4_CountDownDelay)
C4_CountDownDelay = 0;
}
#if defined ANTICAMP
public TASK_CheckCamping() {
new Players[32], Num;
get_players(Players, Num, "ach");
if(Num <= 1 || BombPlanted || get_cvar_float("mp_timelimit") && !get_timeleft() || ChangeLevel)
return;
for(new index = 0; index < Num; ++index) {
new id = Players[index];
new PrevMeter, bool:PunishCamper;
if(get_user_team(id) == 2 && !(get_user_flags(id) & ADMIN_IMMUNITY) && pev(id, pev_maxspeed) > 1.0) {
coords_insert(id, 0);
CheckCampingTime[id] ++
if(CheckCampingTime[id] > 2) {
StandardDeviation[id] = coords_standard_deviation(id);
CheckCampingTime[id] = 0
}
PrevMeter = Meter[id];
Meter[id] += ((100 - StandardDeviation[id]) / get_pcvar_num(cvar_camp_limit));
Meter[id] = clamp(Meter[id], 0, 100);
if(Meter[id] < PrevMeter && Meter[id] < 80)
Meter[id] -= (PrevMeter - Meter[id]) / 3;
(Meter[id] >= 100) ? (PunishCamper = true) : (PunishCamper = false)
if(PunishCamper) {
user_silentkill(id);
ColorChat(id, "!gAi primit!t Slay!g pentru!t Camp!");
}
if(Meter[id]) {
new r, g, b;
if(Meter[id] > 90)
r = 255;
else if(Meter[id] > 80)
r = 255, g = 100;
else if(Meter[id] > 60)
r = 255, g = 255;
else if(Meter[id] > 50)
g = 255;
else
b = 255;
new Message[64];
formatex(Message,sizeof(Message)-1,"CAMP: %i%%", Meter[id]);
HudMessage(id, Message, r, g, b, -1.0, 0.85, _, _, 0.5);
new Players[32], Num, Spectator;
get_players(Players, Num, "bch");
for(new index = 0; index < Num; ++index) {
Spectator = Players[index];
if(pev(Spectator, pev_iuser2) == id) {
new Message[64];
formatex(Message,sizeof(Message)-1,"CAMP: %i%%", Meter[id]);
HudMessage(Spectator, Message, r, g, b, -1.0, 0.85, _, _, 0.5);
}
}
}
}
}
}
#endif
// Commands
public CMD_JoinTeam(id) {
if(get_user_team(id) != 3) {
console_print(id,"Nu ai voie sa folosesti JoinTeam !");
return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE;
}
public CMD_Guns(id) {
if(get_pcvar_num(cvar_weaponsmenu)) {
if(!ShowMenu[id]) {
ShowMenu[id] = true
ColorChat(id, "%L", id, "MENU_REENABLED");
}
if(!HavePrimaryWeapon[id] && !HaveSecondaryWeapon[id])
Equipment(id)
}
return PLUGIN_CONTINUE;
}
public CMD_Nightvision(id) {
if(cs_get_user_nvg(id)) {
if(!NightVisionActive[id])
NightVisionActive[id] = true
else
NightVisionActive[id] = false
return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE;
}
// Menu's
public BuyBattery(id) {
if(is_user_alive(id) && !FlashLightBattery[id] && get_user_team(id) == TEAM_ANTIFURIEN) {
new Title[64];
#if defined GOLD_SISTEM
formatex(Title, sizeof(Title) - 1, "\\rBuy Battery\\w -\\y $%i\\r ?", get_pcvar_num(cvar_batterycost));
#else
formatex(Title, sizeof(Title) - 1, "\\rBuy Battery\\w -\\y %i Gold\\r ?", get_pcvar_num(cvar_batterycost));
#endif
new Menu = menu_create(Title, "BuyBatteryCmd");
menu_additem(Menu, "\\yYes", "1", 0);
menu_additem(Menu, "\\yNo", "2", 0);
menu_setprop(Menu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, Menu, 0);
}
}
public BuyBatteryCmd(id, menu, item) {
if(item == MENU_EXIT) {
menu_destroy(menu);
return PLUGIN_HANDLED;
}
new Data[6], Name[64];
new access, CallBack;
menu_item_getinfo(menu, item, access, Data,5, Name, 63, CallBack);
new Key = str_to_num(Data);
if(Key == 1 && !FlashLightBattery[id] && is_user_alive(id) && get_user_team(id) == TEAM_ANTIFURIEN) {
if(cs_get_user_money(id) < get_pcvar_num(cvar_batterycost))
ColorChat(id, "^x03[Biohazard]^x04 Nu ai suficienti bani pentru a cumpara^x03 Battery^x04. Necesari:^x03 %i$", get_pcvar_num(cvar_batterycost));
else if(!FlashLightBattery[id]) {
#if defined GOLD_SISTEM
set_user_gold(id, get_user_gold(id) - get_pcvar_num(cvar_batterycost));
#else
cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(cvar_batterycost));
#endif
ColorChat(id, "^x03[Biohazard]^x04 Ai cumparat^x03 Battery^x04.Pentru utilizare apasa tasta^x03 F.");
emit_sound(id,CHAN_ITEM,SOUND_FLASHLIGHT_ON,VOL_NORM,ATTN_NORM,0,PITCH_NORM);
FlashLightBattery[id] = 100;
FlashlightTurnOn(id)
}
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}
public Equipment(id) {
if(is_user_alive(id) && get_user_team(id) == TEAM_ANTIFURIEN && get_pcvar_num(cvar_weaponsmenu)) {
if(HavePrimaryWeapon[id] && HaveSecondaryWeapon[id]) {
for(new i = 0; i < sizeof Grenades; ++i)
bacon_give_weapon(id, Grenades[i]);
}
else if(!HavePrimaryWeapon[id] && !HaveSecondaryWeapon[id]) {
new Title[16], NewWPN[16], PrevWPN[16], DontShow[16];
formatex(Title,sizeof(Title)-1,"\\r%L", id, "MENU_TITLE1");
formatex(NewWPN,sizeof(NewWPN)-1,"\\w%L", id, "MENU_NEWWEAPONS");
if(PrimaryWeapon[id] >= 0 && SecondaryWeapon[id] >= 0) {
formatex(PrevWPN,sizeof(PrevWPN)-1,"\\w%L", id, "MENU_PREVSETUP");
formatex(DontShow,sizeof(DontShow)-1,"\\w%L", id, "MENU_DONTSHOW");
}
else {
formatex(PrevWPN,sizeof(PrevWPN)-1,"\\d%L", id, "MENU_PREVSETUP");
formatex(DontShow,sizeof(DontShow)-1,"\\d%L", id, "MENU_DONTSHOW");
}
Menu = menu_create(Title, "EquipmentCmd");
menu_additem(Menu, NewWPN, "1", 0);
menu_additem(Menu, PrevWPN, "2", 0);
menu_additem(Menu, DontShow, "3", 0);
menu_setprop(Menu, MPROP_EXIT, MEXIT_NEVER)
menu_display(id, Menu, 0);
}
}
}
public EquipmentCmd(id, menu, item) {
if(!is_user_alive(id) || get_user_team(id) == TEAM_FURIEN || !get_pcvar_num(cvar_weaponsmenu)) {
menu_destroy(menu);
return PLUGIN_HANDLED;
}
else if(item == MENU_EXIT) {
Equipment(id)
return PLUGIN_HANDLED;
}
new Data[6], Name[64];
new access, callback;
menu_item_getinfo(menu, item, access, Data,5, Name, 63, callback);
new Key = str_to_num(Data);
switch(Key) {
case 1: {
if(!HavePrimaryWeapon[id] && !HaveSpecialPrimary[id])
NewWeapons(id, 0)
else if(HaveSecondaryWeapon[id] && !HaveSpecialSecondary[id])
NewWeapons(id, 1)
}
case 2:
GiveLastWeapons(id)
case 3: {
if(PrimaryWeapon[id] >= 0 && SecondaryWeapon[id] >= 0)
ShowMenu[id] = false
GiveLastWeapons(id)
}
default: return PLUGIN_HANDLED;
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}
public NewWeapons(id, type) {
if(is_user_alive(id) && get_user_team(id) == TEAM_ANTIFURIEN && get_pcvar_num(cvar_weaponsmenu)) {
for(new i = 0; i < sizeof Grenades; ++i)
bacon_give_weapon(id, Grenades[i]);
new Title[64];
formatex(Title,sizeof(Title)-1,"\\r%L", id, type ? "MENU_TITLE3" : "MENU_TITLE2");
Menu = menu_create(Title, type ? "SecondaryCmd" : "PrimaryCmd");
new GunsNum = (!type ? sizeof PrimaryWeapons : sizeof SecondaryWeapons)
for(new i = 0; i < GunsNum; ++i) {
new WeaponName[64], WeaponNum[64];
formatex(WeaponName,sizeof(WeaponName)-1,"\\w%s", !type ? PrimaryWeapons[i][0] : SecondaryWeapons[i][0]);
formatex(WeaponNum,sizeof(WeaponNum)-1,"%d", i);
menu_additem(Menu, WeaponName, WeaponNum, 0);
}
menu_setprop(Menu, MPROP_EXIT, MEXIT_NEVER)
menu_display(id, Menu, 0);
}
}
public PrimaryCmd(id, menu, item) {
if(!is_user_alive(id) || get_user_team(id) == TEAM_FURIEN || !get_pcvar_num(cvar_weaponsmenu)) {
menu_destroy(menu);
return PLUGIN_HANDLED;
}
else if(item == MENU_EXIT) {
NewWeapons(id, 0)
return PLUGIN_HANDLED;
}
new Data[6], Name[64];
new access, callback;
menu_item_getinfo(menu, item, access, Data,5, Name, 63, callback);
new Key = str_to_num(Data);
new LastPrimary = get_pdata_cbase(id, 368)
if(pev_valid(LastPrimary)) {
new CurrentPrimary = get_pdata_int(LastPrimary, 43, 4)
if(CurrentPrimary != get_weaponid(PrimaryWeapons[Key][1])) {
new WeaponName[32]
get_weaponname(CurrentPrimary, WeaponName, 31)
bacon_strip_weapon(id, WeaponName)
}
}
bacon_give_weapon(id, PrimaryWeapons[Key][1]);
cs_set_user_bpammo(id, get_weaponid(PrimaryWeapons[Key][1]), WeaponsAmmo[get_weaponid(PrimaryWeapons[Key][1])][1])
PrimaryWeapon[id] = Key;
HavePrimaryWeapon[id] = true;
NewWeapons(id, 1);
menu_destroy(menu);
return PLUGIN_HANDLED;
}
public SecondaryCmd(id, menu, item) {
if(!is_user_alive(id) || get_user_team(id) == TEAM_FURIEN || !!get_pcvar_num(cvar_weaponsmenu)) {
menu_destroy(menu);
return PLUGIN_HANDLED;
}
if(item == MENU_EXIT) {
NewWeapons(id, 1)
return PLUGIN_HANDLED;
}
new Data[6], Name[64];
new access, callback;
menu_item_getinfo(menu, item, access, Data,5, Name, 63, callback);
new Key = str_to_num(Data);
new LastSecondary = get_pdata_cbase(id, 368)
if(pev_valid(LastSecondary)) {
new CurrentSecondary = get_pdata_int(LastSecondary, 43, 4)
if(CurrentSecondary != get_weaponid(SecondaryWeapons[Key][1])) {
new WeaponName[32]
get_weaponname(CurrentSecondary, WeaponName, 31)
bacon_strip_weapon(id, WeaponName)
}
}
bacon_give_weapon(id, SecondaryWeapons[Key][1]);
cs_set_user_bpammo(id, get_weaponid(SecondaryWeapons[Key][1]), WeaponsAmmo[get_weaponid(SecondaryWeapons[Key][1])][1])
SecondaryWeapon[id] = Key;
HaveSecondaryWeapon[id] = true;
menu_destroy(menu);
return PLUGIN_HANDLED;
}
// Others
public fm_cs_set_user_model(id) {
id -= TASKID_MODELCHANGE
set_user_info(id, "model", CustomPlayerModel[id])
}
public GiveLastWeapons(id) {
if(PrimaryWeapon[id] >= 0 && SecondaryWeapon[id] >= 0) {
if(!HaveSpecialPrimary[id]) {
new LastPrimary = get_pdata_cbase(id, 368)
if(pev_valid(LastPrimary)) {
new CurrentPrimary = get_pdata_int(LastPrimary, 43, 4)
if(CurrentPrimary != get_weaponid(PrimaryWeapons[PrimaryWeapon[id]][1])) {
new WeaponName[32]
get_weaponname(CurrentPrimary, WeaponName, 31)
bacon_strip_weapon(id, WeaponName)
}
}
bacon_give_weapon(id, PrimaryWeapons[PrimaryWeapon[id]][1]);
cs_set_user_bpammo(id, get_weaponid(PrimaryWeapons[PrimaryWeapon[id]][1]), WeaponsAmmo[get_weaponid(PrimaryWeapons[PrimaryWeapon[id]][1])][1])
}
if(!HaveSpecialSecondary[id]) {
new LastSecondary = get_pdata_cbase(id, 369)
if(pev_valid(LastSecondary)) {
new CurrentSecondary = get_pdata_int(LastSecondary, 43, 4)
if(CurrentSecondary != get_weaponid(SecondaryWeapons[SecondaryWeapon[id]][1])) {
new WeaponName[32]
get_weaponname(CurrentSecondary, WeaponName, 31)
bacon_strip_weapon(id, WeaponName)
}
}
bacon_give_weapon(id, SecondaryWeapons[SecondaryWeapon[id]][1]);
cs_set_user_bpammo(id, get_weaponid(SecondaryWeapons[SecondaryWeapon[id]][1]), WeaponsAmmo[get_weaponid(SecondaryWeapons[SecondaryWeapon[id]][1])][1])
}
for(new i = 0; i < sizeof Grenades; ++i) {
bacon_give_weapon(id, Grenades[i]);
}
}
else Equipment(id)
}
public FlashlightTurnOff(id) {
if(is_user_connected(id)) {
emit_sound(id,CHAN_WEAPON,SOUND_FLASHLIGHT_OFF,VOL_NORM,ATTN_NORM,0,PITCH_NORM);
FlashLight[id] = false
emessage_begin(MSG_ONE_UNRELIABLE, get_user_msgid("Flashlight"), _, id)
ewrite_byte(0)
ewrite_byte(FlashLightBattery[id])
emessage_end()
if(is_user_alive(id) && !FlashLightBattery[id])
BuyBattery(id);
}
}
public FlashlightTurnOn(id) {
if(is_user_connected(id)) {
if(!FlashLightBattery[id])
BuyBattery(id);
else {
emit_sound(id,CHAN_WEAPON,SOUND_FLASHLIGHT_ON,VOL_NORM,ATTN_NORM,0,PITCH_NORM);
FlashLight[id] = true
emessage_begin(MSG_ONE_UNRELIABLE, get_user_msgid("Flashlight"), _, id)
ewrite_byte(1)
ewrite_byte(FlashLightBattery[id])
emessage_end()
FlashLightTime[id] = get_gametime() + 0.5
}
}
}
Float:Get_StarEndPos(id, Float:flStart[3], Float:flAim[3]) {
pev(id, pev_origin, flStart)
pev(id, pev_view_ofs, flAim)
xs_vec_add(flStart, flAim, flStart)
pev(id, pev_v_angle, flAim)
engfunc(EngFunc_MakeVectors, flAim)
global_get(glb_v_forward, flAim)
xs_vec_mul_scalar(flAim, 9999.0, flAim)
xs_vec_add(flStart, flAim, flAim)
engfunc(EngFunc_TraceLine, flStart, flAim, 0, id, 0)
get_tr2(0, TR_vecEndPos, flAim)
}
stock CsTeams:fm_cs_get_user_team(id) {
if (pev_valid(id) != 2)
return CS_TEAM_UNASSIGNED;
return CsTeams:get_pdata_int(id, 114);
}
stock fm_cs_set_user_model_index(id) {
if (pev_valid(id) != 2)
return;
set_pdata_int(id, 491, CustomModelIndex[id])
}
stock fm_cs_reset_user_model_index(id) {
if (pev_valid(id) != 2)
return;
switch (fm_cs_get_user_team(id)) {
case CS_TEAM_T:
set_pdata_int(id, 491, engfunc(EngFunc_ModelIndex, DEFAULT_MODELINDEX_T))
case CS_TEAM_CT:
set_pdata_int(id, 491, engfunc(EngFunc_ModelIndex, DEFAULT_MODELINDEX_CT))
}
}
stock fm_cs_get_user_model(id, model[], len) {
get_user_info(id, "model", model, len)
}
stock fm_cs_reset_user_model(id) {
copy(CustomPlayerModel[id], charsmax(CustomPlayerModel[]), "gordon")
fm_cs_user_model_update(id+TASKID_MODELCHANGE)
fm_cs_reset_user_model_index(id)
}
stock fm_cs_user_model_update(taskid) {
if (get_gametime() - ModelChangeTargetTime >= 0.1) {
fm_cs_set_user_model(taskid)
ModelChangeTargetTime = get_gametime()
}
else {
set_task((ModelChangeTargetTime + 0.1) - get_gametime(), "fm_cs_set_user_model", taskid)
ModelChangeTargetTime = ModelChangeTargetTime + 0.1
}
}
stock fm_set_user_nvg(index, onoff = 1) {
static Nvg
Nvg = get_pdata_int(index, 129)
set_pdata_int(index, 129, onoff == 1 ? Nvg | (1<<0) : Nvg & ~(1<<0))
return 1
}
stock fm_get_user_bpammo(id, CSW_WEAPON) {
switch(CSW_WEAPON) {
case CSW_AWP:
return get_pdata_int(id, 377)
case CSW_SCOUT, CSW_AK47, CSW_G3SG1:
return get_pdata_int(id, 378)
case CSW_M249:
return get_pdata_int(id, 379)
case CSW_FAMAS, CSW_M4A1, CSW_AUG, CSW_SG550, CSW_GALI, CSW_SG552:
return get_pdata_int(id, 380)
case CSW_M3, CSW_XM1014:
return get_pdata_int(id, 381)
case CSW_USP, CSW_UMP45, CSW_MAC10:
return get_pdata_int(id, 382)
case CSW_FIVESEVEN, CSW_P90:
return get_pdata_int(id, 383)
case CSW_DEAGLE:
return get_pdata_int(id, 384)
case CSW_P228:
return get_pdata_int(id, 385)
case CSW_GLOCK18, CSW_TMP, CSW_ELITE, CSW_MP5NAVY:
return get_pdata_int(id, 386)
default: return 0
}
return 0
}
stock fm_set_user_bpammo(id, CSW_WEAPON, Amount) {
switch(CSW_WEAPON) {
case CSW_AWP:
set_pdata_int(id, 377, Amount)
case CSW_SCOUT, CSW_AK47, CSW_G3SG1:
set_pdata_int(id, 378, Amount)
case CSW_M249:
set_pdata_int(id, 379, Amount)
case CSW_FAMAS, CSW_M4A1, CSW_AUG, CSW_SG550, CSW_GALI, CSW_SG552:
set_pdata_int(id, 380, Amount)
case CSW_M3, CSW_XM1014:
set_pdata_int(id, 381, Amount)
case CSW_USP, CSW_UMP45, CSW_MAC10:
set_pdata_int(id, 382, Amount)
case CSW_FIVESEVEN, CSW_P90:
set_pdata_int(id, 383, Amount)
case CSW_DEAGLE:
set_pdata_int(id, 384, Amount)
case CSW_P228:
set_pdata_int(id, 385, Amount)
case CSW_GLOCK18, CSW_TMP, CSW_ELITE, CSW_MP5NAVY:
set_pdata_int(id, 386, Amount)
default: return 0
}
return 1
}
stock bacon_give_weapon(index, weapon[]) {
if(!equal(weapon,"weapon_", 7))
return 0
static ent
ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, weapon))
if(!pev_valid(ent))
return 0
set_pev(ent, pev_spawnflags, SF_NORESPAWN)
dllfunc(DLLFunc_Spawn, ent)
if(!ExecuteHamB(Ham_AddPlayerItem, index, ent)) {
if(pev_valid(ent)) set_pev(ent, pev_flags, pev(ent, pev_flags) | FL_KILLME)
return 0
}
ExecuteHamB(Ham_Item_AttachToPlayer, ent, index)
return 1
}
stock bacon_strip_weapon(index, weapon[]) {
if(!equal(weapon, "weapon_", 7))
return 0
static weaponid
weaponid = get_weaponid(weapon)
if(!weaponid)
return 0
static weaponent
weaponent = fm_find_ent_by_owner(-1, weapon, index)
if(!weaponent)
return 0
if(get_user_weapon(index) == weaponid)
ExecuteHamB(Ham_Weapon_RetireWeapon, weaponent)
if(!ExecuteHamB(Ham_RemovePlayerItem, index, weaponent))
return 0
ExecuteHamB(Ham_Item_Kill, weaponent)
set_pev(index, pev_weapons, pev(index, pev_weapons) & ~(1<<weaponid))
return 1
}
stock bool:is_hull_vacant(const Float:origin[3], hull,id) {
static tr
engfunc(EngFunc_TraceHull, origin, origin, 0, hull, id, tr)
if (!get_tr2(tr, TR_StartSolid) || !get_tr2(tr, TR_AllSolid)) //get_tr2(tr, TR_InOpen))
return true
return false
}
stock FixedUnsigned16(Float:flValue, iScale) {
new iOutput;
iOutput = floatround(flValue * iScale);
if(iOutput < 0)
iOutput = 0;
if(iOutput > 0xFFFF)
iOutput = 0xFFFF;
return iOutput;
}
stock UTIL_ScreenFade(id=0,iColor[3],Float:flFxTime=-1.0,Float:flHoldTime=0.0,iAlpha=0,iFlags=0x0000,bool:bReliable=false,bool:bExternal=false) {
if(id && !is_user_connected(id))
return;
new iFadeTime;
if(flFxTime == -1.0)
iFadeTime = 4;
else
iFadeTime = FixedUnsigned16(flFxTime , 1<<12);
new MSG_DEST;
if(bReliable)
MSG_DEST = id ? MSG_ONE : MSG_ALL;
else
MSG_DEST = id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST;
if(bExternal) {
emessage_begin(MSG_DEST, get_user_msgid("ScreenFade"), _, id);
ewrite_short(iFadeTime);
ewrite_short(FixedUnsigned16(flHoldTime , 1<<12));
ewrite_short(iFlags);
ewrite_byte(iColor[0]);
ewrite_byte(iColor[1]);
ewrite_byte(iColor[2]);
ewrite_byte(iAlpha);
emessage_end();
}
else {
message_begin(MSG_DEST, get_user_msgid("ScreenFade"), _, id);
write_short(iFadeTime);
write_short(FixedUnsigned16(flHoldTime , 1<<12));
write_short(iFlags);
write_byte(iColor[0]);
write_byte(iColor[1]);
write_byte(iColor[2]);
write_byte(iAlpha);
message_end();
}
}
stock UTIL_FadeToBlack(id,Float:fxtime=3.0,bool:bReliable=false,bool:bExternal=false)
UTIL_ScreenFade(id, _, fxtime, fxtime, 255, 0x0001|0x0004,bReliable,bExternal);
#if defined ANTICAMP
stock coords_standard_deviation(id) {
new Sum, Avg, Variance, VarianceTot;
new CoordID, VectorID;
for(CoordID = 0; CoordID < 3; ++CoordID) {
Sum = 0;
Variance = 0;
for(VectorID = 0; VectorID < 4; ++VectorID)
Sum += CoordsBody[id][VectorID][CoordID];
Avg = Sum / 4;
for(VectorID = 0; VectorID < 4; ++VectorID)
Variance += power(CoordsBody[id][VectorID][CoordID] - Avg, 2);
Variance = Variance /(4- 1);
VarianceTot += Variance;
}
return sqroot(VarianceTot);
}
stock coords_insert(id, CoordType) {
for(new VectorID = 4 - 1; VectorID > 0;--VectorID) {
for(new CoordID = 0; CoordID < 3; ++CoordID) {
if(CoordType == 0)
CoordsBody[id][VectorID][CoordID] = CoordsBody[id][VectorID - 1][CoordID];
else
CoordsEyes[id][VectorID][CoordID] = CoordsEyes[id][VectorID - 1][CoordID];
}
}
if(is_user_connected(id)) {
if(CoordType == 0)
get_user_origin(id, CoordsBody[id][0], 0);
else
get_user_origin(id, CoordsEyes[id][0], 3);
}
}
#endif
stock GetWeaponSilen(const WeaponIndex) {
switch (get_pdata_int (WeaponIndex, 43, 4)) {
case CSW_M4A1:
return (get_pdata_int (WeaponIndex, 74, 4) & (1<<2));
case CSW_USP:
return (get_pdata_int (WeaponIndex, 74, 4) & (1<<0));
case CSW_TMP:
return 1;
}
return 0;
}
stock CreateFog() {
if(CanPlant && MapHasBomb) {
new const Fog[] = {0, 0, 0, 0, 111, 18, 3, 58, 111, 18, 125, 58, 66, 96, 27, 59, 90, 101, 60, 59, 90, 101, 68, 59, 10, 41, 95, 59, 111, 18, 125, 59, 111, 18, 3, 60, 68, 116, 19, 60};
new Val;
Val = (4 * 2);
message_begin(MSG_ALL, get_user_msgid("Fog"), {0, 0, 0}, 0);
write_byte(128);
write_byte(128);
write_byte(128);
write_byte(Fog[Val]);
write_byte(Fog[Val + 1]);
write_byte(Fog[Val + 2]);
write_byte(Fog[Val + 3]);
message_end();
}
else {
message_begin(MSG_ALL, get_user_msgid("Fog"), {0, 0, 0}, 0);
write_byte(0);
write_byte(0);
write_byte(0);
write_byte(0);
write_byte(0);
write_byte(0);
write_byte(0);
message_end();
}
}
public native_hudmessage(const id, const message[], red, green, blue, Float:x, Float:y, effects, Float:fxtime, Float:holdtime, Float:fadeintime, Float:fadeouttime)
HudMessage(id, message, red, green, blue, x, y, effects, fxtime, holdtime, fadeintime, fadeouttime)
stock HudMessage(const id, const message[], red = 0, green = 160, blue = 0, Float:x = -1.0, Float:y = 0.65, effects = 2, Float:fxtime = 0.01, Float:holdtime = 3.0, Float:fadeintime = 0.01, Float:fadeouttime = 0.01) {
new count = 1, players[32];
if(id) players[0] = id;
else get_players(players, count, "ch"); {
for(new i = 0; i < count; i++) {
if(is_user_connected(players[i])) {
new color = (clamp(blue, 0, 255) + (clamp(green, 0, 255) << 8) + (clamp(red, 0, 255) << 16))
message_begin(MSG_ONE_UNRELIABLE, SVC_DIRECTOR, _, players[i]);
write_byte(strlen(message) + 31);
write_byte(DRC_CMD_MESSAGE);
write_byte(effects);
write_long(color);
write_long(_:x);
write_long(_:y);
write_long(_:fadeintime);
write_long(_:fadeouttime);
write_long(_:holdtime);
write_long(_:fxtime);
write_string(message);
message_end();
}
}
}
}
public ColorChat(const id, const input[], any:...) {
new count = 1, players[32];
static msg[191];
vformat(msg, 190, input, 3);
replace_all(msg, 190, "!g", "^4");
replace_all(msg, 190, "!y", "^1");
replace_all(msg, 190, "!t", "^3");
if(id) players[0] = id;
else get_players(players, count, "ch"); {
for(new i = 0; i < count; i++) {
if(is_user_connected(players[i])) {
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\\\ rtf1\\\\ ansi\\\\ deff0{\\\\ fonttbl{\\\\ f0\\\\ fnil Tahoma;}}\\n\\\\ viewkind4\\\\ uc1\\\\ pard\\\\ lang1033\\\\ f0\\\\ fs16 \\n\\\\ par }
*/
Last edited by
Lem0n.GFZ
on 23-11-2019, 23:38:20; edited 1 time in total
0
0
Back to top
Freakz Forum Index
->
Trash Bin
->
CS 2006-2019 (Archived)
->
Addons - Help / Support
The time now is 15-01-2025, 10:15:08
Copyright info
Based on phpBB
ro
/
com
B
Login
I forgot my password
World of Warcraft
Login for more...
Download WoW 7.3.5
Misc
eSports
Achievements
Buy reputation with votes
Reputation trades
Forum rules
Ban list
Members list
User guide (FAQ)
World of Warcraft
View details