for(new>) not working
#1

Quote:

for(new id = 0; id < MAX_PLAYERS; id++)
{
if(PlayerInfo[id][GMember] == group && PlayerInfo[id][pLoggedIn]==true)
{
GCount[playerid]+=1;
}
}
MsgEx(playerid,-1,"There are currently %d Group Members Online",GCount[playerid]);
GCount[playerid] = 0;
return 1;


Well, I get always "2"
Reply
#2

pawn Code:
for(new id = 0; id < MAX_PLAYERS; id++)
{
  if(PlayerInfo[id][GMember] == group && PlayerInfo[id][pLoggedIn]==true)
 {
    GCount[id] ++;
  }
}
MsgEx(playerid,-1,"There are currently %d Group Members Online",GCount[playerid]);
GCount[playerid] = 0;
return 1;
try this
Reply
#3

still the same & that is not making sense in this case :c
Reply
#4

is that a cmd ? try using normal variable

pawn Code:
new GCount = 0;
for(new id = 0, j = GetPlayerPoolSize(); id <= j; id++)
{
    if(PlayerInfo[id][pLoggedIn] && PlayerInfo[id][GMember] == group)
    {
        GCount++; //Using id here was a mistake
    }
}
MsgEx(playerid, -1, "There are currently %d Group Members Online", GCount);
return 1;
this should absolutely work fine, if it doesn't the problem occurs from somewhere else, maybe at "group"
Reply
#5

works fine with this code +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)