18.01.2013, 10:08
pawn Код:
new count = 0; //Amount of players online
new robamount;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i)) //Foreach is a better option
{
count++;
robamount += ((GetPlayerMoney(i)) / count);
}
}
GivePlayerMoney(playerid, robamount);
So read this: https://sampwiki.blast.hk/wiki/Loops
Just remember, I'm not trying to have a go at you here because you got something wrong, I just want to explain it further, so the OP doesn't have to post about two problems in one thread, or make a new one out of it.