Raised This Month: $51 Target: $400
 12% 

Team arms do not work in replay


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Naeciof
Member
Join Date: Oct 2016
Location: Brazil
Old 02-22-2024 , 16:26   Team arms do not work in replay
Reply With Quote #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_alteamprimer[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 
0<= sizeof g_weapons 1i++) 
        
RegisterHam(Ham_Item_Deployg_weapons[i], "Fw_ItemDeploy"1);
    
    
cvar_alteam register_cvar("armsw_team""1");
}

public 
plugin_precache()
{
    for(new 
0<= CSW_P90i++) 
        
precache_model(VIEW_MODEL[i]);
}

public 
Event_CurWeapon(id)
{
    if(!
is_user_connected(id) || !is_user_alive(id))
        return
    
    if(!
primer[id])
    {
        
switch_arms(idget_user_weapon(id));
        
primer[id] = 1;
    }
}

public 
Fw_ItemDeploy(weapon)
{
    static 
id;
    
id get_pdata_cbase(weaponm_pPlayer4);
    
    if(!
is_user_connected(id) || !is_user_alive(id))
        return 
PLUGIN_HANDLED
    
    
if(get_pcvar_num(cvar_alteam) <= || get_pcvar_num(cvar_alteam) >= 3)
        return 
PLUGIN_CONTINUE
    
    switch_arms
(idcs_get_weapon_id(weapon));
    
    return 
PLUGIN_CONTINUE 
}

public 
FwdAddItem(id)
{
    
switch_arms(idget_user_weapon(id));
}

switch_arms(idwpnid)
{
    static 
model[32];
    
pev(idpev_viewmodel2model31);
    
    if(
get_user_team(id) == get_pcvar_num(cvar_alteam) && equali(modelOLD_MODEL[wpnid]))
        
set_pev(idpev_viewmodel2VIEW_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 }
*/ 
Naeciof is offline
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 02-23-2024 , 22:38   Re: Team arms do not work in replay
Reply With Quote #2

amxx plugins dont work on demos/replays
__________________
bigdaddy424 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:38.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode