25.03.2014, 15:34
I wouldn't use:
but:
When you want to make the string empty, use the above instead of "".
Now it's null so:
and
@BroZeus: It's not integer to use "!=".
pawn Код:
PlayerInfo[playerid][sniper] = "";
pawn Код:
PlayerInfo[playerid][sniper][0] = EOS;
// OR
PlayerInfo[playerid][sniper][0] = '\0';
Now it's null so:
pawn Код:
new
count; // it doesn't need to be an array as you said in your above post.
if (!isnull(PlayerInfo[playerid][soldier])) ++count;
if (!isnull(PlayerInfo[playerid][sniper])) ++count;
if (!isnull(PlayerInfo[playerid][assault])) ++count;
// format(...);
// Using "count" as argument will give the total classes.
pawn Код:
#if !defined isnull
#define isnull(%1) \
((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
#endif