KliPPy, hmm, sure, it's an option. Though, logic is now less intuitive readable.
Quote:
Originally Posted by MasterMind420
i'm not even really sure what this guys trying to do.
|
Just a matter of convenience, like if I have these lines:
Code:
if (!GiveOrRemoveWeaponOnCondition(client, 0, g_bStartItem_M16, g_bForbid_M16, "weapon_rifle"))
if (!GiveOrRemoveWeaponOnCondition(client, 0, g_bStartItem_Sniper, g_bForbid_Sniper, "weapon_hunting_rifle"))
if (!GiveOrRemoveWeaponOnCondition(client, 0, g_bStartItem_AutoShot, g_bForbid_AutoShot, "weapon_autoshotgun"))
if (!GiveOrRemoveWeaponOnCondition(client, 0, g_bStartItem_PumpShot, g_bForbid_PumpShot, "weapon_pumpshotgun"))
GiveOrRemoveWeaponOnCondition(client, 0, g_bStartItem_SMG, g_bForbid_SMG, "weapon_smg");
And at some point of time if I would like to swap a couple of lines between each other (like, first and last line). I can't do that. I need to to add "if (" to the last line and remove "if (" from 1-st line, then swap.
But, in this sample:
Code:
if (!GiveOrRemoveWeaponOnCondition(client, 0, g_bStartItem_M16, g_bForbid_M16, "weapon_rifle"))
if (!GiveOrRemoveWeaponOnCondition(client, 0, g_bStartItem_Sniper, g_bForbid_Sniper, "weapon_hunting_rifle"))
if (!GiveOrRemoveWeaponOnCondition(client, 0, g_bStartItem_AutoShot, g_bForbid_AutoShot, "weapon_autoshotgun"))
if (!GiveOrRemoveWeaponOnCondition(client, 0, g_bStartItem_PumpShot, g_bForbid_PumpShot, "weapon_pumpshotgun"))
if (!GiveOrRemoveWeaponOnCondition(client, 0, g_bStartItem_SMG, g_bForbid_SMG, "weapon_smg"))
{ dummy() }
I can swap any lines without modification.
--------------------------------
MasterMind420, thank you. I see my mistake. I have extra semicolon after {} in my 1-st post. Really stupid mistake.
Topic is resolved. Thanks for all.
__________________