Help with Counting Strings
#9

Quote:
Originally Posted by BroZeus
Посмотреть сообщение
this maybe -
pawn Код:
new totalclass[MAX_PLAYERS]=0;
if(PlayerInfo[playerid][soldier] != "")totalclass[playerid]++;
if(PlayerInfo[playerid][sniper] != "")totalclass[playerid]++;
if(PlayerInfo[playerid][assault] != "")totalclass[playerid]++;
/*so now in totalcalss[playerid] variable the total number of calsses are loaded*/
Using "!=" will not work for strings, read the above posts.

Quote:
Originally Posted by Battlezone
Посмотреть сообщение
Of course i would use that, but in this situation i found myself obliged to use PlayerInfo[playerid][soldier] = "Soldier"
because i will need that string later xD

You didn't understand. You should make null those you used "" instead. To those you want to add a name, do it. It will count only those which are not null; hence I told you to reset the strings.
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: 2 Guest(s)