mirror of
https://github.com/Jackzmc/sourcemod-plugins.git
synced 2025-05-07 14:23:20 +00:00
Fix EPI extra weapon bug
This commit is contained in:
parent
ac1897d5fa
commit
cf19ba0d49
2 changed files with 13 additions and 12 deletions
Binary file not shown.
|
@ -683,15 +683,15 @@ char TIER1_WEAPONS[TIER1_WEAPON_COUNT][] = {
|
||||||
|
|
||||||
#define TIER2_WEAPON_COUNT 9
|
#define TIER2_WEAPON_COUNT 9
|
||||||
char TIER2_WEAPONS[9][] = {
|
char TIER2_WEAPONS[9][] = {
|
||||||
"autoshotgun",
|
"weapon_autoshotgun",
|
||||||
"rifle_ak47",
|
"weapon_rifle_ak47",
|
||||||
"sniper_military",
|
"weapon_sniper_military",
|
||||||
"rifle_sg552",
|
"weapon_rifle_sg552",
|
||||||
"rifle_desert",
|
"weapon_rifle_desert",
|
||||||
"sniper_scout",
|
"weapon_sniper_scout",
|
||||||
"rifle",
|
"weapon_rifle",
|
||||||
"hunting_rifle",
|
"weapon_hunting_rifle",
|
||||||
"shotgun_spas"
|
"weapon_shotgun_spas"
|
||||||
};
|
};
|
||||||
|
|
||||||
public void Frame_SetupNewClient(int client) {
|
public void Frame_SetupNewClient(int client) {
|
||||||
|
@ -712,7 +712,7 @@ public void Frame_SetupNewClient(int client) {
|
||||||
if(wpn > 0) {
|
if(wpn > 0) {
|
||||||
GetEntityClassname(wpn, weaponName, sizeof(weaponName));
|
GetEntityClassname(wpn, weaponName, sizeof(weaponName));
|
||||||
for(int j = 0; j < TIER2_WEAPON_COUNT; j++) {
|
for(int j = 0; j < TIER2_WEAPON_COUNT; j++) {
|
||||||
if(StrEqual(TIER2_WEAPONS[j], weaponName[j][7])) {
|
if(StrEqual(TIER2_WEAPONS[j], weaponName)) {
|
||||||
tier2Weapons.PushString(weaponName);
|
tier2Weapons.PushString(weaponName);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -745,9 +745,10 @@ public void Frame_SetupNewClient(int client) {
|
||||||
|
|
||||||
if(item > 0) {
|
if(item > 0) {
|
||||||
if(L4D2_IsValidWeapon(weaponName)) {
|
if(L4D2_IsValidWeapon(weaponName)) {
|
||||||
L4D_SetReserveAmmo(client, item, L4D2_GetIntWeaponAttribute(weaponName, L4D2IWA_ClipSize));
|
L4D_SetReserveAmmo(client, item, L4D2_GetIntWeaponAttribute(weaponName, L4D2IWA_Bullets));
|
||||||
|
SetEntProp(item, Prop_Send, "m_iClip1", L4D2_GetIntWeaponAttribute(weaponName, L4D2IWA_ClipSize));
|
||||||
} else {
|
} else {
|
||||||
PrintToServer("INVALID WEAPON: %s for %N", weaponName, client);
|
LogError("EPI: INVALID WEAPON: %s for %N", weaponName, client);
|
||||||
}
|
}
|
||||||
EquipPlayerWeapon(client, item);
|
EquipPlayerWeapon(client, item);
|
||||||
} else LogError("EPI Failed to give new late player weapon: %s", weaponName);
|
} else LogError("EPI Failed to give new late player weapon: %s", weaponName);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue