Quote:
Originally Posted by georgik57
problem 2: still getting a tag mismatch error. i think it has to be in the format of the other 2 conditions
|
post me the line
problem 1:
PHP Code:
// User got primary weapons forward
public zpnm_user_got_weapons1_post(id)
{
// Find out what human class our player is using
switch (zpnm_get_user_human_class(id))
{
case g_hclass_desert: // Desert Human gets more fire grenades
{
FireNades[id] = get_pcvar_num(cvar_desert_nades)
give_grenades(id, 0, FireNades[id])
}
case g_hclass_arctic: // Arctic Human gets more frost grenades
{
FrostNades[id] = get_pcvar_num(cvar_arctic_nades)
give_grenades(id, 1, FrostNades[id])
}
case g_hclass_urban: // Urban Human gets more light grenades
{
LightNades[id] = get_pcvar_num(cvar_urban_nades)
give_grenades(id, 2, LightNades[id])
}
}
}
give_grenades(id, iNadeType, iCount)
{
if (!iCount) return;
static const iAmmoIDs[] = { 12, 11, 13 }
static const iWeaponIDs[] = { CSW_HEGRENADE, CSW_FLASHBANG, CSW_SMOKEGRENADE }
static const szNames[][] = { "weapon_hegrenade", "weapon_flashbang", "weapon_smokegrenade" }
if (iCount >= 2)
{
if (!user_has_weapon(id, iWeaponIDs[iNadeType]))
{
give_item(id, szNames[iNadeType])
iCount -= 1
}
cs_set_user_bpammo(id, iWeaponIDs[iNadeType], cs_get_user_bpammo(id, iWeaponIDs[iNadeType]) + iCount)
static msgAmmoPickup
if (msgAmmoPickup || (msgAmmoPickup = get_user_msgid("AmmoPickup")))
{
message_begin(MSG_ONE_UNRELIABLE, msgAmmoPickup, _, id)
write_byte(iAmmoIDs[iNadeType])
write_byte(iCount)
message_end()
}
emit_sound(id, CHAN_ITEM, g_szAmmoPickupSound, 1.0, ATTN_NORM, 0, PITCH_NORM)
}
else
{
give_item(id, szNames[iNadeType])
}
}
__________________