Member
Join Date: Oct 2016
Location: Brazil
|
02-22-2024
, 16:26
Team arms do not work in replay
|
#1
|
Hello everyone, this plugin separates the arm skins for each team.
The only problem is that it doesn't work when I watch a replay on HLTV, the default arm always remains for both teams.
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>
new const VIEW_MODEL[][] =
{
"models/alt/v_knife.mdl", //0
"models/alt/v_p228.mdl", //1
"models/alt/v_knife.mdl", //2
"models/alt/v_scout.mdl", //3
"models/alt/v_hegrenade.mdl", //4
"models/alt/v_xm1014.mdl", //5
"models/alt/v_c4.mdl", //6
"models/alt/v_mac10.mdl", //7
"models/alt/v_aug.mdl", //8
"models/alt/v_smokegrenade.mdl",//9
"models/alt/v_elite.mdl", //10
"models/alt/v_fiveseven.mdl", //11
"models/alt/v_ump45.mdl", //12
"models/alt/v_sg550.mdl", //13
"models/alt/v_galil.mdl", //14
"models/alt/v_famas.mdl", //15
"models/alt/v_usp.mdl", //16
"models/alt/v_glock18.mdl", //17
"models/alt/v_awp.mdl", //18
"models/alt/v_mp5.mdl", //19
"models/alt/v_m249.mdl", //20
"models/alt/v_m3.mdl", //21
"models/alt/v_m4a1.mdl", //22
"models/alt/v_tmp.mdl", //23
"models/alt/v_g3sg1.mdl", //24
"models/alt/v_flashbang.mdl", //25
"models/alt/v_deagle.mdl", //26
"models/alt/v_sg552.mdl", //27
"models/alt/v_ak47.mdl", //28
"models/alt/v_knife.mdl", //29
"models/alt/v_p90.mdl" //30
}
new const OLD_MODEL[][] =
{
"", //0
"models/v_p228.mdl", //1
"", //2
"models/v_scout.mdl", //3
"models/v_hegrenade.mdl", //4
"models/v_xm1014.mdl", //5
"models/v_c4.mdl", //6
"models/v_mac10.mdl", //7
"models/v_aug.mdl", //8
"models/v_smokegrenade.mdl", //9
"models/v_elite.mdl", //10
"models/v_fiveseven.mdl", //11
"models/v_ump45.mdl", //12
"models/v_sg550.mdl", //13
"models/v_galil.mdl", //14
"models/v_famas.mdl", //15
"models/v_usp.mdl", //16
"models/v_glock18.mdl", //17
"models/v_awp.mdl", //18
"models/v_mp5.mdl", //19
"models/v_m249.mdl", //20
"models/v_m3.mdl", //21
"models/v_m4a1.mdl", //22
"models/v_tmp.mdl", //23
"models/v_g3sg1.mdl", //24
"models/v_flashbang.mdl", //25
"models/v_deagle.mdl", //26
"models/v_sg552.mdl", //27
"models/v_ak47.mdl", //28
"models/v_knife.mdl", //29
"models/v_p90.mdl" //30
}
new const g_weapons[][] =
{
"weapon_p228",
"weapon_scout",
"weapon_hegrenade",
"weapon_xm1014",
"weapon_c4",
"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_knife",
"weapon_p90"
}
const m_pPlayer = 41;
new cvar_alteam, primer[33];
public plugin_init()
{
register_plugin("CS:GO Arm Switcher Lite", "2.6", "Cheap_Suit & hellmonja");
register_event("CurWeapon", "Event_CurWeapon", "be","1=1");
RegisterHam(Ham_AddPlayerItem, "player", "FwdAddItem");
for(new i = 0; i <= sizeof g_weapons - 1; i++)
RegisterHam(Ham_Item_Deploy, g_weapons[i], "Fw_ItemDeploy", 1);
cvar_alteam = register_cvar("armsw_team", "1");
}
public plugin_precache()
{
for(new i = 0; i <= CSW_P90; i++)
precache_model(VIEW_MODEL[i]);
}
public Event_CurWeapon(id)
{
if(!is_user_connected(id) || !is_user_alive(id))
return
if(!primer[id])
{
switch_arms(id, get_user_weapon(id));
primer[id] = 1;
}
}
public Fw_ItemDeploy(weapon)
{
static id;
id = get_pdata_cbase(weapon, m_pPlayer, 4);
if(!is_user_connected(id) || !is_user_alive(id))
return PLUGIN_HANDLED
if(get_pcvar_num(cvar_alteam) <= 0 || get_pcvar_num(cvar_alteam) >= 3)
return PLUGIN_CONTINUE
switch_arms(id, cs_get_weapon_id(weapon));
return PLUGIN_CONTINUE
}
public FwdAddItem(id)
{
switch_arms(id, get_user_weapon(id));
}
switch_arms(id, wpnid)
{
static model[32];
pev(id, pev_viewmodel2, model, 31);
if(get_user_team(id) == get_pcvar_num(cvar_alteam) && equali(model, OLD_MODEL[wpnid]))
set_pev(id, pev_viewmodel2, VIEW_MODEL[wpnid]);
return PLUGIN_CONTINUE
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
|
|