25.12.2013, 12:09
(
Last edited by Emmet_; 25/12/2013 at 01:44 PM.
)
Nice function, however you should use a static constant array instead of multiple switch values, like so:
---
Swap any values (float, boolean) with this function:
pawn Code:
stock GetWeaponModel(playerid)
{
static const MyArray[] =
{
0,
331,
333,
334,
// so on...
};
return MyArray[GetPlayerWeapon(playerid)]);
}
Swap any values (float, boolean) with this function:
pawn Code:
stock swap(&{Float,_}:var1, &{Float,_}:var2)
{
#emit LREF.S.pri var1
#emit LREF.S.alt var2
#emit SREF.S.pri var2
#emit SREF.S.alt var1
}