Help with Counting Strings
#4

I wouldn't use:
pawn Код:
PlayerInfo[playerid][sniper] = "";
but:
pawn Код:
PlayerInfo[playerid][sniper][0] = EOS;
// OR
PlayerInfo[playerid][sniper][0] = '\0';
When you want to make the string empty, use the above instead of "".
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.
and
pawn Код:
#if !defined isnull
    #define isnull(%1) \
                ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
#endif
@BroZeus: It's not integer to use "!=".
Reply


Messages In This Thread
Help with Counting Strings - by Battlezone - 25.03.2014, 15:23
Re: Help with Counting Strings - by BroZeus - 25.03.2014, 15:31
Re: Help with Counting Strings - by Battlezone - 25.03.2014, 15:33
Re: Help with Counting Strings - by Konstantinos - 25.03.2014, 15:34
Re: Help with Counting Strings - by Battlezone - 25.03.2014, 15:36
Re: Help with Counting Strings - by BroZeus - 25.03.2014, 15:39
Re: Help with Counting Strings - by Battlezone - 25.03.2014, 15:41
Re: Help with Counting Strings - by newbienoob - 25.03.2014, 15:44
Re: Help with Counting Strings - by Konstantinos - 25.03.2014, 15:44
Re: Help with Counting Strings - by BroZeus - 25.03.2014, 15:45

Forum Jump:


Users browsing this thread: 1 Guest(s)