mirror of
https://github.com/Jackzmc/sourcemod-plugins.git
synced 2025-05-06 21:53:21 +00:00
Fix extra player item having no ammo
This commit is contained in:
parent
9a4dfb400f
commit
b9132f9246
2 changed files with 7 additions and 4 deletions
Binary file not shown.
|
@ -710,7 +710,7 @@ public void Frame_SetupNewClient(int client) {
|
||||||
if(IsClientConnected(i) && IsClientInGame(i) && GetClientTeam(i) == 2 && IsPlayerAlive(i)) {
|
if(IsClientConnected(i) && IsClientInGame(i) && GetClientTeam(i) == 2 && IsPlayerAlive(i)) {
|
||||||
int wpn = GetPlayerWeaponSlot(client, 0);
|
int wpn = GetPlayerWeaponSlot(client, 0);
|
||||||
if(wpn > 0) {
|
if(wpn > 0) {
|
||||||
GetEntityClassname(wpn, weaponName, sizeof(weaponName));
|
GetEdictClassname(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])) {
|
if(StrEqual(TIER2_WEAPONS[j], weaponName[j])) {
|
||||||
tier2Weapons.PushString(weaponName);
|
tier2Weapons.PushString(weaponName);
|
||||||
|
@ -743,9 +743,12 @@ public void Frame_SetupNewClient(int client) {
|
||||||
}
|
}
|
||||||
delete tier2Weapons;
|
delete tier2Weapons;
|
||||||
|
|
||||||
if(item) {
|
if(item > 0) {
|
||||||
GetEdictClassname(item, weaponName, sizeof(item));
|
if(L4D2_IsValidWeapon(weaponName)) {
|
||||||
L4D_SetReserveAmmo(client, item, L4D2_GetIntWeaponAttribute(weaponName, L4D2IWA_ClipSize));
|
L4D_SetReserveAmmo(client, item, L4D2_GetIntWeaponAttribute(weaponName, L4D2IWA_ClipSize));
|
||||||
|
} else {
|
||||||
|
PrintToServer("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